:root {
  --g-50: #f5f9ec;
  --g-100: #e9f2d8;
  --g-200: #d4e7b3;
  --g-300: #b5d687;
  --g-400: #8fc15a;
  --g-500: #6fa83c;
  --g-600: #55882b;
  --g-700: #3f6a22;
  --g-800: #2d4c19;
  --pink: #f2a5b3;
  --pink-soft: #fde8ec;
  --amber: #e9a23b;
  --amber-soft: #fdf1dc;
  --red: #d9534f;
  --red-soft: #fbe5e4;
  --blue: #4a90c2;
  --blue-soft: #e3f0f9;
  --gray: #8a9580;
  --gray-soft: #f0f2ec;
  --text: #2f3a28;
  --text-2: #5e6b55;
  --line: #e3ebd6;
  --card: #ffffff;
  --radius: 16px;
  --shadow: 0 6px 24px rgba(85, 136, 43, .10);
  --shadow-sm: 0 2px 8px rgba(85, 136, 43, .08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Noto Sans SC", system-ui, sans-serif;
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  background-color: #f8fbf1;
  /* 浅绿格子底纹，呼应 LOGO */
  background-image:
    linear-gradient(90deg, rgba(181, 214, 135, .22) 50%, transparent 50%),
    linear-gradient(rgba(181, 214, 135, .22) 50%, transparent 50%);
  background-size: 64px 64px;
  min-height: 100vh;
}
a { color: var(--g-600); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }

/* ---------------- 按钮 / 表单 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--g-200); background: #fff; color: var(--g-700);
  cursor: pointer; white-space: nowrap; transition: .15s; font-weight: 500;
}
.btn:hover { background: var(--g-50); border-color: var(--g-300); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: linear-gradient(180deg, var(--g-400), var(--g-500)); color: #fff; border-color: var(--g-500); box-shadow: 0 3px 10px rgba(111, 168, 60, .3); }
.btn.primary:hover { background: linear-gradient(180deg, var(--g-500), var(--g-600)); }
.btn.danger { color: var(--red); border-color: #f0c9c7; }
.btn.danger:hover { background: var(--red-soft); }
.btn.sm { height: 28px; padding: 0 11px; font-size: 13px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--g-50); }
.btn.block { width: 100%; height: 44px; font-size: 15px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 13px; color: var(--text-2); font-weight: 600; }
.field > label .req { color: var(--red); margin-left: 2px; }
.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; outline: none; transition: .15s;
}
.textarea { height: auto; min-height: 72px; padding: 9px 12px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--g-400); box-shadow: 0 0 0 3px rgba(143, 193, 90, .2); }
.input:disabled, .select:disabled, .textarea:disabled { background: var(--gray-soft); color: var(--gray); }
.hint { font-size: 12px; color: var(--gray); }

/* ---------------- 徽章 ---------------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge.green { background: var(--g-100); color: var(--g-700); }
.badge.amber { background: var(--amber-soft); color: #a86a10; }
.badge.red { background: var(--red-soft); color: #b0302c; }
.badge.gray { background: var(--gray-soft); color: var(--gray); }
.badge.blue { background: var(--blue-soft); color: #2d6a96; }
.badge.pink { background: var(--pink-soft); color: #c0566a; }
[hidden] { display: none !important; }
.dot { display: inline-block; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; line-height: 18px; text-align: center; font-weight: 700; }

/* ---------------- 登录页 ---------------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-card {
  width: 100%; max-width: 920px; display: grid; grid-template-columns: 1.05fr 1fr;
  background: var(--card); border-radius: 28px; overflow: hidden; box-shadow: 0 20px 60px rgba(85, 136, 43, .18);
  border: 4px solid #fff;
}
.auth-art {
  position: relative; background: linear-gradient(160deg, #f4f9e9, #e3f0cc);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 28px 20px 0; min-height: 520px;
}
.auth-art img.mascot { width: 88%; max-width: 380px; display: block; mix-blend-mode: multiply; }
.auth-art .slogan { position: absolute; top: 28px; left: 0; right: 0; text-align: center; }
.auth-art .slogan h2 { margin: 0; font-size: 26px; color: var(--g-600); letter-spacing: 4px; }
.auth-art .slogan p { margin: 4px 0 0; color: var(--text-2); font-size: 13px; letter-spacing: 1px; }
.auth-form { padding: 40px 40px 32px; display: flex; flex-direction: column; }
.auth-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-logo img { width: 64px; height: 64px; border-radius: 18px; box-shadow: var(--shadow-sm); }
.auth-logo .t1 { font-size: 22px; font-weight: 800; color: var(--g-700); letter-spacing: 2px; }
.auth-logo .t2 { font-size: 13px; color: var(--text-2); }
.tabs { display: flex; gap: 6px; background: var(--g-50); padding: 5px; border-radius: 999px; margin-bottom: 22px; }
.tabs button { flex: 1; height: 36px; border: 0; border-radius: 999px; background: transparent; cursor: pointer; color: var(--text-2); font-weight: 600; }
.tabs button.on { background: #fff; color: var(--g-700); box-shadow: var(--shadow-sm); }
.auth-form form { display: flex; flex-direction: column; gap: 16px; }
.auth-tip { margin-top: auto; padding-top: 18px; font-size: 12px; color: var(--gray); text-align: center; }
.notice { padding: 10px 14px; border-radius: 12px; font-size: 13px; }
.notice.ok { background: var(--g-100); color: var(--g-700); }
.notice.warn { background: var(--amber-soft); color: #8a5a0d; }
.notice.err { background: var(--red-soft); color: #a5302c; }

.pending-box { text-align: center; padding: 10px 0 0; }
.pending-box .pending-ic { width: 72px; height: 72px; margin: 0 auto 10px; border-radius: 50%; background: var(--amber-soft); display: flex; align-items: center; justify-content: center; font-size: 34px; }
.pending-box h2 { margin: 0 0 10px; color: var(--g-700); font-size: 20px; }
.pending-box p { margin: 4px 0; color: var(--text-2); }
.pending-box .pending-meta { margin-top: 10px; font-size: 12px; color: var(--gray); }

/* ---------------- 主框架 ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .88); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { max-width: 1320px; margin: 0 auto; padding: 0 20px; height: 68px; display: flex; align-items: center; gap: 22px; }
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand img { width: 46px; height: 46px; border-radius: 13px; box-shadow: var(--shadow-sm); }
.brand .bt1 { font-weight: 800; font-size: 17px; color: var(--g-700); letter-spacing: 1px; line-height: 1.2; }
.brand .bt2 { font-size: 12px; color: var(--text-2); }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 16px; border-radius: 999px; color: var(--text-2); font-weight: 600; white-space: nowrap; text-decoration: none; }
.nav a:hover { background: var(--g-50); color: var(--g-700); }
.nav a.on { background: var(--g-100); color: var(--g-700); }
.userbox { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 2px solid var(--g-200); background: var(--g-50); }
.userbox .who { font-size: 13px; line-height: 1.25; }
.userbox .who b { display: block; color: var(--text); }
.userbox .who span { color: var(--gray); font-size: 12px; }

.main { max-width: 1320px; margin: 0 auto; padding: 24px 20px 60px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 22px; color: var(--g-800); display: flex; align-items: center; gap: 10px; }
.page-head h1 .leaf { width: 10px; height: 22px; border-radius: 6px; background: linear-gradient(var(--g-300), var(--g-500)); }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid #fff; }
.card-pad { padding: 20px; }
.card h3 { margin: 0 0 14px; font-size: 15px; color: var(--g-800); }

/* 统计卡 */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { padding: 16px 18px; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.stat::after { content: ""; position: absolute; right: -18px; bottom: -18px; width: 70px; height: 70px; border-radius: 50%; background: var(--g-50); }
.stat .k { font-size: 13px; color: var(--text-2); position: relative; z-index: 1; }
.stat .v { font-size: 28px; font-weight: 800; color: var(--g-700); line-height: 1.3; position: relative; z-index: 1; }
.stat .s { font-size: 12px; color: var(--gray); position: relative; z-index: 1; }
.stat.amber .v { color: #c27a12; } .stat.amber::after { background: var(--amber-soft); }
.stat.red .v { color: var(--red); } .stat.red::after { background: var(--red-soft); }
.stat.pink .v { color: #c0566a; } .stat.pink::after { background: var(--pink-soft); }

.grid-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; margin-bottom: 16px; }

/* 工具栏 */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.toolbar .input, .toolbar .select { height: 36px; width: auto; min-width: 130px; }
.toolbar .input.kw { min-width: 200px; }
.toolbar .grow { flex: 1; }
.seg { display: inline-flex; background: var(--g-50); border-radius: 999px; padding: 4px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 0 14px; height: 30px; border-radius: 999px; cursor: pointer; color: var(--text-2); font-weight: 600; }
.seg button.on { background: #fff; color: var(--g-700); box-shadow: var(--shadow-sm); }

/* 表格 */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; min-width: 880px; }
.tbl th, .tbl td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl th { font-size: 12px; color: var(--text-2); font-weight: 700; background: var(--g-50); white-space: nowrap; }
.tbl tbody tr:hover { background: #fbfdf7; }
.tbl tbody tr.click { cursor: pointer; }
.tbl td.nowrap { white-space: nowrap; }
.tbl .acts { display: flex; gap: 6px; flex-wrap: nowrap; }
.tbl .muted { color: var(--gray); font-size: 12px; }
.thumbs { display: flex; gap: 4px; }
.thumbs img { width: 34px; height: 34px; border-radius: 6px; object-fit: cover; border: 1px solid var(--line); }
.thumbs .more { width: 34px; height: 34px; border-radius: 6px; background: var(--g-50); color: var(--g-600); font-size: 12px; display: flex; align-items: center; justify-content: center; }
.media-ic { display: inline-flex; gap: 6px; }
.empty { padding: 56px 20px; text-align: center; color: var(--gray); }
.empty img { width: 120px; border-radius: 50%; opacity: .9; margin-bottom: 8px; mix-blend-mode: multiply; }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; color: var(--text-2); font-size: 13px; gap: 10px; flex-wrap: wrap; }
.pager .pgs { display: flex; gap: 6px; align-items: center; }

/* 趋势图 */
.chart { width: 100%; height: 220px; }
.chart .bar { fill: var(--g-300); transition: .15s; }
.chart .bar:hover { fill: var(--g-500); }
.chart text { font-size: 10px; fill: var(--gray); }
.chart .gridline { stroke: var(--line); stroke-dasharray: 3 3; }
.dist { display: flex; flex-direction: column; gap: 12px; }
.dist-row .lbl { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.dist-bar { height: 10px; border-radius: 6px; background: var(--g-50); display: flex; overflow: hidden; }
.dist-bar i { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--text-2); margin-top: 6px; }
.legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 4px; background: var(--c); }
.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-list li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.rank-list li:last-child { border-bottom: 0; }
.rank-list .no { width: 24px; height: 24px; border-radius: 8px; background: var(--g-50); color: var(--g-600); font-weight: 800; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.rank-list li:nth-child(1) .no { background: #ffe9a8; color: #a26b00; }
.rank-list li:nth-child(2) .no { background: #e6ecf2; color: #5b6b7c; }
.rank-list li:nth-child(3) .no { background: #f6dcc6; color: #9a5a2b; }
.rank-list .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-list .ct { font-weight: 800; color: var(--g-700); }

/* ---------------- 弹窗 ---------------- */
.mask { position: fixed; inset: 0; background: rgba(45, 76, 25, .35); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; animation: fade .15s; }
.modal { width: 100%; max-width: 760px; background: #fff; border-radius: 22px; box-shadow: 0 24px 70px rgba(45, 76, 25, .3); animation: pop .18s; }
.modal.sm { max-width: 420px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 17px; color: var(--g-800); }
.modal-body { padding: 20px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px 20px; flex-wrap: wrap; align-items: center; }
.x { width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--g-50); cursor: pointer; font-size: 18px; color: var(--text-2); }
.x:hover { background: var(--g-100); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(12px) scale(.98); opacity: 0; } }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.section-title { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; margin: 6px 0 -4px; font-weight: 700; color: var(--g-700); font-size: 14px; }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.locked { grid-column: 1 / -1; border: 1px dashed var(--g-300); background: var(--g-50); border-radius: 14px; padding: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.locked .lock-tip { grid-column: 1 / -1; font-size: 12px; color: var(--g-700); display: flex; align-items: center; gap: 6px; }
.admin-box { grid-column: 1 / -1; border: 1px solid #f5d8a8; background: #fffaf0; border-radius: 14px; padding: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.admin-box .lock-tip { grid-column: 1 / -1; font-size: 12px; color: #9a6510; font-weight: 600; }

/* 上传区 */
.uploader { border: 1.5px dashed var(--g-300); border-radius: 14px; padding: 12px; background: #fcfef8; }
.uploader.drag { background: var(--g-50); border-color: var(--g-500); }
.up-items { display: flex; flex-wrap: wrap; gap: 10px; }
.up-item { position: relative; width: 88px; height: 88px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--g-50); }
.up-item img, .up-item video { width: 100%; height: 100%; object-fit: cover; display: block; }
.up-item.vid { width: 180px; }
.up-item .rm { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .55); color: #fff; cursor: pointer; font-size: 13px; line-height: 22px; padding: 0; }
.up-item .nm { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, .5); color: #fff; font-size: 11px; padding: 2px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-item .new { position: absolute; top: 4px; left: 4px; background: var(--g-500); color: #fff; font-size: 10px; padding: 0 6px; border-radius: 6px; }
.up-add { width: 88px; height: 88px; border-radius: 10px; border: 1.5px dashed var(--g-300); background: #fff; color: var(--g-600); display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; font-size: 12px; gap: 2px; }
.up-add b { font-size: 24px; line-height: 1; font-weight: 400; }
.up-add:hover { border-color: var(--g-500); background: var(--g-50); }
.progress { height: 8px; border-radius: 4px; background: var(--g-100); overflow: hidden; flex: 1; min-width: 160px; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--g-400), var(--g-600)); width: 0; transition: width .2s; }

/* 详情 */
.kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.kv > div { background: var(--g-50); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.kv .k { font-size: 12px; color: var(--text-2); }
.kv .v { font-weight: 700; word-break: break-all; }
.detail-sec { margin-top: 18px; }
.detail-sec h4 { margin: 0 0 10px; font-size: 14px; color: var(--g-700); display: flex; align-items: center; gap: 8px; }
.gallery { display: flex; flex-wrap: wrap; gap: 10px; }
.gallery img { width: 120px; height: 120px; object-fit: cover; border-radius: 12px; cursor: zoom-in; border: 1px solid var(--line); }
.videos { display: flex; flex-direction: column; gap: 10px; }
.videos video { width: 100%; max-height: 420px; border-radius: 12px; background: #000; }
.videos .vname { font-size: 12px; color: var(--text-2); display: flex; justify-content: space-between; }
.none { color: var(--gray); font-size: 13px; }

.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(0, 0, 0, .85); display: flex; align-items: center; justify-content: center; padding: 30px; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }
.lightbox .nav-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .2); color: #fff; font-size: 22px; cursor: pointer; }
.lightbox .prev { left: 16px; } .lightbox .next { right: 16px; }

/* 提示 */
#toast-root { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { padding: 10px 18px; border-radius: 999px; background: #fff; box-shadow: var(--shadow); font-weight: 600; animation: pop .2s; border: 1px solid var(--line); }
.toast.ok { color: var(--g-700); }
.toast.err { color: var(--red); }

.loading { padding: 40px; text-align: center; color: var(--gray); }

/* ---------------- 响应式 ---------------- */
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .auth-card { grid-template-columns: 1fr; }
  .auth-art { min-height: 0; padding-top: 80px; }
  .auth-art img.mascot { width: 56%; }
  .auth-form { padding: 28px 22px 24px; }
  .kv { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .topbar-inner { flex-wrap: wrap; height: auto; padding: 10px 16px 0; gap: 8px; }
  .brand .bt2 { display: none; }
  .userbox { margin-left: auto; }
  .userbox .who { display: none; }
  .nav { order: 3; flex-basis: 100%; padding-bottom: 8px; }
  .main { padding: 16px 16px 40px; }
  .form-grid, .locked, .admin-box { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat .v { font-size: 22px; }
  .toolbar .input, .toolbar .select, .toolbar .input.kw { flex: 1 1 140px; min-width: 0; }
  .mask { padding: 12px 8px; }
  .kv { grid-template-columns: 1fr; }
}
