:root {
  --primary: #4361ee;
  --primary-2: #3a0ca3;
  --accent: #f72585;
  --bg: #f5f7fb;
  --sidebar-bg: #0f172a;
  --sidebar-bg2: #1e293b;
  --text: #1e293b;
  --muted: #64748b;
  --border: #e2e8f0;
  --white: #ffffff;
  --shadow-sm: 0 6px 18px rgba(15,23,42,.06);
  --shadow-md: 0 18px 40px rgba(15,23,42,.10);
  --shadow-lg: 0 30px 70px rgba(15,23,42,.18);
  --radius: 20px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
img { max-width: 100%; display: block; }

/* ===== Login ===== */
.login-body {
  min-height: 100vh;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 45%, #312e81 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  position: relative;
  overflow: hidden;
}

.login-body::before {
  content: "";
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(67,97,238,.35), transparent 70%);
  top: -200px;
  right: -100px;
}

.login-body::after {
  content: "";
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(247,37,133,.28), transparent 70%);
  bottom: -180px;
  left: -120px;
}

.login-card {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  width: 100%;
  max-width: 980px;
  min-height: 580px;
  border-radius: 32px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--white);
  animation: loginFade .8s ease;
}

@keyframes loginFade {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: none; }
}

.login-left {
  background: linear-gradient(145deg, #1e293b 0%, #312e81 100%);
  color: #fff;
  padding: 56px 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}

.login-left::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.5), transparent);
  pointer-events: none;
}

.login-brand {
  position: relative;
  z-index: 1;
  margin-top: auto;
  margin-bottom: auto;
}

.login-logo {
  width: 108px;
  height: 108px;
  border-radius: 28px;
  object-fit: cover;
  background: #fff;
  padding: 0;
  box-shadow: 0 18px 40px rgba(0,0,0,.25);
  margin-bottom: 60px;
  margin-left:145px;
  margin-top:-50px;
}

.login-brand h1 {
  font-size: 2.2rem;
  line-height: 1.3;
  letter-spacing: 1px;
  margin-bottom: 14px;
  margin-left:20px;
}

.login-brand p {
  font-size: .72rem;
  letter-spacing: .24em;
  text-transform: uppercase;
  opacity: .7;
  margin-left:40px;
}

.login-right {
  padding: 56px 48px;
  display: flex;
  align-items: center;
}

.login-form-wrap { width: 100%; }
.login-form-wrap h2 { font-size: 1.8rem; margin-bottom: 6px; }
.login-sub { color: var(--muted); margin-bottom: 26px; font-size: .95rem; }
.login-error { background: #fee2e2; color: #b91c1c; border-radius: 12px; padding: 12px 16px; margin-bottom: 20px; font-size: .88rem; }

.login-form-wrap label {
  display: block;
  margin: 16px 0 8px;
  font-weight: 600;
  font-size: .9rem;
  color: #334155;
}

.login-form-wrap input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  font-size: .95rem;
  transition: .2s;
  background: #f8fafc;
}

.login-form-wrap input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(67,97,238,.12);
  background: #fff;
}

.login-form-wrap button {
  width: 100%;
  margin-top: 28px;
  padding: 15px;
  border-radius: 14px;
  background: linear-gradient(135deg, #4361ee, #3a0ca3);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 1px;
  box-shadow: 0 14px 30px rgba(67,97,238,.35);
  transition: .25s;
}

.login-form-wrap button:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 40px rgba(67,97,238,.45);
}

/* ===== Dashboard Layout ===== */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 272px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 24px 22px 20px;
}

.sidebar-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #fff;
  padding: 5px;
  object-fit: cover;
}

.sidebar-brand-text strong {
  display: block;
  color: #fff;
  font-size: 1.1rem;
  letter-spacing: 1px;
}

.sidebar-brand-text span {
  font-size: .72rem;
  color: #94a3b8;
  letter-spacing: .08em;
}

.sidebar-nav {
  flex: 1;
  padding: 8px 14px 20px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  color: #cbd5e1;
  font-weight: 500;
  margin: 3px 0;
  transition: .2s;
  position: relative;
}

.nav-item:hover {
  background: rgba(255,255,255,.06);
  color: #fff;
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(67,97,238,.9), rgba(58,12,163,.9));
  color: #fff;
  box-shadow: 0 10px 20px rgba(0,0,0,.18);
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 24px;
  border-radius: 0 4px 4px 0;
  background: var(--accent);
}

.menu-group {
  margin: 6px 0;
}

.menu-group-title {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  color: #cbd5e1;
  font-weight: 500;
  transition: .2s;
  text-align: left;
}

.menu-group-title:hover {
  background: rgba(255,255,255,.06);
  color: #fff;
}

.menu-group-title .arrow {
  margin-left: auto;
  transition: .2s;
  font-size: .8rem;
}

.menu-group.open .arrow {
  transform: rotate(180deg);
}

.menu-group-items {
  display: none;
  padding: 4px 0 4px 18px;
  border-left: 1px solid rgba(255,255,255,.08);
  margin-left: 20px;
}

.menu-group.open .menu-group-items {
  display: block;
}

.nav-sub {
  display: block;
  padding: 10px 14px;
  border-radius: 10px;
  color: #94a3b8;
  font-size: .9rem;
  transition: .2s;
}

.nav-sub:hover {
  color: #fff;
  background: rgba(255,255,255,.05);
}

.nav-sub.active {
  color: #fff;
  background: rgba(67,97,238,.35);
}

.sidebar-footer {
  padding: 16px 14px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.logout {
  color: #fca5a5;
}

.logout:hover {
  background: rgba(248,113,113,.12);
  color: #fff;
}

/* ===== Main Content ===== */
.main-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 72px;
  background: rgba(255,255,255,.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-title {
  font-weight: 700;
  font-size: 1.05rem;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #475569;
  font-weight: 600;
}

.user-role {
  padding: 6px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #eef2ff, #fdf2f8);
  color: #4338ca;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .05em;
}

.page-body {
  padding: 30px 32px 40px;
  flex: 1;
}

/* ===== Hero ===== */
.hero-card {
  background: linear-gradient(135deg, #1e293b 0%, #312e81 100%);
  color: #fff;
  padding: 52px 48px;
  border-radius: 28px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-card::after {
  content: "";
  position: absolute;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(247,37,133,.35), transparent 65%);
  top: -180px;
  right: -100px;
}

.hero-badge {
  align-self: flex-start;
  background: rgba(255,255,255,.12);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: .72rem;
  letter-spacing: .22em;
  margin-bottom: 26px;
  margin-top:-20px;
}

.hero-card h1 {
  font-size: 2.5rem;
  line-height: 1.4;
  margin-bottom: 15px;
  position: relative;
  z-index: 1;
  margin-top:10px;
}

.hero-card p {
  color: #cbd5e1;
  max-width: 1000px;
  line-height: 1.8;
  position: relative;
  z-index: 1;
  
}

/* ===== Blank / Settings ===== */
.blank-card {
  background: #fff;
  border-radius: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 46px;
  min-height: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--muted);
}

.blank-card h2 {
  color: #1e293b;
  margin: 16px 0 8px;
  font-size: 1.6rem;
}

.settings-card {
  background: #fff;
  border-radius: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 32px;
  max-width: 640px;
}

.settings-card h3 {
  margin-bottom: 10px;
  font-size: 1.3rem;
}

.muted {
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 20px;
}

.current-logo {
  width: 120px;
  height: 120px;
  border-radius: 20px;
  background: #f8fafc;
  border: 1px dashed var(--border);
  padding: 14px;
  margin-bottom: 20px;
}

.current-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.upload-form input[type="file"] {
  display: block;
  margin: 16px 0;
}

.btn-primary {
  padding: 12px 24px;
  border-radius: 12px;
  background: linear-gradient(135deg, #4361ee, #3a0ca3);
  color: #fff;
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: .5px;
  box-shadow: 0 12px 28px rgba(67,97,238,.3);
  transition: .25s;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(67,97,238,.42);
}

.alert-success {
  background: #ecfdf5;
  color: #065f46;
  padding: 14px 18px;
  border-radius: 14px;
  margin-bottom: 20px;
  font-weight: 600;
}

.alert-error {
  background: #fef2f2;
  color: #991b1b;
  padding: 14px 18px;
  border-radius: 14px;
  margin-bottom: 20px;
  font-weight: 600;
}

/* ===== Responsive ===== */
@media (max-width: 800px) {
  .login-card {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .login-left { padding: 40px 32px; }
  .login-right { padding: 40px 32px; }
  .login-logo { width: 84px; height: 84px; border-radius: 22px; }
  .login-brand h1 { font-size: 1.7rem; }

  .dashboard-layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: relative; }
  .topbar { padding: 0 20px; }
  .page-body { padding: 20px; }
  .hero-card { padding: 36px 28px; min-height: 280px; }
  .hero-card h1 { font-size: 1.8rem; }
}

/* ===== 原有样式保持不变（略） ===== */
/* 以下为新增权限配置相关样式 */

/* 权限配置页面 */
.permission-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.permission-header h3 {
    font-size: 1.3rem;
    color: #1e293b;
}

.admin-table-wrapper {
    background: #fff;
    border-radius: 18px;
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .92rem;
}
.admin-table th,
.admin-table td {
    padding: 14px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.admin-table th {
    background: #f8fafc;
    font-weight: 700;
    color: #334155;
    white-space: nowrap;
}
.admin-table tr:last-child td {
    border-bottom: none;
}
.empty-td {
    text-align: center;
    color: #94a3b8;
    padding: 30px;
}
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 700;
}
.badge-view {
    background: #eef2ff;
    color: #4338ca;
}
.badge-edit {
    background: #fdf2f8;
    color: #be185d;
}

/* 开关 */
.switch-form {
    margin: 0;
}
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .3s;
    border-radius: 22px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}
.switch input:checked + .slider {
    background: linear-gradient(135deg, #4361ee, #3a0ca3);
}
.switch input:checked + .slider:before {
    transform: translateX(18px);
}

/* 操作按钮 */
.action-btns {
    display: flex;
    gap: 8px;
    align-items: center;
}
.inline-form {
    display: inline;
}
.btn-sm {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: .8rem;
    font-weight: 600;
    background: #f1f5f9;
    color: #334155;
    transition: .2s;
    border: none;
}
.btn-sm:hover {
    background: #e2e8f0;
}
.btn-config {
    background: #ede9fe;
    color: #6d28d9;
}
.btn-config:hover {
    background: #ddd6fe;
}
.btn-danger {
    background: #fee2e2;
    color: #b91c1c;
}
.btn-danger:hover {
    background: #fecaca;
}

/* 弹窗 */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    z-index: 100;
    align-items: center;
    justify-content: center;
}
.modal-overlay.active {
    display: flex;
}
.modal-box {
    background: #fff;
    border-radius: 20px;
    padding: 28px 30px;
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-lg);
    animation: modalIn .3s ease;
}
@keyframes modalIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: none; }
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.modal-header h3 {
    font-size: 1.2rem;
}
.modal-close {
    font-size: 1.6rem;
    line-height: 1;
    color: #94a3b8;
    background: none;
    border: none;
    cursor: pointer;
}
.modal-close:hover {
    color: #1e293b;
}
.modal-form label {
    display: block;
    margin: 14px 0 6px;
    font-weight: 600;
    font-size: .88rem;
    color: #334155;
}
.modal-form input,
.modal-form select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: .9rem;
    background: #f8fafc;
}
.modal-form input:focus,
.modal-form select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67,97,238,.12);
    background: #fff;
}
.modal-form .btn-primary {
    margin-top: 20px;
    width: 100%;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
    padding: 4px;
}
.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #f8fafc;
    border-radius: 8px;
    font-size: .85rem;
    cursor: pointer;
}
.checkbox-item input {
    width: auto;
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}
.btn-secondary {
    background: linear-gradient(135deg, #64748b, #334155);
}
.btn-link {
    text-decoration: none;
    display: inline-block;
    padding: 12px 20px;
}
/* 通用均分表格 */
.uniform-table {
    table-layout: fixed;
    width: 100%;
}
.uniform-table th,
.uniform-table td {
    vertical-align: middle;
}
.uniform-table .text-left {
    text-align: left;
}
.uniform-table .text-right {
    text-align: right;
}