:root {
  --blue: #2f65df;
  --blue-2: #4f80f4;
  --red: #b83a3a;
  --bg: #f4f6fb;
  --surface: #ffffff;
  --text: #1f2937;
  --muted: #667085;
  --border: #e5e7eb;
  --shadow: 0 14px 36px rgba(20, 34, 66, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  min-width: 1180px;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

body.auth-pending .sidebar,
body.auth-pending .main,
body.auth-pending #admissionModal {
  visibility: hidden;
}

body.authenticated .login-screen {
  display: none;
}

body.login-active {
  overflow: hidden;
}

.hidden {
  display: none !important;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  overflow: hidden;
  background: linear-gradient(135deg, #dce9ff, #f8fbff);
}

.login-video {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%);
  object-fit: cover;
}

.login-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 78% 26%, rgba(255, 255, 255, 0.42), transparent 28%),
    linear-gradient(90deg, rgba(12, 28, 55, 0.18), rgba(255, 255, 255, 0.08));
  pointer-events: none;
}

.login-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 56px 12% 56px 32px;
}

.login-card {
  position: relative;
  width: 390px;
  padding: 42px 38px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.48);
  box-shadow: 0 24px 54px rgba(15, 35, 70, 0.18);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
}

.mute-button {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 50%;
  color: #1f2937;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 8px 18px rgba(20, 34, 66, 0.08);
}

.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 22px;
}

.login-mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(160deg, #ef4444, #b91c1c);
  font-size: 20px;
  font-weight: 900;
  box-shadow: 0 12px 24px rgba(185, 28, 28, 0.24);
}

.login-title {
  color: #111827;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 1px;
}

.login-subtitle {
  margin-top: 3px;
  color: rgba(17, 24, 39, 0.44);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.6px;
}

.login-card h1 {
  color: #182235;
  font-size: 18px;
  text-align: center;
}

.login-card p {
  margin: 8px 0 26px;
  color: rgba(17, 24, 39, 0.56);
  font-size: 13px;
  text-align: center;
}

.login-field {
  margin-bottom: 16px;
}

.login-field input {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  border: 1.5px solid rgba(255, 255, 255, 0.82);
  border-radius: 15px;
  outline: none;
  color: #111827;
  background: rgba(255, 255, 255, 0.72);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.login-field input:focus {
  border-color: #2f65df;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 0 0 4px rgba(47, 101, 223, 0.13);
}

.remember-admin {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  color: rgba(17, 24, 39, 0.66);
  font-size: 13px;
  user-select: none;
}

.remember-admin input {
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
}

.login-submit {
  width: 100%;
  height: 52px;
  border: 0;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(135deg, #1677ff, #4f80f4);
  box-shadow: 0 12px 24px rgba(22, 119, 255, 0.32);
  font-size: 16px;
  font-weight: 800;
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

.login-submit:active {
  transform: scale(0.97);
  box-shadow: 0 8px 18px rgba(22, 119, 255, 0.24);
}

.login-submit:disabled {
  opacity: 0.62;
  cursor: not-allowed;
}

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

button {
  cursor: pointer;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 248px;
  padding: 24px 18px;
  background: #10213f;
  color: #fff;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 8px 30px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(160deg, #ef4444, #b91c1c);
  font-weight: 900;
}

.brand-title {
  font-size: 18px;
  font-weight: 800;
}

.brand-subtitle {
  margin-top: 4px;
  color: #a9b7cd;
  font-size: 13px;
}

.nav-button {
  width: 100%;
  height: 44px;
  margin-bottom: 8px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  color: #cbd5e1;
  background: transparent;
  text-align: left;
  font-weight: 700;
}

.nav-button.active,
.nav-button:hover {
  color: #fff;
  background: rgba(79, 128, 244, 0.22);
}

.main {
  margin-left: 248px;
  padding: 24px;
}

.topbar {
  min-height: 92px;
  padding: 22px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-name {
  padding: 8px 12px;
  border-radius: 999px;
  color: #32415a;
  background: #eef3ff;
  font-size: 13px;
  font-weight: 800;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
}

.topbar p {
  margin-top: 8px;
  color: var(--muted);
}

.view {
  display: none;
  margin-top: 22px;
}

.view.active {
  display: block;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.metric-card,
.panel {
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric-card {
  padding: 22px;
}

.metric-card span {
  color: var(--muted);
  font-weight: 700;
}

.metric-card strong {
  display: block;
  margin-top: 12px;
  color: var(--blue);
  font-size: 34px;
}

.panel {
  margin-top: 18px;
  padding: 22px;
}

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

h2 {
  font-size: 20px;
}

.toolbar {
  display: flex;
  gap: 10px;
}

input,
textarea,
select {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.toolbar input {
  width: 280px;
}

.admission-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr)) auto auto;
  gap: 10px;
  margin: -2px 0 18px;
}

.admission-filters input {
  width: 100%;
}

.primary {
  border: 0;
  border-radius: 7px;
  color: #fff;
  background: var(--blue);
  font-weight: 800;
}

.ghost {
  border: 1px solid var(--border);
  color: #344054;
  background: #fff;
}

.small {
  min-height: 38px;
  padding: 0 16px;
}

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

.flow span {
  padding: 14px 18px;
  border-radius: 8px;
  color: var(--blue);
  background: #eef4ff;
  font-weight: 800;
}

.flow i {
  width: 32px;
  height: 2px;
  background: #c7d7ff;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
}

.user-table {
  min-width: 1040px;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 14px;
}

th {
  color: #42526b;
  background: #f0f4fb;
  font-weight: 800;
}

td {
  color: #1f2937;
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 250px;
}

.user-cell strong,
.user-cell span {
  display: block;
}

.user-cell strong {
  font-size: 15px;
}

.user-cell span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: cover;
  flex: 0 0 42px;
}

.user-avatar.empty {
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--blue);
  font-weight: 900;
}

.auth-tags {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.auth-tags span.ok {
  color: #1f7a35;
}

.row-actions {
  display: flex;
  gap: 8px;
  white-space: nowrap;
}

.row-actions button,
.plain-button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--blue);
  background: #fff;
  font-weight: 700;
}

.row-actions button.danger {
  color: #b42318;
}

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.45);
}

.modal-mask.show {
  display: flex;
}

.modal-panel {
  width: min(980px, calc(100vw - 48px));
  max-height: calc(100vh - 80px);
  overflow: auto;
  padding: 22px;
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}

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

.plain-button {
  width: 34px;
  height: 34px;
  padding: 0;
  color: #667085;
  font-size: 22px;
}

.modal-actions {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.modal-actions button {
  min-height: 38px;
  padding: 0 18px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  font-weight: 800;
}

.modal-actions button.primary {
  border: 0;
  color: #fff;
  background: var(--blue);
}

.pager {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.pager button {
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.editor-list {
  display: grid;
  gap: 14px;
}

.editor-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfcff;
}

.editor-card h3 {
  margin: 0 0 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.field.wide {
  grid-column: span 3;
}

textarea {
  min-height: 74px;
  resize: vertical;
}

.upload-field {
  align-content: start;
}

.upload-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.image-url-input {
  color: #475467;
  background: #f8fafc;
}

.upload-button {
  position: relative;
  min-height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff !important;
  background: var(--blue) !important;
  font-weight: 800;
  line-height: 38px;
  cursor: pointer;
  overflow: hidden;
}

.upload-button.loading {
  pointer-events: none;
}

.upload-button span {
  position: relative;
  z-index: 1;
  color: #fff;
  pointer-events: none;
}

.upload-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-help {
  color: var(--muted);
  font-size: 12px;
}

.image-preview {
  display: none;
  width: 132px;
  height: 132px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

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

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.watermark-preview {
  position: relative;
  height: 180px;
  margin-top: 18px;
  border: 1px dashed #c8d4e6;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  overflow: hidden;
}

.watermark-preview::before {
  content: "预览区域";
  position: absolute;
  left: 14px;
  top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.watermark-preview-layer {
  width: 92%;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
  user-select: none;
}

.watermark-preview-layer.text {
  height: auto;
  align-items: center;
  justify-content: center;
}

.watermark-preview-layer.text span {
  white-space: nowrap;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1200;
  display: none;
  padding: 12px 16px;
  border-radius: 8px;
  color: #fff;
  background: rgba(15, 23, 42, 0.92);
  font-weight: 700;
}

.toast.show {
  display: block;
}
