:root {
  --primary: #1f9d66;
  --primary-dark: #157348;
  --primary-light: #e8f8f0;
  --bg: #f5f8f7;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --white: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

.login-page {
  min-height: 100vh;
  background: radial-gradient(circle at top left, #e7f8ef, transparent 32%), linear-gradient(135deg, #f8fffb, #edf8f2);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 420px;
  max-width: 100%;
  background: var(--white);
  border-radius: 22px;
  padding: 38px;
  box-shadow: 0 18px 50px rgba(23, 57, 45, 0.12);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.logo-circle {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
}

.login-brand h1 {
  font-size: 22px;
  margin: 0;
  font-weight: 800;
}

.login-brand p {
  margin: 4px 0 0;
  color: var(--muted);
}

.admin-layout {
  min-height: 100vh;
  display: flex;
}

.sidebar {
  width: 248px;
  background: #17392d;
  color: #dcefe7;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: 20;
}

.sidebar-brand {
  height: 72px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 22px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-brand strong {
  display: block;
  color: #fff;
  font-size: 17px;
}

.sidebar-brand small {
  color: #a9c8bb;
}

.side-menu {
  padding: 14px 12px;
}

.side-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #dcefe7;
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 6px;
  text-decoration: none;
  transition: all .2s ease;
}

.side-menu a:hover,
.side-menu a.active {
  background: rgba(31, 157, 102, 0.22);
  color: #fff;
}

.main-panel {
  margin-left: 248px;
  width: calc(100% - 248px);
  min-height: 100vh;
}

.topbar {
  height: 72px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-title h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
}

.topbar-title p {
  margin: 4px 0 0;
  color: var(--muted);
}

.content-wrap {
  padding: 24px;
}

.page-section {
  display: none;
}

.page-section.active {
  display: block;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}

.stat-card,
.panel-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
}

.stat-card span {
  color: var(--muted);
}

.stat-card strong {
  display: block;
  font-size: 32px;
  color: var(--primary);
  margin-top: 10px;
}

.panel-card + .panel-card {
  margin-top: 18px;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-title h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

.search-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.search-bar .layui-input,
.search-bar .layui-select {
  width: 190px;
}

.table-actions {
  display: flex;
  gap: 8px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.upload-preview {
  width: 92px;
  height: 92px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  object-fit: cover;
  background: var(--primary-light);
}

.editor-box {
  min-height: 220px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  background: #fff;
}

.status-dot {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 12px;
}

@media (max-width: 992px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform .25s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-panel {
    margin-left: 0;
    width: 100%;
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 576px) {
  .content-wrap {
    padding: 16px;
  }

  .stat-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    padding: 0 16px;
  }
}
