* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --green: #2E9E6B;
  --deep: #1B7A4B;
  --mint: #DCF3E7;
  --ink: #17392B;
  --body: #4A6157;
  --dim: #84998F;
  --bg: #F2F8F1;
  --line: #E3EFE7;
  --white: #fff;
}
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; color: var(--ink); background: var(--bg); font-size: 14px; }
.hidden { display: none !important; }
button, input, select { font-family: inherit; font-size: 14px; outline: none; }

/* 登录 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #2E9E6B, #1B7A4B); }
.login-card { width: 380px; background: #fff; border-radius: 20px; padding: 40px 36px; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.login-logo { font-size: 48px; text-align: center; }
.login-card h1 { text-align: center; font-size: 26px; margin-top: 8px; }
.login-sub { text-align: center; color: var(--dim); margin: 6px 0 28px; }
.login-card label { display: block; font-size: 13px; color: var(--body); margin-bottom: 8px; }
.login-card input { width: 100%; height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 0 14px; }
.login-card input:focus { border-color: var(--green); }
.btn-primary { width: 100%; height: 44px; background: var(--green); color: #fff; border: none; border-radius: 10px; font-weight: 600; cursor: pointer; margin-top: 18px; }
.btn-primary:hover { background: var(--deep); }
.btn-primary.sm, .btn-ghost.sm { width: auto; height: 34px; padding: 0 16px; margin: 0; font-size: 13px; }
.btn-ghost { height: 44px; background: var(--mint); color: var(--deep); border: none; border-radius: 10px; padding: 0 20px; font-weight: 600; cursor: pointer; }
.login-tip { color: #c4551f; font-size: 13px; margin-top: 12px; min-height: 18px; }
.login-foot { text-align: center; color: var(--dim); font-size: 12px; margin-top: 24px; }

/* 布局 */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: var(--white); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; z-index: 10; }
.brand { display: flex; align-items: center; gap: 10px; padding: 22px 20px; border-bottom: 1px solid var(--line); }
.brand-ico { width: 40px; height: 40px; border-radius: 12px; background: var(--mint); display: flex; align-items: center; justify-content: center; font-size: 22px; }
.brand-name { font-weight: 700; font-size: 15px; }
.brand-sub { font-size: 12px; color: var(--dim); }
.nav { flex: 1; overflow-y: auto; padding: 12px 10px; }
.nav-group { font-size: 11px; color: var(--dim); padding: 16px 12px 6px; font-weight: 600; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 9px; cursor: pointer; color: var(--body); }
.nav-item:hover { background: var(--bg); }
.nav-item.active { background: var(--mint); color: var(--deep); font-weight: 600; }
.ni { font-size: 17px; }
.sidebar-foot { padding: 14px 18px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--dim); }
.env-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.logout { margin-left: auto; background: none; border: none; color: var(--dim); cursor: pointer; }

.main { flex: 1; margin-left: 220px; width: calc(100% - 220px); }
.topbar { height: 64px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 28px; position: sticky; top: 0; z-index: 5; }
.tb-title { font-size: 18px; font-weight: 700; }
.tb-right { display: flex; align-items: center; gap: 16px; }
.tb-badge { font-size: 12px; color: var(--dim); }
.tb-user { font-size: 13px; color: var(--body); background: var(--bg); padding: 6px 14px; border-radius: 18px; }
.content { padding: 24px 28px 60px; }
.page-section { display: none; }
.page-section.active { display: block; }

/* 卡片 / 面板 */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat-card { background: #fff; border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 6px; box-shadow: 0 2px 12px rgba(27,122,75,.04); }
.sc-ico { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.sc-ico.green { background: #DCF3E7; } .sc-ico.blue { background: #E7F1FB; } .sc-ico.orange { background: #FCEEE0; } .sc-ico.purple { background: #EFE9F7; }
.sc-num { font-size: 30px; font-weight: 700; margin-top: 6px; }
.sc-label { font-size: 13px; color: var(--dim); }
.panel { background: #fff; border-radius: 14px; padding: 22px; margin-bottom: 20px; box-shadow: 0 2px 12px rgba(27,122,75,.04); }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.panel-head h3 { font-size: 16px; }
.hint { font-size: 13px; color: var(--dim); line-height: 1.7; margin-bottom: 16px; }
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.quick-item { border: 1px solid var(--line); border-radius: 12px; padding: 18px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; }
.quick-item:hover { border-color: var(--green); background: #FAFDFB; }
.quick-item span { font-size: 26px; }
.quick-item b { font-size: 14px; }
.quick-item small { color: var(--dim); font-size: 12px; }
.notice p { color: var(--body); line-height: 2; font-size: 13px; }

/* 表单 */
.form-row { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.form-row input, .form-row select { height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; flex: 1; min-width: 180px; }
.form-row input:focus, .form-row select:focus { border-color: var(--green); }

/* 图片网格 */
.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.img-card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; position: relative; }
.img-card img { width: 100%; height: 130px; object-fit: cover; display: block; background: var(--bg); }
.img-card .ic-info { padding: 8px 10px; font-size: 12px; }
.img-card .ic-info b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.img-card .ic-info span { color: var(--dim); }
.img-card .ic-del { position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,.55); color: #fff; border: none; border-radius: 50%; width: 26px; height: 26px; cursor: pointer; font-size: 13px; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--dim); font-weight: 600; background: #FAFCFB; }
td .action { color: var(--green); cursor: pointer; margin-right: 10px; }
td .action.danger { color: #c4551f; }
.empty { text-align: center; color: var(--dim); padding: 40px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 16px; font-size: 13px; color: var(--dim); }
.pager button { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 14px; cursor: pointer; }
.pager button:hover { border-color: var(--green); }

/* 弹窗 */
.modal { position: fixed; inset: 0; background: rgba(10,30,20,.5); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal-box { background: #fff; border-radius: 16px; width: 520px; max-width: 92vw; max-height: 84vh; display: flex; flex-direction: column; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 16px; }
.modal-head button { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--dim); }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-body label { display: block; font-size: 13px; color: var(--body); margin: 12px 0 6px; }
.modal-body input, .modal-body select, .modal-body textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.modal-body textarea { min-height: 90px; resize: vertical; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--line); }
.modal-foot .btn-primary, .modal-foot .btn-ghost { width: auto; margin: 0; padding: 0 24px; height: 38px; }

/* 指南 */
.guide h3 { margin-bottom: 16px; }
.guide h4 { margin: 20px 0 8px; color: var(--deep); }
.guide p, .guide li { color: var(--body); line-height: 1.9; font-size: 13px; }
.guide ul { padding-left: 20px; }
.guide code { background: var(--bg); color: var(--deep); padding: 2px 6px; border-radius: 4px; font-size: 12px; }
.cur-api { margin-top: 10px; font-size: 12px; color: var(--dim); }
.cur-api span { color: var(--deep); }

/* toast */
.toast { position: fixed; top: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 24px; border-radius: 24px; z-index: 100; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.2); }

@media (max-width: 900px) {
  .sidebar { width: 64px; }
  .brand > div:last-child, .nav-item:not(.active) { font-size: 0; }
  .nav-group, .sidebar-foot span { display: none; }
  .main { margin-left: 64px; width: calc(100% - 64px); }
  .stat-grid, .quick-grid { grid-template-columns: repeat(2, 1fr); }
}
