/* ==========================================================================
   谨记刷题 · Web 管理后台样式（深蓝科技感 / 卡片式 / 纯本地无 CDN）
   适配 1280px 桌面，小屏自动降级为单列布局。
   v30：品牌统一「谨记刷题」，登录页玻璃卡片、侧边栏/顶栏/统计卡/表格/弹窗全面升级。
   ========================================================================== */

:root {
  --brand: #2e6be6;
  --brand-dark: #1f55c4;
  --brand-deep: #17356b;
  --brand-light: #eaf1ff;
  --brand-lighter: #f2f6ff;
  --green: #23c08f;
  --orange: #ff8a3d;
  --red: #ff5b5b;
  --purple: #7b61ff;
  --text: #1f2329;
  --text-sub: #8a9099;
  --line: #eef0f4;
  --page-bg: #f4f6fa;
  --card-bg: #ffffff;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(31, 58, 110, 0.06);
  --shadow-lg: 0 18px 50px rgba(17, 39, 80, 0.22);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
}

code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--brand-lighter);
  color: var(--brand-dark);
  font-size: 12px;
  font-family: Consolas, "Courier New", monospace;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--text-sub);
}

/* ============================== 通用按钮 ============================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
  user-select: none;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.btn-primary {
  background: linear-gradient(135deg, #4c8dff, #2e6be6);
  color: #fff;
  box-shadow: 0 4px 12px rgba(46, 107, 230, 0.28);
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.btn-ghost {
  border-color: #dfe5f0;
  color: var(--text);
  background: #fff;
}

.btn-ghost:hover:not(:disabled) {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-lighter);
}

.btn-danger {
  background: #fff1f1;
  border-color: #ffd2d2;
  color: #e13b3b;
}

.btn-danger:hover:not(:disabled) {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.btn-sm {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
  border-radius: 7px;
}

.btn-xs {
  height: 26px;
  padding: 0 9px;
  font-size: 12px;
  border-radius: 6px;
}

.btn-block {
  width: 100%;
  height: 44px;
  font-size: 16px;
  border-radius: 10px;
}

/* ============================== 登录页 ============================== */

.login-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: linear-gradient(135deg, #4c8dff 0%, #2e6be6 55%, #1f55c4 100%);
  position: relative;
  overflow: hidden;
}

.login-view::before,
.login-view::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.09);
}

.login-view::before {
  width: 480px;
  height: 480px;
  left: -160px;
  top: -160px;
}

.login-view::after {
  width: 620px;
  height: 620px;
  right: -240px;
  bottom: -300px;
}

.login-card {
  position: relative;
  z-index: 2;
  width: 400px;
  max-width: 100%;
  padding: 36px 34px 30px;
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-lg);
}

.login-logo {
  width: 58px;
  height: 58px;
  margin: 0 auto 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, #eaf1ff, #dbe7ff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
}

.login-title {
  text-align: center;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.login-sub {
  margin: 8px 0 24px;
  text-align: center;
  color: var(--text-sub);
  font-size: 13px;
}

.login-card .form-item {
  margin-bottom: 16px;
}

.login-tip {
  margin-top: 20px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--brand-lighter);
  border: 1px dashed #cfdcff;
  color: #5a6a86;
  font-size: 12.5px;
  line-height: 1.7;
  text-align: center;
}

.login-tip b {
  color: var(--brand);
}

/* ============================== 布局 ============================== */

.app {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 230px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #17356b 0%, #10254c 100%);
  color: #fff;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 22px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-icon {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.08));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.brand-text b {
  font-size: 16px;
  letter-spacing: 1px;
}

.brand-text small {
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
}

.nav {
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: all 0.16s ease;
}

.nav-item span {
  letter-spacing: 0.5px;
}

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

.nav-item.active {
  background: linear-gradient(135deg, #4c8dff, #2e6be6);
  color: #fff;
  box-shadow: 0 6px 16px rgba(11, 40, 100, 0.35);
}

.nav-logout {
  margin-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0 0 9px 9px;
  color: rgba(255, 255, 255, 0.62);
}

.nav-logout:hover {
  background: rgba(255, 91, 91, 0.18);
  color: #ffb9b9;
}

.sidebar-foot {
  display: flex;
  justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.4);
  font-size: 11px;
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 66px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 26px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-left {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.topbar-left h2 {
  font-size: 18px;
  font-weight: 700;
}

.topbar-sub {
  color: var(--text-sub);
  font-size: 12.5px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.server-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  background: #e8fbf3;
  color: #14906a;
  font-size: 12.5px;
}

.server-state.error {
  background: #ffefef;
  color: #d43b3b;
}

.state-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px rgba(35, 192, 143, 0.16);
}

.server-state.error .state-dot {
  box-shadow: 0 0 0 3px rgba(255, 91, 91, 0.16);
}

.admin-chip {
  padding: 5px 12px;
  border-radius: 20px;
  background: var(--brand-light);
  color: var(--brand-dark);
  font-size: 13px;
}

.content {
  flex: 1;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 22px 26px 40px;
}

.page {
  animation: fade-in 0.2s ease;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================== 卡片 ============================== */

.card {
  margin-bottom: 18px;
  padding: 20px 22px 22px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-narrow {
  max-width: 560px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.card-head h3 {
  position: relative;
  padding-left: 11px;
  font-size: 16px;
  font-weight: 700;
}

.card-head h3::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 4px;
  height: 16px;
  border-radius: 2px;
  background: var(--brand);
  transform: translateY(-50%);
}

.card-tip {
  color: var(--text-sub);
  font-size: 12.5px;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.card-foot {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.section-sub {
  margin: 24px 0 14px;
  padding-left: 10px;
  border-left: 3px solid var(--brand-light);
  color: #4a5670;
  font-size: 14px;
  font-weight: 600;
}

/* ============================== 统计卡片 ============================== */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px 22px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: "";
  position: absolute;
  right: -24px;
  top: -24px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--brand-lighter);
}

.stat-icon {
  position: relative;
  z-index: 1;
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.stat-icon.blue {
  background: var(--brand-light);
}

.stat-icon.green {
  background: #e8fbf3;
}

.stat-icon.orange {
  background: #fff3e9;
}

.stat-icon.purple {
  background: #f0edff;
}

.stat-body {
  position: relative;
  z-index: 1;
}

.stat-label {
  color: var(--text-sub);
  font-size: 12.5px;
}

.stat-value {
  margin-top: 2px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.grid-2 .card {
  margin-bottom: 18px;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.mini-stat {
  padding: 12px 14px;
  border-radius: 10px;
  background: #f8faff;
  border: 1px solid #eef2fb;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mini-stat span {
  color: var(--text-sub);
  font-size: 12px;
}

.mini-stat b {
  font-size: 19px;
  font-weight: 700;
  color: var(--brand-dark);
}

/* ============================== 表格 ============================== */

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.table thead th {
  padding: 11px 14px;
  background: #f7f9fd;
  border-bottom: 1px solid var(--line);
  color: #5b6579;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.table tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table tbody tr:hover {
  background: #fafcff;
}

.table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.table .ops {
  display: flex;
  gap: 8px;
}

.cell-main {
  font-weight: 600;
  color: #25304a;
}

.cell-sub {
  margin-top: 2px;
  color: var(--text-sub);
  font-size: 12px;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 20px;
  background: var(--brand-light);
  color: var(--brand-dark);
  font-size: 12px;
}

.result-tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 12px;
}

.result-tag.correct {
  background: #e8fbf3;
  color: #14906a;
}

.result-tag.wrong {
  background: #ffefef;
  color: #d43b3b;
}

.text-sub {
  color: var(--text-sub);
  font-size: 12.5px;
}

/* 启用开关 */
.switch {
  position: relative;
  width: 42px;
  height: 23px;
  border: 0;
  border-radius: 12px;
  background: #d8dee9;
  cursor: pointer;
  transition: background 0.18s ease;
  padding: 0;
  flex-shrink: 0;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.25);
  transition: transform 0.18s ease;
}

.switch.on {
  background: linear-gradient(135deg, #4c8dff, #2e6be6);
}

.switch.on::after {
  transform: translateX(19px);
}

/* ============================== 表单 ============================== */

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 20px;
}

.form-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  min-width: 0;
}

.form-grid .form-item {
  margin-bottom: 0;
}

.form-item-inline {
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.form-item-inline .form-label {
  margin-bottom: 0;
}

.form-label {
  color: #4a5670;
  font-size: 12.5px;
  font-weight: 600;
}

.input,
.textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #dfe5f0;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.input {
  height: 38px;
}

select.input {
  cursor: pointer;
}

.textarea {
  resize: vertical;
  line-height: 1.6;
}

.textarea.code {
  font-family: Consolas, "Courier New", monospace;
  font-size: 12.5px;
  background: #fbfcff;
}

.input:focus,
.textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(46, 107, 230, 0.12);
}

.input::placeholder,
.textarea::placeholder {
  color: #b3bac7;
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
  cursor: pointer;
}

.form-hint {
  color: var(--text-sub);
  font-size: 12px;
  line-height: 1.7;
  word-break: break-all;
}

.form-error {
  margin-top: 4px;
  padding: 9px 12px;
  border-radius: 8px;
  background: #ffefef;
  border: 1px solid #ffd2d2;
  color: #d43b3b;
  font-size: 12.5px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.json-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}

/* ============================== 弹窗 ============================== */

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  background: rgba(15, 23, 42, 0.46);
  backdrop-filter: blur(2px);
}

.modal {
  width: 760px;
  max-width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-sm {
  width: 640px;
}

.modal-xs {
  width: 400px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
}

.modal-head h3 {
  font-size: 16px;
  font-weight: 700;
}

.modal-close {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-sub);
  font-size: 14px;
  cursor: pointer;
}

.modal-close:hover {
  background: #f1f4f9;
  color: var(--text);
}

.modal-body {
  padding: 20px 22px;
  overflow-y: auto;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  background: #fbfcff;
}

.confirm-text {
  font-size: 14px;
  line-height: 1.7;
  word-break: break-all;
}

.confirm-tip {
  margin-top: 8px;
  color: var(--text-sub);
  font-size: 12.5px;
}

/* ============================== 空状态 / 提示 ============================== */

.empty {
  padding: 34px 20px;
  text-align: center;
  color: var(--text-sub);
  font-size: 13px;
  background: #fafcff;
  border: 1px dashed #e2e8f4;
  border-radius: 10px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  z-index: 200;
  max-width: 520px;
  padding: 11px 22px;
  border-radius: 10px;
  background: #1f2329;
  color: #fff;
  font-size: 13.5px;
  line-height: 1.6;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.3);
  transform: translateX(-50%) translateY(10px);
  opacity: 0;
  transition: all 0.22s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.success {
  background: #14906a;
}

.toast.error {
  background: #d43b3b;
}

/* ============================== 响应式（小屏降级） ============================== */

@media (max-width: 1100px) {
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mini-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 820px) {
  .app {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: static;
  }

  .nav {
    flex-direction: row;
    flex-wrap: wrap;
    padding: 12px;
  }

  .nav-item {
    height: 36px;
    padding: 0 12px;
    font-size: 13px;
  }

  .nav-logout {
    margin-top: 0;
    border-top: 0;
    border-radius: 9px;
  }

  .sidebar-foot {
    display: none;
  }

  .topbar {
    height: auto;
    padding: 14px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .content {
    padding: 14px 14px 30px;
  }

  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .stat-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .modal-mask {
    padding: 12px;
  }

  .table .ops {
    flex-direction: column;
  }
}

/* ============================== 文档导入 ============================== */

.import-source-grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.file-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 200px;
  padding: 22px 18px;
  border: 1.5px dashed #c9d6ef;
  border-radius: 12px;
  background: #f8faff;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.file-drop:hover {
  border-color: var(--brand);
  background: var(--brand-lighter);
}

.file-drop input[type="file"] {
  display: none;
}

.file-drop-icon {
  font-size: 30px;
  line-height: 1;
}

.file-drop-title {
  color: var(--brand-dark);
  font-size: 14px;
  font-weight: 600;
}

.file-drop-desc {
  color: var(--text-sub);
  font-size: 12px;
  line-height: 1.6;
  word-break: break-all;
}

.import-paste {
  margin-bottom: 0;
  min-height: 200px;
}

.import-paste .json-head {
  width: 100%;
}

.import-paste .textarea {
  flex: 1;
  min-height: 150px;
}

.import-actions {
  justify-content: flex-start;
}

.import-warnings {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid #ffe4b8;
  border-radius: 10px;
  background: #fff8ea;
  color: #8a5a12;
  font-size: 12.5px;
  line-height: 1.7;
}

.import-warnings b {
  color: #b06f00;
}

.import-warnings ul {
  margin: 6px 0 0;
  padding-left: 20px;
}

.import-warnings li {
  margin-bottom: 2px;
}

.preview-stem {
  color: #25304a;
  font-weight: 500;
}

.preview-options {
  color: var(--text-sub);
  font-size: 12px;
  line-height: 1.6;
  word-break: break-all;
}

@media (max-width: 1100px) {
  .import-source-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .file-drop {
    min-height: 150px;
  }
}

/* ============================== 通用卡片提示 ============================== */

.card-note {
  margin-top: 12px;
  line-height: 1.7;
}

/* ============================== 公告管理 ============================== */

.announcement-title-text {
  color: #25304a;
  font-weight: 600;
}

.announcement-content-preview {
  margin-top: 2px;
  max-width: 640px;
  overflow: hidden;
  color: var(--text-sub);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.announcement-fixed-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 20px;
  background: #fff8ea;
  color: #b06f00;
  font-size: 11px;
  vertical-align: middle;
}

/* ============================== 用户管理 ============================== */

.user-title-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--brand-light);
  color: var(--brand-dark);
  font-size: 16px;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-name {
  color: #25304a;
  font-weight: 600;
}

.user-sub {
  margin-top: 2px;
  max-width: 320px;
  overflow: hidden;
  color: var(--text-sub);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-platform-tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 20px;
  background: #f2f6ff;
  color: #4a5670;
  font-size: 12px;
  white-space: nowrap;
}

/* ==========================================================================
   v30 视觉升级（品牌统一「谨记刷题」）
   说明：本段为覆盖层，仅增强视觉与交互，不改变任何 DOM 结构 / 功能逻辑。
   ========================================================================== */

:root {
  --brand: #3567f0;
  --brand-2: #5b8cff;
  --brand-dark: #1e46bd;
  --brand-deep: #0a1a3c;
  --brand-light: #eaf0ff;
  --brand-lighter: #f3f7ff;
  --ink: #0f1c33;
  --text: #1a2439;
  --text-sub: #7c879c;
  --line: #e8edf7;
  --page-bg: #f3f6fc;
  --card-bg: #ffffff;
  --radius: 16px;
  --radius-lg: 20px;
  --shadow: 0 10px 30px -12px rgba(19, 42, 92, 0.16), 0 3px 8px -4px rgba(19, 42, 92, 0.06);
  --shadow-hover: 0 22px 44px -16px rgba(19, 42, 92, 0.24);
  --shadow-lg: 0 40px 90px -30px rgba(4, 14, 36, 0.55);
  --grad-brand: linear-gradient(135deg, #5b8cff 0%, #3567f0 48%, #2449cf 100%);
  --grad-deep: linear-gradient(155deg, #0b1f45 0%, #0e1a33 52%, #060d1f 100%);
}

body {
  background:
    radial-gradient(1200px 520px at 12% -10%, rgba(53, 103, 240, 0.10), transparent 62%),
    radial-gradient(900px 480px at 100% 0%, rgba(86, 154, 255, 0.10), transparent 58%),
    var(--page-bg);
  color: var(--text);
  letter-spacing: 0.1px;
}

::selection {
  background: rgba(53, 103, 240, 0.22);
}

* {
  scrollbar-width: thin;
  scrollbar-color: #c3d2ee transparent;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-thumb {
  border-radius: 8px;
  background: linear-gradient(180deg, #c6d5f1, #aabfe6);
}

*::-webkit-scrollbar-track {
  background: transparent;
}

/* ---------- 通用按钮：渐变 / 圆角 / 微动效 ---------- */

.btn {
  height: 38px;
  padding: 0 18px;
  border-radius: 10px;
  font-weight: 600;
  letter-spacing: 0.2px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease,
    background 0.18s ease, color 0.18s ease, filter 0.18s ease;
}

.btn:active:not(:disabled) {
  transform: translateY(0) scale(0.99);
}

.btn-primary {
  background: var(--grad-brand);
  box-shadow: 0 10px 22px -10px rgba(53, 103, 240, 0.75);
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.04);
  transform: translateY(-2px);
  box-shadow: 0 16px 30px -12px rgba(53, 103, 240, 0.8);
}

.btn-ghost {
  border-color: #dfe7f6;
  color: #33405a;
  background: #fff;
}

.btn-ghost:hover:not(:disabled) {
  border-color: #b9cdf5;
  color: var(--brand);
  background: #f5f8ff;
  transform: translateY(-1px);
}

.btn-danger {
  background: #fff5f5;
  border-color: #ffd9d9;
  color: #e04646;
}

.btn-danger:hover:not(:disabled) {
  background: linear-gradient(135deg, #ff6b6b, #e23b3b);
  border-color: transparent;
  color: #fff;
  transform: translateY(-1px);
}

.btn-sm {
  height: 33px;
  padding: 0 13px;
  border-radius: 9px;
}

.btn-xs {
  height: 27px;
  padding: 0 10px;
  border-radius: 8px;
}

.btn-block {
  height: 48px;
  font-size: 16px;
  border-radius: 12px;
}

.btn:focus-visible,
.nav-item:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(53, 103, 240, 0.22);
  outline-offset: 2px;
}

/* ---------- 登录页：深色渐变 + 玻璃卡片 ---------- */

.login-view {
  min-height: 100vh;
  padding: 56px 20px;
  background:
    radial-gradient(760px 420px at 18% 12%, rgba(84, 138, 255, 0.34), transparent 66%),
    radial-gradient(680px 460px at 82% 88%, rgba(56, 224, 201, 0.18), transparent 62%),
    radial-gradient(520px 320px at 88% 10%, rgba(123, 97, 255, 0.22), transparent 60%),
    var(--grad-deep);
}

.login-view::before,
.login-view::after {
  filter: blur(2px);
  opacity: 0.8;
}

.login-view::before {
  width: 560px;
  height: 560px;
  left: -180px;
  top: -220px;
  background: radial-gradient(circle at 32% 30%, rgba(123, 172, 255, 0.5), transparent 68%);
  animation: v30-float 14s ease-in-out infinite;
}

.login-view::after {
  width: 720px;
  height: 720px;
  right: -260px;
  bottom: -360px;
  background: radial-gradient(circle at 40% 40%, rgba(67, 214, 255, 0.28), transparent 66%);
  animation: v30-float 18s ease-in-out infinite reverse;
}

@keyframes v30-float {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(18px, -22px, 0); }
}

.login-card {
  width: 424px;
  padding: 42px 38px 30px;
  border-radius: 26px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.97), rgba(244, 248, 255, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px) saturate(140%);
  animation: v30-card-in 0.45s cubic-bezier(0.22, 0.8, 0.32, 1);
}

@keyframes v30-card-in {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-card::before {
  content: "";
  display: block;
  width: 54px;
  height: 4px;
  margin: -8px auto 22px;
  border-radius: 999px;
  background: var(--grad-brand);
  opacity: 0.85;
}

.login-logo {
  width: 74px;
  height: 74px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--grad-brand);
  color: #fff;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 1px;
  box-shadow: 0 18px 34px -14px rgba(53, 103, 240, 0.85),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  animation: v30-logo-pulse 4.5s ease-in-out infinite;
}

@keyframes v30-logo-pulse {
  0%, 100% { box-shadow: 0 18px 34px -14px rgba(53, 103, 240, 0.85), 0 0 0 0 rgba(53, 103, 240, 0.24); }
  50% { box-shadow: 0 18px 34px -14px rgba(53, 103, 240, 0.85), 0 0 0 12px rgba(53, 103, 240, 0); }
}

.login-title {
  font-size: 25px;
  letter-spacing: 2px;
  color: #0f1c33;
}

.login-sub {
  margin: 10px 0 26px;
  color: #7b8699;
  font-size: 12.8px;
  letter-spacing: 0.6px;
}

.login-card .form-item {
  margin-bottom: 15px;
}

.login-card .form-label {
  color: #46536e;
}

.login-card .input {
  height: 46px;
  padding: 0 14px;
  border-radius: 12px;
  border-color: #d9e3f5;
  background: rgba(255, 255, 255, 0.86);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.login-card .input:hover {
  border-color: #bfd2f2;
  background: #fff;
}

.login-card .input:focus {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(53, 103, 240, 0.14);
}

.login-card .btn-block {
  margin-top: 8px;
  background: var(--grad-brand);
  box-shadow: 0 16px 30px -14px rgba(53, 103, 240, 0.9);
  letter-spacing: 6px;
  font-weight: 700;
}

.login-tip {
  margin-top: 20px;
  padding: 11px 14px;
  border-radius: 12px;
  background: rgba(238, 244, 255, 0.75);
  border: 1px solid rgba(196, 214, 248, 0.7);
  color: #67748c;
  font-size: 12.2px;
  letter-spacing: 0.2px;
}

.login-card .form-error {
  border-radius: 10px;
}

.login-brand-foot {
  margin-top: 16px;
  text-align: center;
  color: #a6b0c2;
  font-size: 11.5px;
  letter-spacing: 1.2px;
}

/* ---------- 侧边栏：深蓝渐变 + 圆角导航 ---------- */

.sidebar {
  width: 246px;
  background:
    radial-gradient(420px 280px at 20% 0%, rgba(91, 140, 255, 0.22), transparent 70%),
    linear-gradient(180deg, #0c1f44 0%, #0a1732 62%, #060d20 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 18px 0 42px -30px rgba(3, 10, 26, 0.8);
}

.brand {
  gap: 13px;
  padding: 24px 22px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.brand-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--grad-brand);
  color: #fff;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 1px;
  box-shadow: 0 12px 24px -12px rgba(91, 140, 255, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.brand-text b {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 1.6px;
}

.brand-text small {
  margin-top: 2px;
  color: rgba(214, 227, 255, 0.55);
  font-size: 11.5px;
  letter-spacing: 2.4px;
}

.nav {
  gap: 7px;
  padding: 18px 14px;
}

.nav-item {
  height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  color: rgba(214, 226, 249, 0.78);
  font-size: 13.8px;
  letter-spacing: 0.4px;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.nav-item:hover {
  background: rgba(122, 160, 255, 0.12);
  color: #fff;
  transform: translateX(2px);
}

.nav-item.active {
  background: var(--grad-brand);
  color: #fff;
  box-shadow: 0 14px 26px -14px rgba(58, 108, 245, 0.95),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.nav-logout {
  margin-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
}

.nav-logout:hover {
  background: rgba(255, 106, 106, 0.16);
  color: #ffc2c2;
}

.sidebar-foot {
  padding: 15px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  color: rgba(190, 208, 244, 0.42);
  font-size: 10.5px;
  letter-spacing: 0.8px;
}

/* ---------- 顶栏：白色毛玻璃 sticky ---------- */

.topbar {
  height: 70px;
  padding: 0 30px;
  background: rgba(255, 255, 255, 0.78);
  border-bottom: 1px solid rgba(226, 234, 248, 0.9);
  backdrop-filter: blur(16px) saturate(150%);
  box-shadow: 0 10px 28px -24px rgba(16, 35, 78, 0.35);
}

.topbar-left h2 {
  font-size: 19px;
  letter-spacing: 0.6px;
  color: #12203c;
}

.topbar-sub {
  color: #8b96aa;
  font-size: 12px;
  letter-spacing: 0.3px;
}

.topbar-right {
  gap: 12px;
}

.server-state {
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(232, 251, 243, 0.9);
  border: 1px solid rgba(35, 192, 143, 0.22);
  color: #118a63;
  font-size: 12px;
  letter-spacing: 0.3px;
}

.server-state.error {
  background: #fff0f0;
  border-color: #ffd5d5;
}

.admin-chip {
  padding: 6px 13px;
  border-radius: 999px;
  background: linear-gradient(135deg, #eef4ff, #e2ecff);
  border: 1px solid #d9e6ff;
  color: #2a4a8f;
  font-size: 12.5px;
}

/* ---------- 内容区 / 卡片 ---------- */

.content {
  max-width: 1480px;
  padding: 26px 30px 48px;
}

.card {
  margin-bottom: 20px;
  padding: 22px 24px 24px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(227, 235, 249, 0.9);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  border-color: rgba(203, 219, 250, 0.9);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.card-head {
  margin-bottom: 18px;
}

.card-head h3 {
  padding-left: 13px;
  font-size: 16.5px;
  letter-spacing: 0.4px;
  color: #132038;
}

.card-head h3::before {
  width: 4px;
  height: 18px;
  border-radius: 999px;
  background: var(--grad-brand);
  box-shadow: 0 2px 8px rgba(53, 103, 240, 0.45);
}

.card-tip {
  color: #8b96aa;
  font-size: 12.2px;
}

.card-foot {
  border-top: 1px dashed #e6ecf8;
}

.section-sub {
  margin: 26px 0 14px;
  padding-left: 11px;
  border-left: 3px solid #b9cdf7;
  color: #34425f;
  font-size: 13.5px;
  letter-spacing: 0.3px;
}

/* ---------- 统计卡：渐变图标 + hover 微动效 ---------- */

.stat-grid {
  gap: 18px;
  margin-bottom: 20px;
}

.stat-card {
  padding: 22px 22px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(227, 235, 249, 0.9);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: rgba(197, 215, 250, 0.95);
  box-shadow: var(--shadow-hover);
}

.stat-card::after {
  content: "";
  position: absolute;
  right: -34px;
  top: -34px;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 32%, rgba(91, 140, 255, 0.16), transparent 68%);
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 15px;
  font-size: 23px;
  box-shadow: 0 12px 22px -14px rgba(24, 52, 110, 0.55);
}

.stat-icon.blue {
  background: linear-gradient(135deg, #e6efff, #cfe0ff);
}

.stat-icon.green {
  background: linear-gradient(135deg, #e5fbf3, #c9f5e5);
}

.stat-icon.orange {
  background: linear-gradient(135deg, #fff2e6, #ffe3c9);
}

.stat-icon.purple {
  background: linear-gradient(135deg, #f1edff, #e2d9ff);
}

.stat-label {
  color: #8894a9;
  font-size: 12.2px;
  letter-spacing: 0.3px;
}

.stat-value {
  margin-top: 4px;
  font-size: 28px;
  letter-spacing: 0.6px;
  color: #0f1c33;
}

.mini-stat {
  border-radius: 13px;
  background: linear-gradient(160deg, #f8faff, #f2f7ff);
  border: 1px solid #e9f0fc;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.mini-stat:hover {
  border-color: #cfe0ff;
  box-shadow: 0 10px 22px -18px rgba(24, 52, 110, 0.4);
  transform: translateY(-1px);
}

.mini-stat b {
  color: #1e3f8f;
  font-size: 20px;
}

/* ---------- 表格：浅色表头 / 行 hover / 状态胶囊 ---------- */

.table-wrap {
  border-radius: 14px;
  border-color: #e8eefb;
  background: #fff;
}

.table thead th {
  padding: 12px 16px;
  background: linear-gradient(180deg, #f7faff, #f2f7ff);
  border-bottom: 1px solid #e8eefb;
  color: #5b6a86;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.table tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid #f0f4fb;
  color: #2c3a55;
}

.table tbody tr {
  transition: background 0.16s ease, box-shadow 0.16s ease;
}

.table tbody tr:hover {
  background: linear-gradient(90deg, #f7faff, #f2f7ff);
  box-shadow: inset 3px 0 0 rgba(53, 103, 240, 0.35);
}

.cell-main {
  color: #17233c;
  font-weight: 600;
}

.tag {
  padding: 3px 10px;
  border-radius: 999px;
  background: #eef4ff;
  color: #2a55c9;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.result-tag {
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 600;
}

.result-tag.correct {
  background: #e6fbf2;
  color: #0f8f63;
}

.result-tag.wrong {
  background: #fff0f0;
  color: #d13f3f;
}

.user-platform-tag {
  background: #f0f5ff;
  color: #45557a;
  font-weight: 500;
}

/* ---------- 表单 / 输入框 ---------- */

.form-label {
  color: #46536e;
  font-size: 12.3px;
  letter-spacing: 0.2px;
}

.input,
.textarea {
  border-radius: 10px;
  border-color: #dbe4f4;
  background: #fcfdff;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.input:hover,
.textarea:hover {
  border-color: #c3d3ef;
  background: #fff;
}

.input:focus,
.textarea:focus {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(53, 103, 240, 0.13);
}

.textarea.code {
  background: #f8fbff;
  border-color: #dbe6f8;
}

.form-hint {
  color: #909bb0;
}

.form-error {
  border-radius: 10px;
}

.json-head .btn {
  border-radius: 8px;
}

input[type="checkbox"] {
  accent-color: var(--brand);
}

/* ---------- 文档导入 / 空状态 ---------- */

.file-drop {
  border-radius: 16px;
  border-color: #c9d9f5;
  background:
    radial-gradient(240px 160px at 50% 0%, rgba(91, 140, 255, 0.10), transparent 70%),
    #f8faff;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.file-drop:hover {
  border-color: var(--brand);
  background: #f2f7ff;
  transform: translateY(-2px);
  box-shadow: 0 18px 34px -26px rgba(24, 52, 110, 0.5);
}

.file-drop-icon {
  filter: drop-shadow(0 6px 10px rgba(30, 70, 160, 0.22));
}

.empty {
  border-radius: 14px;
  border-color: #dde7f7;
  background:
    radial-gradient(320px 180px at 50% 0%, rgba(91, 140, 255, 0.08), transparent 70%),
    #fafcff;
  color: #8b96aa;
}

/* ---------- 弹窗 / Toast ---------- */

.modal-mask {
  background: rgba(8, 16, 34, 0.55);
  backdrop-filter: blur(6px) saturate(120%);
  animation: v30-mask-in 0.2s ease;
}

@keyframes v30-mask-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow-lg);
  animation: v30-modal-in 0.26s cubic-bezier(0.22, 0.8, 0.32, 1);
}

@keyframes v30-modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-head {
  padding: 18px 24px;
  background: linear-gradient(180deg, #fbfdff, #f5f9ff);
  border-bottom: 1px solid #e9eefb;
}

.modal-head h3 {
  font-size: 16.5px;
  letter-spacing: 0.4px;
}

.modal-close {
  border-radius: 10px;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.modal-close:hover {
  background: #eaf1ff;
  color: #1e46bd;
  transform: rotate(90deg);
}

.modal-body {
  padding: 22px 24px;
}

.modal-foot {
  padding: 16px 24px;
  background: #f8fbff;
  border-top: 1px solid #e9eefb;
}

.toast {
  padding: 13px 24px;
  border-radius: 999px;
  background: rgba(18, 29, 51, 0.94);
  font-size: 13px;
  letter-spacing: 0.3px;
  box-shadow: 0 22px 48px -18px rgba(4, 12, 30, 0.65);
  backdrop-filter: blur(8px);
}

.toast.success {
  background: linear-gradient(135deg, #16a979, #0e8a62);
}

.toast.error {
  background: linear-gradient(135deg, #ef5350, #d33535);
}

/* ---------- 响应式（v30 微调） ---------- */

@media (max-width: 1100px) {
  .content {
    padding: 20px 20px 40px;
  }

  .sidebar {
    width: 226px;
  }
}

@media (max-width: 820px) {
  .sidebar {
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .brand {
    padding: 16px 18px 14px;
  }

  .nav {
    flex-direction: row;
    flex-wrap: wrap;
    padding: 12px;
    gap: 6px;
  }

  .nav-item {
    height: 38px;
    padding: 0 12px;
    font-size: 13px;
  }

  .topbar {
    height: auto;
    padding: 14px 16px;
    gap: 10px;
  }

  .content {
    padding: 16px 14px 34px;
  }

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

  .stat-card {
    padding: 18px;
  }

  .card {
    padding: 18px 16px 20px;
    border-radius: 16px;
  }

  .modal {
    border-radius: 18px;
  }
}

/* 登录页：密码错误提示 */
.login-hint {
  margin: 10px 0 0;
  color: #8a6a1f;
  font-size: 12px;
  line-height: 1.6;
  background: #FFF8E6;
  border: 1px solid #FFE7A8;
  border-radius: 8px;
  padding: 8px 10px;
}
