:root {
  --bg: #fff5f7;
  --bg-soft: #fff9fb;
  --panel: rgba(255, 255, 255, 0.9);
  --soft: #fff6fa;
  --soft-strong: #ffeaf2;
  --line: rgba(213, 143, 171, 0.2);
  --text: #4c2f3e;
  --muted: #8e6c7c;
  --primary: #de7298;
  --primary-deep: #c4567d;
  --secondary: #f2a8bf;
  --danger: #dc6f82;
  --success: #4fa383;
  --sidebar: linear-gradient(180deg, #f3a7c3 0%, #e486ab 52%, #d66c98 100%);
  --shadow: 0 24px 60px rgba(194, 106, 143, 0.14);
  --radius: 18px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.95), transparent 32%),
    radial-gradient(circle at bottom right, rgba(255, 216, 230, 0.65), transparent 26%),
    linear-gradient(180deg, #fff8fb 0%, #fff1f5 54%, #fff7f9 100%);
}
button, input, select, textarea { font: inherit; }
h1, h2, h3, h4, p { margin: 0; }

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.16em;
  font-weight: 800;
  color: var(--primary);
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at top left, rgba(255,255,255,0.95), transparent 36%),
    radial-gradient(circle at 80% 20%, rgba(255, 213, 228, 0.55), transparent 24%),
    linear-gradient(135deg, #fff8fb 0%, #fff0f6 48%, #ffe7ef 100%);
}

.login-shell {
  width: min(980px, calc(100% - 24px));
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  align-items: stretch;
}

.login-brand, .login-card, .panel, .topbar, .stat-card, .brand-card, .modal-card {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.login-brand {
  border-radius: 28px;
  padding: 32px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.login-brand img {
  width: 160px;
  height: 160px;
  object-fit: contain;
  filter: drop-shadow(0 14px 24px rgba(233, 144, 180, 0.18));
}
.login-brand h1,
.topbar h2,
.panel-head h3,
.brand-card h1 {
  font-family: "STSong", "Songti SC", "PingFang SC", serif;
  letter-spacing: 0.02em;
}
.login-brand h1 { font-size: 42px; margin: 10px 0 12px; }
.login-brand p:last-child { color: var(--muted); line-height: 1.8; }

.login-card {
  border-radius: 28px;
  padding: 32px;
}

.login-card h2 { margin-bottom: 20px; font-size: 28px; }
.form-stack, .form-grid { display: grid; gap: 14px; }
label { display: grid; gap: 8px; color: var(--muted); font-size: 14px; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: rgba(222, 114, 152, 0.65);
  box-shadow: 0 0 0 4px rgba(222, 114, 152, 0.14);
}

.checkbox-line { display: flex; align-items: center; gap: 8px; }
.checkbox-line input { width: auto; }
.tips { margin-top: 14px; color: var(--muted); font-size: 13px; }
.error-text { margin-top: 10px; color: var(--danger); min-height: 20px; }

.primary-button, .ghost-button, .danger-button, .text-button {
  border: 0;
  cursor: pointer;
  transition: transform 0.16s ease, opacity 0.16s ease;
}
.primary-button, .ghost-button, .danger-button {
  padding: 11px 16px;
  border-radius: 12px;
  font-weight: 700;
}
.primary-button {
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-deep) 100%);
  color: #fff;
  box-shadow: 0 12px 24px rgba(212, 98, 142, 0.18);
}
.ghost-button {
  background: rgba(255, 249, 252, 0.9);
  color: var(--primary-deep);
  border: 1px solid rgba(214, 124, 160, 0.24);
}
.danger-button {
  background: #fff1f4;
  color: var(--danger);
  border: 1px solid rgba(220, 111, 130, 0.24);
}
.text-button { background: transparent; color: var(--danger); padding: 0; }
.primary-button:hover, .ghost-button:hover, .danger-button:hover, .text-button:hover { transform: translateY(-1px); opacity: 0.95; }

.admin-shell { min-height: 100vh; display: grid; grid-template-columns: 260px minmax(0, 1fr); }
.sidebar {
  padding: 20px;
  background: var(--sidebar);
  display: flex;
  flex-direction: column;
  gap: 18px;
  color: #fff7fb;
  position: relative;
  overflow: hidden;
}
.sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top left, rgba(255,255,255,0.24), transparent 28%),
    radial-gradient(circle at bottom right, rgba(255,255,255,0.16), transparent 32%);
  pointer-events: none;
}
.brand-card {
  border-radius: 24px;
  padding: 18px;
  display: flex;
  gap: 16px;
  align-items: center;
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.14);
  box-shadow: none;
  position: relative;
  z-index: 1;
}
.brand-card img {
  width: 76px;
  height: 76px;
  object-fit: contain;
  border-radius: 18px;
  background: rgba(255,255,255,0.22);
  box-shadow: 0 8px 18px rgba(173, 75, 118, 0.18);
}
.brand-card .eyebrow, .brand-card h1, .brand-card span { color: #fff; }
.brand-card h1 { font-size: 26px; margin: 8px 0 4px; }
.brand-card span { font-size: 13px; opacity: 0.85; }

.nav-list { display: grid; gap: 10px; }
.nav-item {
  border: 0;
  text-align: left;
  color: #fff9fc;
  border-radius: 14px;
  background: rgba(255,255,255,0.08);
  padding: 12px 14px;
  font-weight: 700;
  position: relative;
  z-index: 1;
}
.nav-item.active,
.nav-item:hover {
  background: rgba(255,255,255,0.2);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12);
}

.main-shell { padding: 20px; display: grid; gap: 18px; }
.topbar {
  border-radius: 22px;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.topbar h2 { margin-top: 8px; font-size: 30px; }
.topbar-right { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.user-chip {
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--soft);
  border: 1px solid var(--line);
  display: grid;
  gap: 2px;
  min-width: 160px;
}
.user-chip span, .user-chip small { color: var(--muted); }

.page-section { display: none; gap: 18px; }
.page-section.active { display: grid; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.stat-card {
  border-radius: var(--radius);
  padding: 18px;
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: "";
  position: absolute;
  right: -14px;
  top: -14px;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 214, 228, 0.7), rgba(255, 214, 228, 0));
}
.stat-card span { color: var(--muted); font-size: 14px; }
.stat-card strong { display: block; margin-top: 10px; font-size: 32px; }

.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.panel {
  border-radius: 22px;
  padding: 20px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.92), rgba(255,250,252,0.88)),
    var(--panel);
}
.panel-head {
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}
.panel-head h3 { font-size: 24px; margin-bottom: 6px; }
.panel-head p { color: var(--muted); line-height: 1.7; }
.with-actions { align-items: center; }
.panel-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.list-block { display: grid; gap: 12px; }
.list-item {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 248, 251, 0.92), rgba(255, 255, 255, 0.92));
  border-radius: 14px;
  padding: 14px;
}
.list-item strong { display: block; margin-bottom: 6px; }
.list-item p { color: var(--muted); font-size: 13px; line-height: 1.6; }

.bars { display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 120px 1fr 60px; gap: 12px; align-items: center; }
.bar-track { height: 12px; background: #f8d9e6; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(180deg, var(--secondary), var(--primary-deep)); border-radius: 999px; }

.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 16px; }
table { width: 100%; border-collapse: collapse; background: rgba(255,255,255,0.92); }
th, td { padding: 14px 16px; border-bottom: 1px solid rgba(218, 163, 185, 0.16); text-align: left; vertical-align: top; }
th { background: #fff1f6; color: #7e5a6c; font-size: 13px; }
tbody tr:hover { background: #fff7fa; }
.action-row { display: flex; gap: 8px; flex-wrap: wrap; }

.filters-grid, .export-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.pagination { display: flex; gap: 12px; align-items: center; justify-content: flex-end; margin-top: 16px; }
.result-box, .setting-block {
  margin-top: 16px;
  padding: 14px;
  border-radius: 14px;
  background: var(--soft);
  border: 1px solid var(--line);
  color: var(--muted);
  line-height: 1.7;
}

.full-span { grid-column: 1 / -1; }
.checkbox-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.checkbox-card {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,247,251,0.94), rgba(255,255,255,0.92));
}
.checkbox-card input { width: auto; margin-top: 2px; }

.modal {
  width: min(760px, calc(100% - 20px));
  border: 0;
  padding: 0;
  background: transparent;
}
.modal::backdrop { background: rgba(94, 43, 64, 0.34); }
.modal-card {
  border-radius: 22px;
  padding: 22px;
  background:
    radial-gradient(circle at top right, rgba(255, 229, 238, 0.9), transparent 28%),
    linear-gradient(180deg, rgba(255,255,255,0.96), rgba(255,248,251,0.94));
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.modal-actions {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  min-width: 220px;
  max-width: 360px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #5f3751;
  color: #fff;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1180px) {
  .stats-grid, .filters-grid, .export-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-column { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .admin-shell, .login-shell { grid-template-columns: 1fr; }
  .sidebar { padding: 16px; }
  .main-shell { padding: 16px; }
  .topbar, .panel-head.with-actions { flex-direction: column; align-items: flex-start; }
  .topbar-right { justify-content: flex-start; }
}

@media (max-width: 720px) {
  .stats-grid, .filters-grid, .export-grid, .form-grid, .checkbox-list { grid-template-columns: 1fr; }
  .panel-actions { width: 100%; }
  .panel-actions input, .panel-actions button, .pagination button { width: 100%; }
  .pagination { flex-direction: column; align-items: stretch; }
}
