/* =========================================================
   官方使用指南 · 管理后台样式
   ========================================================= */

.admin-body {
  min-height: 100vh;
}

/* ---------------- 登录 ---------------- */

.login-view {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 20px;
}

.login-card {
  width: min(430px, 100%);
  padding: 42px 38px 34px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(165deg, rgba(22, 28, 52, 0.85), rgba(9, 12, 24, 0.92));
  backdrop-filter: blur(26px) saturate(160%);
  -webkit-backdrop-filter: blur(26px) saturate(160%);
  box-shadow: 0 60px 130px -50px rgba(0, 0, 0, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: #c8d4f5;
}

.login-card h1 {
  margin: 26px 0 8px;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.login-sub {
  margin: 0 0 30px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--muted);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.login-tip {
  margin: 24px 0 0;
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted-soft);
}

.login-tip code {
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
  color: #b9caff;
  font-family: ui-monospace, Consolas, monospace;
}

.back-home {
  display: inline-block;
  margin-top: 16px;
  font-size: 12.5px;
  color: var(--muted-soft);
  transition: color 0.25s ease;
}

.back-home:hover {
  color: #c9d8ff;
}

/* ---------------- 表单元素 ---------------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: #c3cde6;
}

.field > span,
.field-label {
  font-size: 13px;
  color: #c3cde6;
  letter-spacing: 0.02em;
}

.field em {
  font-style: normal;
  color: #fb7185;
}

.field input[type="text"],
.field input[type="password"],
.field textarea {
  width: 100%;
  padding: 13px 15px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 11, 21, 0.66);
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.field textarea {
  resize: vertical;
  min-height: 84px;
  line-height: 1.7;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #5f6984;
}

.field input:focus,
.field textarea:focus {
  border-color: rgba(120, 155, 255, 0.6);
  box-shadow: 0 0 0 3px rgba(79, 124, 255, 0.16);
  background: rgba(10, 14, 28, 0.9);
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrap > svg {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: #6d7a99;
  pointer-events: none;
}

.input-wrap input {
  padding-left: 43px;
  padding-right: 46px;
}

.eye-btn {
  position: absolute;
  right: 6px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #7c89a8;
  transition: color 0.25s ease, background 0.25s ease;
}

.eye-btn:hover {
  color: #c3d3ff;
  background: rgba(255, 255, 255, 0.06);
}

.eye-btn svg {
  width: 18px;
  height: 18px;
}

.eye-btn.on {
  color: #9fc0ff;
}

.form-error {
  margin: -6px 0 0;
  padding: 10px 14px;
  font-size: 12.5px;
  color: #ffc0c9;
  border-radius: 10px;
  border: 1px solid rgba(251, 113, 133, 0.3);
  background: rgba(251, 113, 133, 0.1);
}

.btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  font-size: 14.5px;
  font-weight: 650;
  letter-spacing: 0.06em;
  color: #06080f;
  border-radius: 13px;
  background: linear-gradient(120deg, #8fd6ff, #a9b8ff 46%, #f0b8ff);
  box-shadow: 0 18px 40px -20px rgba(128, 168, 255, 0.9);
  transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 50px -20px rgba(150, 180, 255, 1);
}

.btn-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn-plain {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 12px 20px;
  font-size: 13.5px;
  color: #cdd8f2;
  border-radius: 12px;
  border: 1px solid var(--stroke-strong);
  background: rgba(255, 255, 255, 0.04);
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
}

.btn-plain:hover {
  background: rgba(255, 255, 255, 0.09);
  transform: translateY(-1px);
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  font-size: 13.5px;
  font-weight: 600;
  color: #ffe4e8;
  border-radius: 12px;
  border: 1px solid rgba(251, 113, 133, 0.45);
  background: linear-gradient(120deg, rgba(244, 63, 94, 0.9), rgba(190, 24, 93, 0.9));
  transition: transform 0.2s ease, box-shadow 0.25s ease;
}

.btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px -18px rgba(244, 63, 94, 0.9);
}

.danger-text {
  color: #ff9aa8;
  border-color: rgba(251, 113, 133, 0.3);
}

.danger-text:hover {
  background: rgba(251, 113, 133, 0.1);
}

/* ---------------- 后台框架 ---------------- */

.dash {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.admin-head {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(6, 8, 18, 0.74);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.admin-head-inner {
  width: min(1120px, 100% - 40px);
  margin: 0 auto;
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 26px;
}

.admin-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 12px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.tab {
  padding: 8px 16px;
  font-size: 13.5px;
  color: var(--muted);
  border-radius: 9px;
  transition: color 0.25s ease, background 0.25s ease;
}

.tab:hover {
  color: #dbe4fb;
}

.tab.active {
  color: #eaf1ff;
  background: rgba(110, 145, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(130, 165, 255, 0.28);
}

.admin-head-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ghost-link {
  padding: 8px 13px;
  font-size: 13px;
  color: var(--muted);
  border-radius: 9px;
  transition: color 0.25s ease, background 0.25s ease;
}

.ghost-link:hover {
  color: #d9e3ff;
  background: rgba(255, 255, 255, 0.06);
}

.admin-main {
  width: min(1120px, 100% - 40px);
  margin: 0 auto;
  padding: 36px 0 80px;
  flex: 1;
}

.tab-panel {
  display: none;
  flex-direction: column;
  gap: 26px;
  animation: panel-in 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.tab-panel.active {
  display: flex;
}

@keyframes panel-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.panel-card {
  padding: 30px;
  border-radius: 22px;
  border: 1px solid var(--stroke);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.014));
  box-shadow: 0 40px 90px -60px rgba(0, 0, 0, 0.9);
}

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

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

.panel-head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-sub {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted-soft);
  line-height: 1.7;
}

.count-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 24px;
  padding: 0 9px;
  font-size: 12.5px;
  font-weight: 600;
  color: #a9c4ff;
  border-radius: 999px;
  border: 1px solid rgba(120, 155, 255, 0.3);
  background: rgba(79, 124, 255, 0.14);
}

/* ---------------- 上传表单 ---------------- */

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-bottom: 22px;
}

.form-grid.two {
  grid-template-columns: 1fr 1fr;
}

.drop-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 18px;
  margin-bottom: 22px;
}

.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 168px;
  padding: 22px;
  text-align: center;
  border-radius: 16px;
  border: 1.5px dashed rgba(255, 255, 255, 0.16);
  background: rgba(8, 11, 21, 0.5);
  cursor: pointer;
  transition: border-color 0.28s ease, background 0.28s ease, transform 0.28s ease;
  overflow: hidden;
}

.dropzone:hover,
.dropzone.dragging {
  border-color: rgba(120, 160, 255, 0.65);
  background: rgba(60, 90, 190, 0.12);
}

.dropzone.dragging {
  transform: scale(1.008);
}

.dropzone > svg {
  width: 30px;
  height: 30px;
  color: #8ba6e8;
}

.dropzone b {
  font-size: 14px;
  font-weight: 600;
  color: #dbe4fb;
}

.dropzone small {
  font-size: 12px;
  color: var(--muted-soft);
}

.dropzone.tiny {
  min-height: 76px;
  padding: 16px;
  flex-direction: row;
  gap: 12px;
}

.dropzone.small {
  min-height: 168px;
  padding: 0;
}

.file-name {
  margin-top: 4px;
  max-width: 100%;
  padding: 5px 12px;
  font-size: 12px;
  color: #9fe8ff;
  border-radius: 999px;
  border: 1px solid rgba(34, 211, 238, 0.25);
  background: rgba(34, 211, 238, 0.1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cover-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 18px;
  color: var(--muted-soft);
}

.cover-preview svg {
  width: 30px;
  height: 30px;
  color: #8ba6e8;
}

.cover-preview b {
  font-size: 13px;
  color: #dbe4fb;
  font-weight: 600;
}

.cover-preview small {
  font-size: 11.5px;
}

#coverImg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 15px;
}

.upload-progress {
  margin-bottom: 22px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid rgba(120, 155, 255, 0.22);
  background: rgba(79, 124, 255, 0.07);
}

.upload-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 12.5px;
  color: #c3d2f5;
}

.upload-progress-head b {
  color: #a9c4ff;
  font-variant-numeric: tabular-nums;
}

.progress-track {
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #4f7cff, #22d3ee 55%, #a78bfa);
  box-shadow: 0 0 16px rgba(90, 150, 255, 0.65);
  transition: width 0.2s ease;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---------------- 教程列表 ---------------- */

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.list-loading,
.list-empty {
  padding: 44px 20px;
  text-align: center;
  font-size: 13.5px;
  color: var(--muted-soft);
  border-radius: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
}

.admin-item {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  background: rgba(255, 255, 255, 0.028);
  transition: border-color 0.28s ease, background 0.28s ease;
}

.admin-item:hover {
  border-color: rgba(130, 160, 255, 0.26);
  background: rgba(255, 255, 255, 0.05);
}

.admin-thumb {
  position: relative;
  flex: 0 0 auto;
  width: 132px;
  height: 74px;
  border-radius: 10px;
  background-color: #0b1020;
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.admin-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(79, 124, 255, 0.35), transparent 70%);
}

.admin-thumb.has-thumb::after {
  background: linear-gradient(180deg, transparent 60%, rgba(0, 0, 0, 0.28));
}

.admin-item-main {
  min-width: 0;
  flex: 1;
}

.admin-item-main h3 {
  margin: 0 0 5px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-item-main p {
  margin: 0 0 7px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: #66718c;
}

.admin-item-meta i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
}

.admin-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.mini-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 34px;
  height: 34px;
  padding: 0 11px;
  font-size: 12.5px;
  color: #c5d1ec;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.04);
  transition: background 0.22s ease, color 0.22s ease, border-color 0.22s ease;
}

.mini-btn:hover {
  background: rgba(120, 150, 255, 0.16);
  border-color: rgba(130, 165, 255, 0.35);
  color: #e6eeff;
}

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

.mini-btn.danger:hover {
  background: rgba(251, 113, 133, 0.14);
  border-color: rgba(251, 113, 133, 0.4);
  color: #ffc0c9;
}

/* ---------------- 联系方式编辑 ---------------- */

.qr-editor {
  display: flex;
  gap: 24px;
  padding: 20px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 11, 21, 0.42);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.qr-preview-box {
  flex: 0 0 auto;
  width: 168px;
  height: 168px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}

.qr-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
}

.qr-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  color: #8d97ad;
}

.qr-empty svg {
  width: 42px;
  height: 42px;
  opacity: 0.75;
}

.qr-empty span {
  font-size: 12px;
}

.qr-editor-actions {
  flex: 1;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.qr-editor-actions .field-label {
  margin: 0;
  font-size: 13px;
  color: #c3cde6;
}

.hint-text {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted-soft);
}

.inline-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.file-btn {
  position: relative;
  cursor: pointer;
  overflow: hidden;
}

.file-hint {
  margin: 0;
  font-size: 12px;
  color: #9fe8ff;
  word-break: break-all;
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
  cursor: pointer;
}

.checkbox input {
  width: 15px;
  height: 15px;
  accent-color: #6d8dff;
}

/* ---------------- 编辑 / 确认弹窗 ---------------- */

.edit-panel {
  position: relative;
  width: min(580px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 26px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(165deg, rgba(22, 28, 50, 0.99), rgba(9, 12, 24, 0.99));
  box-shadow: 0 60px 140px -40px rgba(0, 0, 0, 0.95);
  transform: translateY(18px) scale(0.98);
  transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.modal.open .edit-panel {
  transform: translateY(0) scale(1);
}

.edit-panel form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.edit-cover-row {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
}

.edit-cover-preview {
  width: 168px;
  height: 95px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(8, 11, 21, 0.6);
  overflow: hidden;
  font-size: 12px;
  color: var(--muted-soft);
}

.edit-cover-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.edit-cover-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.confirm-panel {
  position: relative;
  width: min(400px, 100%);
  padding: 30px;
  text-align: center;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(165deg, rgba(22, 28, 50, 0.99), rgba(9, 12, 24, 0.99));
  box-shadow: 0 60px 140px -40px rgba(0, 0, 0, 0.95);
  transform: scale(0.95);
  transition: transform 0.38s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.modal.open .confirm-panel {
  transform: scale(1);
}

.confirm-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #ffb4bf;
  border: 1px solid rgba(251, 113, 133, 0.3);
  background: rgba(251, 113, 133, 0.1);
}

.confirm-icon svg {
  width: 26px;
  height: 26px;
}

.confirm-panel h3 {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 700;
}

.confirm-panel p {
  margin: 0 0 24px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
}

.confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.confirm-actions > * {
  flex: 1;
}

/* ---------------- 响应式 ---------------- */

@media (max-width: 900px) {
  .drop-grid {
    grid-template-columns: 1fr;
  }

  .form-grid.two {
    grid-template-columns: 1fr;
  }

  .admin-head-inner {
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 0;
  }

  .admin-tabs {
    order: 3;
    width: 100%;
    margin-left: 0;
    overflow-x: auto;
  }

  .tab {
    flex: 1;
    white-space: nowrap;
  }
}

@media (max-width: 640px) {
  .login-card {
    padding: 32px 24px 26px;
    border-radius: 22px;
  }

  .panel-card {
    padding: 22px;
    border-radius: 18px;
  }

  .admin-main {
    width: min(1120px, 100% - 28px);
    padding: 24px 0 60px;
  }

  .admin-item {
    flex-wrap: wrap;
    gap: 12px;
  }

  .admin-thumb {
    width: 104px;
    height: 59px;
  }

  .admin-item-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .qr-editor {
    flex-direction: column;
    align-items: flex-start;
  }

  .qr-preview-box {
    width: 140px;
    height: 140px;
  }
}
