:root {
  --bg: #f3f6fa;
  --bg-2: #eaf0f6;
  --card: #ffffff;
  --line: #c7d3df;
  --text: #1f2a37;
  --muted: #4b5b6b;
  --brand: #1f6feb;
  --brand-2: #1454b5;
  --danger: #c0392b;
  --panel: #e7eff8;
  --layout-width: 1400px;
  --layout-view-width: min(var(--layout-width), 97vw);
  --nav-width: clamp(220px, 24vw, 272px);
  --nav-gap: 24px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  background:
    radial-gradient(circle at 14% 6%, rgba(70, 120, 180, 0.12), transparent 34%),
    radial-gradient(circle at 88% 14%, rgba(60, 130, 200, 0.10), transparent 30%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
}

.container {
  width: var(--layout-view-width);
  margin: 24px auto;
  display: grid;
  gap: 16px;
  min-width: 0;
}

/* 功能区（左）+ 导航区（右） */
body.has-side-panel .container {
  width: var(--layout-view-width);
  margin: 24px auto;
  padding-right: calc(var(--nav-width) + var(--nav-gap));
  min-width: 0;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 10px 24px rgba(24, 56, 96, 0.10);
  min-width: 0;
}

h1 { margin: 0 0 10px; color: var(--brand-2); letter-spacing: 0.2px; }
.hint { margin: 0; color: var(--muted); }

#topNav {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

input, select, textarea, button { font: inherit; }

input, select, textarea {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(31, 111, 235, 0.22);
  border-color: #5b8fdc;
}
textarea { min-height: 80px; resize: vertical; }

button {
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  padding: 9px 14px;
  cursor: pointer;
  font-weight: 700;
}
button.secondary {
  background: linear-gradient(135deg, #6f8599, #54677a);
}
button.danger {
  background: linear-gradient(135deg, #d35445, var(--danger));
}
button[disabled] { opacity: 0.55; cursor: not-allowed; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
label { display: grid; gap: 6px; font-size: 13px; }
.full { grid-column: 1 / -1; }

.status {
  min-height: 20px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.table-wrap { overflow: auto; }
table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  font-size: 13px;
}
th, td {
  border-bottom: 1px solid #dbe4ec;
  text-align: left;
  padding: 8px;
  vertical-align: top;
  white-space: normal;
  word-break: break-word;
}
th {
  background: var(--panel);
  color: #25384b;
  position: sticky;
  top: 0;
}

.row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.stat-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #f8fbff;
}
.stat-title { color: var(--muted); font-size: 12px; }
.stat-value { margin-top: 6px; font-size: 22px; font-weight: 700; color: var(--brand-2); }

.bar-row {
  display: grid;
  grid-template-columns: 180px 1fr 70px;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}
.bar {
  height: 12px;
  border-radius: 999px;
  background: #dce7f1;
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #3c84f1, #1f6feb);
}

.login-wrap {
  max-width: 420px;
  margin: 72px auto;
}

.side-panel {
  position: fixed;
  top: 24px;
  right: max(12px, calc((100vw - var(--layout-view-width)) / 2));
  width: var(--nav-width);
  height: calc(100vh - 48px);
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
  z-index: 40;
}

.side-user,
.side-nav {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 8px 20px rgba(24, 56, 96, 0.10);
}

.side-user {
  padding: 12px;
  display: grid;
  gap: 10px;
}
.avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(135deg, #3f82ec, #1d62cf);
  box-shadow: 0 6px 14px rgba(24, 77, 166, 0.28);
}

.side-user-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.side-mini-btn {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 8px;
  font-weight: 600;
}
.side-user-meta {
  display: grid;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
}
.side-user-meta strong {
  color: var(--brand-2);
  font-size: 16px;
}
.side-user-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.side-nav {
  padding: 10px;
  overflow: auto;
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
  justify-items: center;
  gap: 8px;
  min-height: 160px;
}
.side-nav a {
  text-decoration: none;
  width: 100%;
  display: flex;
  justify-content: center;
}
.side-nav button {
  width: 100%;
  text-align: center;
  color: #1b4d8f;
  background: rgba(31, 111, 235, 0.12);
  border: 1px solid rgba(31, 111, 235, 0.35);
  box-shadow: none;
  transition: border-color 0.18s ease, border-width 0.18s ease, background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.side-nav button.secondary {
  color: #2f4f6d;
  background: rgba(91, 123, 158, 0.08);
  border: 1px solid rgba(84, 103, 122, 0.32);
}
.side-nav button:not(.secondary) {
  color: #0d3f80;
  background: rgba(31, 111, 235, 0.22);
  border: 1px solid rgba(20, 84, 181, 0.58);
}
.side-nav button:hover,
.side-nav button:focus-visible {
  border-width: 2px;
  border-color: rgba(16, 72, 148, 0.92);
  color: #08366f;
  background: rgba(31, 111, 235, 0.26);
  transform: translateY(-1px);
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 12px;
}
.notice-list {
  display: grid;
  gap: 10px;
}
.notice-item {
  border: 1px solid var(--line);
  background: #f7fbff;
  border-radius: 12px;
  padding: 10px;
}
.notice-item h3 {
  margin: 0 0 6px;
  font-size: 15px;
  color: var(--brand-2);
}
.notice-meta {
  font-size: 12px;
  color: var(--muted);
}

.avatar-button {
  border: 0;
  padding: 0;
  cursor: pointer;
  background: linear-gradient(135deg, #3f82ec, #1d62cf);
}
.avatar-button:focus-visible {
  outline: 2px solid rgba(31, 111, 235, 0.35);
  outline-offset: 2px;
}
.avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.side-user-tools {
  display: flex;
  justify-content: flex-end;
}
.avatar-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: grid;
  place-items: center;
  z-index: 120;
  padding: 12px;
}
.avatar-modal.hidden {
  display: none;
}
.avatar-modal-card {
  width: min(460px, 100%);
}
.avatar-crop-wrap {
  display: grid;
  place-items: center;
  margin-top: 8px;
}
#avatarCropCanvas {
  width: 240px;
  height: 240px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #e7eff8;
  touch-action: none;
  cursor: grab;
}
#avatarCropCanvas.dragging {
  cursor: grabbing;
}
.avatar-modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 12px;
}

@media (max-width: 1240px) {
  #topNav {
    justify-content: center;
  }
  body.has-side-panel .container {
    width: var(--layout-view-width);
    margin: 24px auto;
    padding-right: 0;
  }
  .side-panel {
    position: static;
    width: var(--layout-view-width);
    height: auto;
    margin: 0 auto 12px;
    grid-template-rows: auto auto;
  }
}

@media (max-width: 960px) {
  .side-panel {
    width: 100%;
  }
  .side-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-items: stretch;
  }
  .side-nav a {
    justify-content: stretch;
  }
  .side-nav button {
    width: 100%;
  }
  .home-hero {
    grid-template-columns: 1fr;
  }
}








