/* ============================================================
   释风史册 · 在线管理面板样式
   ============================================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #0f172a;
  color: #e2e8f0;
  min-height: 100vh;
}

/* ---------- 登录界面 ---------- */
.admin-login {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 30% 40%, rgba(59,130,246,0.08) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 60%, rgba(139,92,246,0.06) 0%, transparent 60%),
              #0f172a;
  z-index: 999;
}

.login-card {
  background: rgba(30,41,59,0.95);
  border: 1px solid rgba(148,163,184,0.12);
  border-radius: 20px;
  padding: 48px 40px;
  width: 400px;
  max-width: 92vw;
  text-align: center;
}

.login-logo {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  margin-bottom: 16px;
}

.login-header h1 {
  font-family: "Sora", "Noto Sans SC", sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 4px;
}

.login-header p {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 28px;
}

.login-form .input-group {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15,23,42,0.6);
  border: 1px solid rgba(148,163,184,0.15);
  border-radius: 12px;
  padding: 12px 16px;
  transition: border-color 0.2s;
}

.login-form .input-group:focus-within {
  border-color: #3b82f6;
}

.login-form .input-group svg {
  color: #64748b;
  flex-shrink: 0;
}

.login-form input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: #f1f5f9;
  font-size: 15px;
  font-family: inherit;
}

.login-form input::placeholder {
  color: #475569;
}

.login-error {
  color: #f87171;
  font-size: 13px;
  margin-top: 10px;
  min-height: 20px;
}

.btn-login {
  width: 100%;
  margin-top: 16px;
  padding: 13px;
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.btn-login:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

/* ---------- 管理面板 ---------- */
.admin-panel {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 顶部栏 */
.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: rgba(30,41,59,0.98);
  border-bottom: 1px solid rgba(148,163,184,0.1);
  flex-wrap: wrap;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
  color: #f1f5f9;
}

.tb-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

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

.tb-btn {
  padding: 8px 16px;
  background: rgba(148,163,184,0.08);
  color: #cbd5e1;
  border: 1px solid rgba(148,163,184,0.15);
  border-radius: 10px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}

.tb-btn:hover {
  background: rgba(148,163,184,0.16);
  color: #f1f5f9;
}

.tb-btn-add {
  background: #3b82f6;
  color: #fff;
  border-color: #3b82f6;
  font-weight: 600;
}

.tb-btn-add:hover {
  background: #2563eb;
}

.tb-btn-back {
  background: rgba(139,92,246,0.15);
  border-color: rgba(139,92,246,0.25);
  color: #a78bfa;
}

/* ---------- 统计栏 ---------- */
.admin-main {
  flex: 1;
  padding: 24px 28px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

.admin-stats {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.as-item {
  background: rgba(30,41,59,0.8);
  border: 1px solid rgba(148,163,184,0.1);
  border-radius: 12px;
  padding: 14px 20px;
  font-size: 13px;
  color: #94a3b8;
}

.as-num {
  font-weight: 700;
  font-size: 20px;
  color: #f1f5f9;
  margin-right: 4px;
}

.as-local {
  font-size: 13px;
  font-weight: 400;
  color: #f59e0b;
}

/* ---------- 表格 ---------- */
.admin-table-wrap {
  background: rgba(30,41,59,0.7);
  border: 1px solid rgba(148,163,184,0.1);
  border-radius: 16px;
  overflow-x: auto;
}

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

.admin-table thead {
  background: rgba(15,23,42,0.6);
}

.admin-table th {
  padding: 12px 14px;
  text-align: left;
  font-weight: 600;
  color: #94a3b8;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(148,163,184,0.1);
  white-space: nowrap;
}

.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(148,163,184,0.06);
  vertical-align: top;
}

.admin-table tbody tr:hover {
  background: rgba(59,130,246,0.04);
}

.row-new {
  background: rgba(34,197,94,0.06) !important;
}

.row-modified {
  background: rgba(245,158,11,0.06) !important;
}

.cell-date {
  font-family: "Sora", monospace;
  color: #94a3b8;
  font-size: 12px;
}

.cell-desc {
  color: #cbd5e1;
  max-width: 240px;
}

.cell-members {
  color: #94a3b8;
  font-size: 12px;
  max-width: 130px;
}

.cell-tags {
  max-width: 100px;
}

.cat-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
}

.badge-new {
  font-size: 10px;
  color: #22c55e;
  font-weight: 700;
  margin-left: 4px;
}

.badge-mod {
  font-size: 10px;
  color: #f59e0b;
  font-weight: 700;
  margin-left: 4px;
}

.tag-chip {
  display: inline-block;
  background: rgba(148,163,184,0.1);
  color: #64748b;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  margin: 1px 2px;
}

.row-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 15px;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background 0.15s;
}

.row-btn:hover {
  background: rgba(148,163,184,0.12);
}

.row-btn-del:hover {
  background: rgba(248,113,113,0.15);
}

/* ---------- 弹窗 ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  backdrop-filter: blur(4px);
}

.modal {
  background: #1e293b;
  border: 1px solid rgba(148,163,184,0.15);
  border-radius: 20px;
  width: 560px;
  max-width: 94vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(148,163,184,0.1);
}

.modal-header h2 {
  font-size: 17px;
  font-weight: 700;
  color: #f1f5f9;
}

.modal-close {
  background: none;
  border: none;
  color: #64748b;
  font-size: 24px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.modal-close:hover {
  color: #f1f5f9;
}

.edit-form {
  padding: 20px 24px 24px;
}

.form-group {
  margin-bottom: 16px;
  flex: 1;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group .req {
  color: #f87171;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: rgba(15,23,42,0.5);
  border: 1px solid rgba(148,163,184,0.15);
  border-radius: 10px;
  padding: 10px 14px;
  color: #f1f5f9;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: #3b82f6;
}

.form-group select {
  cursor: pointer;
}

.form-group select option {
  background: #1e293b;
  color: #f1f5f9;
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-row {
  display: flex;
  gap: 16px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid rgba(148,163,184,0.1);
}

.btn-cancel,
.btn-save {
  padding: 10px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-cancel {
  background: rgba(148,163,184,0.1);
  color: #94a3b8;
  border: 1px solid rgba(148,163,184,0.2);
}

.btn-cancel:hover {
  background: rgba(148,163,184,0.2);
  color: #f1f5f9;
}

.btn-save {
  background: #3b82f6;
  color: #fff;
  border: none;
}

.btn-save:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
  .admin-topbar {
    padding: 12px 16px;
  }
  .admin-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .admin-main {
    padding: 16px;
  }
  .form-row {
    flex-direction: column;
    gap: 0;
  }
  .tb-btn {
    font-size: 12px;
    padding: 6px 12px;
  }
}
