:root {
  --brand: #1e5eff;
  --brand-dark: #1246d6;
  --brand-soft: #e8f0ff;
  --brand-mid: #4d8dff;
  --surface: #f4f8ff;
  --ink: #1a2b4a;
  --muted: #6b7c99;
  --line: #d9e4f5;
  --radius: 14px;
  --shadow: 0 10px 28px rgba(30, 94, 255, 0.08);
}

* { box-sizing: border-box; }

body.app-body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1100px 480px at 8% -12%, #d6e6ff 0%, transparent 55%),
    radial-gradient(900px 420px at 100% 0%, #eef4ff 0%, transparent 50%),
    linear-gradient(180deg, #f7faff 0%, var(--surface) 100%);
  min-height: 100vh;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }

.brand-bar {
  background: linear-gradient(135deg, #1e5eff 0%, #2f78ff 50%, #4aa3ff 100%);
  color: #fff;
  box-shadow: 0 8px 24px rgba(30, 94, 255, 0.22);
}

.brand-bar .navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff !important;
  font-weight: 700;
  font-size: 1.15rem;
}

.brand-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  background: rgba(255,255,255,.2);
  border-radius: 10px;
  padding: 4px;
}

.brand-logo-placeholder {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(255,255,255,.22);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.admin-shell {
  display: flex;
  min-height: calc(100vh - 66px);
}

.admin-sidebar {
  width: 240px;
  background: #ffffff;
  border-right: 1px solid var(--line);
  padding: 1.25rem 0.85rem;
  flex-shrink: 0;
}

.admin-sidebar .nav-link {
  color: var(--ink);
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  margin-bottom: 4px;
  font-weight: 500;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.admin-main {
  flex: 1;
  padding: 1.5rem;
  min-width: 0;
}

.page-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.page-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 1rem;
  color: #14326b;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.stat-item {
  background: linear-gradient(180deg, #ffffff, #f3f7ff);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem;
}

.stat-item .num {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--brand);
  line-height: 1.2;
}

.stat-item .label {
  color: var(--muted);
  margin-top: 0.35rem;
}

.btn-brand {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.btn-brand:hover,
.btn-brand:focus {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: #fff;
}

.btn-outline-primary {
  --bs-btn-color: var(--brand);
  --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand);
  --bs-btn-hover-border-color: var(--brand);
  --bs-btn-hover-color: #fff;
}

.table thead th {
  background: #eef4ff;
  color: #1a3a75;
  white-space: nowrap;
  font-weight: 600;
  border-bottom-width: 1px;
}

.table td { vertical-align: middle; }

.reg-dup-row > td {
  background: #fff1f1 !important;
  color: #b42318;
}
.reg-dup-row:hover > td {
  background: #ffe4e4 !important;
}

.form-control:focus,
.form-select:focus {
  border-color: #8eb6ff;
  box-shadow: 0 0 0 .2rem rgba(30, 94, 255, .15);
}

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background:
    radial-gradient(800px 400px at 20% 0%, #d9e8ff 0%, transparent 60%),
    radial-gradient(700px 360px at 90% 100%, #eaf2ff 0%, transparent 55%),
    #f5f8ff;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 2rem;
  border: 1px solid var(--line);
}

.pagination .page-item.active .page-link {
  background-color: var(--brand);
  border-color: var(--brand);
}
.pagination .page-link {
  color: var(--brand);
}

/* ========== 家长端前台 ========== */
.front-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background:
    radial-gradient(900px 420px at 0% -10%, rgba(77, 141, 255, 0.18) 0%, transparent 55%),
    radial-gradient(700px 360px at 100% 10%, rgba(30, 94, 255, 0.1) 0%, transparent 50%),
    linear-gradient(180deg, #f5f8ff 0%, #eef3fb 50%, #f7f9fc 100%);
}

.front-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(217, 228, 245, 0.9);
}

.front-topbar-inner {
  min-height: 56px;
  display: flex;
  align-items: center;
}

.front-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink) !important;
  text-decoration: none;
}

.front-brand .brand-logo,
.front-brand .brand-logo-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
}

.front-brand .brand-logo-placeholder {
  background: linear-gradient(135deg, #1e5eff, #4aa3ff);
  color: #fff;
}

.front-brand-text {
  font-size: 1.05rem;
  font-weight: 700;
  color: #14326b;
  line-height: 1.3;
}

.front-main {
  flex: 1;
}

.front-wrap {
  padding: 1.25rem 0 1.5rem;
}

.front-panel {
  max-width: 560px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid #d9e4f5;
  border-radius: 16px;
  box-shadow: 0 12px 28px rgba(30, 94, 255, 0.07);
  overflow: hidden;
}

.front-panel-head {
  padding: 1.25rem 1.25rem 0.85rem;
  border-bottom: 1px solid #eef2f8;
  text-align: center;
}

.front-panel-head h1 {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  font-weight: 750;
  color: #102a5c;
}

.front-panel-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.front-form {
  padding: 1.15rem 1.25rem 1.35rem;
}

.front-form .form-label {
  font-weight: 600;
  color: #243e6d;
  margin-bottom: 0.4rem;
  font-size: 0.92rem;
}

.front-form .req {
  color: #e25555;
  font-weight: 700;
}

.front-form .opt {
  display: inline-block;
  margin-left: 0.2rem;
  padding: 0.08rem 0.4rem;
  border-radius: 999px;
  background: #eef3fb;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  vertical-align: middle;
}

.front-input {
  border: 1px solid #d5e1f5;
  border-radius: 10px;
  background: #fbfcff;
  font-size: 1rem !important;
}

.front-input:focus {
  background: #fff;
  border-color: #7aa6ff;
  box-shadow: 0 0 0 0.2rem rgba(30, 94, 255, 0.12);
}

.route-preview {
  display: none;
  padding: 0.9rem;
  border-radius: 12px;
  background: #f2f7ff;
  border: 1px solid #cfe0ff;
}

.route-preview.show {
  display: block;
}

.route-preview-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #1a3a75;
  margin-bottom: 0.7rem;
}

.route-info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.55rem;
}

.route-info-item {
  background: #fff;
  border: 1px solid #dce8ff;
  border-radius: 10px;
  padding: 0.65rem 0.7rem;
}

.route-info-label {
  color: var(--muted);
  font-size: 0.72rem;
  margin-bottom: 0.2rem;
}

.route-info-value {
  color: #14326b;
  font-weight: 700;
  font-size: 0.92rem;
  word-break: break-all;
  line-height: 1.3;
}

.front-submit {
  width: 100%;
  border: 0;
  border-radius: 12px;
  min-height: 48px;
  font-weight: 700;
  background: linear-gradient(135deg, #1e5eff 0%, #3f8bff 100%);
  box-shadow: 0 8px 18px rgba(30, 94, 255, 0.25);
  color: #fff;
}

.front-submit:hover,
.front-submit:focus {
  color: #fff;
  filter: brightness(1.03);
}

.front-submit:disabled,
.front-submit.is-loading {
  opacity: 0.75;
  box-shadow: none;
}

.front-footer {
  padding: 0.9rem 0 1.3rem;
  color: #8a9bb8;
  font-size: 0.8rem;
}

.front-modal {
  border: 0;
  border-radius: 16px;
  overflow: hidden;
}

.front-modal .modal-header {
  border-bottom-color: #e8eef8;
}

.front-modal .modal-footer {
  border-top-color: #e8eef8;
}

.success-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e5eff, #4aa3ff);
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
}

@media (max-width: 991.98px) {
  .admin-shell { flex-direction: column; }
  .admin-sidebar {
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding-bottom: .5rem;
  }
  .admin-sidebar .nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }
  .admin-sidebar .nav-link {
    margin-bottom: 0;
    padding: .55rem .75rem;
    font-size: .92rem;
  }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-main { padding: 1rem; }
}

@media (max-width: 767.98px) {
  .front-wrap { padding: 0.9rem 0 1.1rem; }
  .front-panel {
    margin: 0;
    border-radius: 14px;
    border-left: 0;
    border-right: 0;
  }
  .front-panel-head,
  .front-form {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .route-info-grid {
    grid-template-columns: 1fr;
  }
  .front-brand-text {
    font-size: 0.95rem;
    max-width: calc(100vw - 90px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .front-form .form-control-lg,
  .front-form .form-select-lg {
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
    font-size: 0.98rem !important;
  }
}

@media (max-width: 575.98px) {
  .stat-grid { grid-template-columns: 1fr; }
  .page-card { padding: 1rem; }
}
