/* ============================================
   管理后台
   ============================================ */

.admin-view {
  flex: 1;
  padding: clamp(36px, 6vh, 64px) 0 40px;
}

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

.auth-shell {
  display: flex;
  justify-content: center;
  padding: clamp(40px, 12vh, 120px) 0;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  padding: 34px 30px 30px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(255, 255, 255, 0.015) 100%
  );
  box-shadow: 0 40px 80px -50px rgba(112, 96, 255, 0.8);
}

.auth-eyebrow {
  margin: 0 0 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--dim);
}

.auth-title {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.auth-sub {
  margin: 0 0 26px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--muted);
}

.auth-card .btn {
  width: 100%;
  margin-top: 6px;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 16px;
}

.field > label {
  font-size: 12.5px;
  color: var(--muted);
}

.field .hint {
  font-size: 11.5px;
  color: var(--dim);
}

.input,
textarea.input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  transition: border-color 0.2s ease, box-shadow 0.2s ease,
    background-color 0.2s ease;
}

.input::placeholder {
  color: #4f4c66;
}

.input:focus {
  outline: none;
  border-color: rgba(154, 92, 255, 0.65);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 3px rgba(154, 92, 255, 0.15);
}

textarea.input {
  min-height: 84px;
  resize: vertical;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 4px 0 18px;
  font-size: 13.5px;
  color: var(--muted);
  cursor: pointer;
}

.check-row input {
  width: 16px;
  height: 16px;
  accent-color: #8b6bff;
  cursor: pointer;
}

.form-error {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 96, 130, 0.35);
  border-radius: 9px;
  background: rgba(255, 96, 130, 0.08);
  font-size: 13px;
  line-height: 1.5;
  color: #ffb3c2;
}

.form-error[hidden] {
  display: none;
}

/* ---------- 列表页 ---------- */

.admin-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.admin-title {
  margin: 0;
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 700;
  letter-spacing: -0.025em;
}

.admin-sub {
  margin: 6px 0 0;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--dim);
}

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

.btn-sm {
  padding: 10px 18px;
  font-size: 13.5px;
}

.btn-quiet {
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13.5px;
  cursor: pointer;
  transition: color 0.25s ease, border-color 0.25s ease,
    background-color 0.25s ease;
}

.btn-quiet:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
}

.rows {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.018);
  transition: border-color 0.25s ease, background-color 0.25s ease;
}

.row:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.035);
}

.row-thumb {
  position: relative;
  flex: none;
  width: 76px;
  height: 48px;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(
    135deg,
    rgba(76, 107, 255, 0.32),
    rgba(154, 92, 255, 0.2)
  );
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 16px;
  color: rgba(255, 255, 255, 0.6);
}

.row-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.row-title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-meta {
  margin: 3px 0 0;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.icon-btn {
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  font-size: 12.5px;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease,
    background-color 0.2s ease;
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.05);
}

.icon-btn.is-danger:hover {
  color: #ffb3c2;
  border-color: rgba(255, 96, 130, 0.5);
  background: rgba(255, 96, 130, 0.1);
}

.icon-btn.is-armed {
  color: #ffd0d9;
  border-color: rgba(255, 96, 130, 0.75);
  background: rgba(255, 96, 130, 0.18);
}

.admin-empty {
  margin-top: 22px;
  padding: 56px 24px;
  border: 1px dashed rgba(255, 255, 255, 0.13);
  border-radius: 14px;
  text-align: center;
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
}

/* ---------- 编辑弹窗 ---------- */

.editor {
  width: min(560px, calc(100vw - 32px));
  max-height: min(92vh, 760px);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: var(--surface-2);
  color: var(--text);
  box-shadow: 0 60px 120px -50px rgba(0, 0, 0, 0.9);
  overflow: hidden;
}

.editor::backdrop {
  background: rgba(3, 3, 9, 0.72);
  backdrop-filter: blur(8px);
}

.editor-form {
  display: flex;
  flex-direction: column;
  max-height: inherit;
}

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

.editor-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.editor-close {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.editor-close:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

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

.editor-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 22px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.015);
}

.editor-foot .btn {
  padding: 11px 20px;
  font-size: 14px;
}

/* 封面 */

.cover-field {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.cover-preview {
  position: relative;
  flex: none;
  width: 152px;
  aspect-ratio: 16 / 10;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
}

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

.cover-tools {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.cover-tools .hint {
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--dim);
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* ---------- 小屏 ---------- */

@media (max-width: 640px) {
  .row {
    flex-wrap: wrap;
  }

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

  .cover-field {
    flex-direction: column;
  }

  .cover-preview {
    width: 100%;
  }

  .editor-foot {
    flex-direction: column-reverse;
  }

  .editor-foot .btn,
  .editor-foot .btn-quiet {
    width: 100%;
  }
}
