/* ============================================
   admin.css —— 管理后台样式
   ============================================ */

.hidden { display: none !important; }

/* ---------- 登录页 ---------- */
.login-wrap {
  position: relative;                    /* 背景画布绝对定位的参照 */
  overflow: hidden;                      /* 裁掉越界的波纹/粒子 */
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 0%, #12337a 0%, #0b1220 60%);
  padding: 24px;
}

/* ★ v4.11：登录动态背景画布（login-bg.js 绘制：真实流星雨 + 鼠标水波纹） */
#loginBg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;                  /* 不挡表单交互 */
}

.login-card {
  position: relative;
  z-index: 1;                            /* 置于背景画布之上 */
  width: 100%;
  max-width: 380px;
  background: rgba(255, 255, 255, 0.93); /* 半透明白 + 模糊 → 玻璃拟态 */
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 18px;
  padding: 40px 36px;
  box-shadow:
    0 0 34px rgba(0, 170, 255, 0.28),    /* 科技感外发光 */
    0 24px 60px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.login-logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: #fff;
  background: linear-gradient(135deg, #0a66ff, #00d4ff);
  border-radius: 14px;
}

.login-card h1 { font-size: 20px; margin-bottom: 6px; color: #1f2937; }
.login-sub { color: #6b7280; font-size: 13px; margin-bottom: 22px; }

.login-card input {
  width: 100%;
  border: 1px solid #e5eaf3;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  margin-bottom: 12px;
  background: #fbfdff;
  font-family: inherit;
}
.login-card input:focus { outline: none; border-color: #0a66ff; background: #fff; }

.login-err { color: #e5484d; font-size: 13px; min-height: 18px; margin-bottom: 4px; }
.login-tip { margin-top: 16px; font-size: 12px; color: #9ca3af; }

/* ---------- 管理页整体 ---------- */
.admin { min-height: 100vh; background: #f2f5fb; }

.admin-top {
  background: #0b1220;
  color: #fff;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
}

.admin-top-inner {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-title { font-size: 16px; font-weight: 700; }

.admin-top-actions { display: flex; align-items: center; gap: 10px; }
.admin-user { font-size: 13px; color: #9db3d8; margin-right: 6px; }

.admin-body { max-width: 1160px; margin: 0 auto; padding: 28px 24px 60px; }

/* ---------- 状态提示 ---------- */
.admin-status {
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 18px;
  font-size: 14px;
}
.admin-status.ok { background: #e6f7ef; color: #0a9e5f; border: 1px solid #b7e8d2; }
.admin-status.err { background: #fdecec; color: #e5484d; border: 1px solid #f5c2c4; }
.admin-status.show { display: block; }

/* ---------- Tab ---------- */
.admin-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  background: #fff;
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 2px 10px rgba(11, 18, 32, 0.06);
  max-width: fit-content;
}

.tab-btn {
  border: none;
  background: transparent;
  padding: 10px 22px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s;
}
.tab-btn:hover { color: #0a66ff; }
.tab-btn.active { background: #0a66ff; color: #fff; }

/* ---------- 面板切换（页签点击显示/隐藏） ---------- */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- 面板 ---------- */
.panel-card {
  background: #fff;
  border-radius: 14px;
  padding: 28px;
  box-shadow: 0 2px 10px rgba(11, 18, 32, 0.06);
}

.panel-card h2 {
  font-size: 16px;
  color: #1f2937;
  margin: 22px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eef2f8;
}
.panel-card h2:first-child { margin-top: 0; }

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.panel-head h2 { margin: 0; border: none; padding: 0; }

/* ---------- 表单 ---------- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: #6b7280;
}

.form-grid .span-2 { grid-column: span 2; }

.form-grid .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: #6b7280;
}

.form-grid input,
.form-grid textarea,
.manage-item input,
.manage-item textarea,
.manage-item select {
  border: 1px solid #e5eaf3;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  background: #fbfdff;
  color: #1f2937;
}
.form-grid input:focus,
.form-grid textarea:focus,
.manage-item input:focus,
.manage-item textarea:focus,
.manage-item select:focus {
  outline: none;
  border-color: #0a66ff;
  background: #fff;
}

/* 统计数字编辑 */
.stats-editor { display: flex; flex-direction: column; gap: 10px; }

.stat-row {
  display: grid;
  grid-template-columns: 90px 70px 1fr;
  gap: 10px;
}

.panel-actions { margin-top: 24px; text-align: right; }

/* ---------- 按钮 ---------- */
.btn { font-family: inherit; }

.btn-mini {
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 8px;
  border: 1px solid #e5eaf3;
  background: #fff;
  color: #1f2937;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-block;
}
.btn-mini:hover { border-color: #0a66ff; color: #0a66ff; }
.btn-mini.btn-primary { background: #0a66ff; border-color: #0a66ff; color: #fff; }
.btn-mini.btn-primary:hover { background: #0846b8; color: #fff; }
.btn-mini.btn-danger { background: #fff; border-color: #f5c2c4; color: #e5484d; }
.btn-mini.btn-danger:hover { background: #e5484d; border-color: #e5484d; color: #fff; }

/* ---------- 管理列表 ---------- */
.manage-list { display: flex; flex-direction: column; gap: 16px; }

.manage-item {
  border: 1px solid #e5eaf3;
  border-radius: 12px;
  padding: 18px;
  background: #fbfdff;
}

.manage-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  align-items: stretch;
}
.manage-row input,
.manage-row select { flex: 1; }
.manage-row textarea { flex: 1; resize: vertical; }

.soft-fields { margin-top: 2px; }

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

@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: span 1; }
  .manage-row { flex-direction: column; }
  .stat-row { grid-template-columns: 1fr 1fr; }
}

/* ---------- 图片上传行 ---------- */
.upload-row { align-items: center; flex-wrap: wrap; }

.upload-row .f-image { flex: 1; min-width: 200px; }

.upload-row .btn-upload { flex-shrink: 0; }

.img-preview {
  width: 90px;
  height: 54px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #f2f5fb;
}

/* 未设置图片时的占位提示 */
.preview-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 170px;
  min-height: 54px;
  border: 1px dashed #c9d4e6;
  border-radius: 8px;
  background: #f7f9fd;
  color: #9ca3af;
  font-size: 12px;
  padding: 6px 10px;
  text-align: center;
  line-height: 1.5;
}

/* hidden 属性必须生效（否则设置图片后占位文本仍显示） */
.preview-empty[hidden] {
  display: none !important;
}

@media (max-width: 640px) {
  .upload-row { align-items: stretch; }
  .img-preview { width: 100%; height: 120px; }
  .preview-empty { width: 100%; }
}

/* ---------- 留言管理 ---------- */
.contacts-tip {
  font-size: 13px;
  color: #6b7280;
  background: #f7f9fd;
  border: 1px dashed #c9d4e6;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 18px;
  line-height: 1.6;
}

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

.contact-item {
  border: 1px solid #e5eaf3;
  border-radius: 12px;
  padding: 16px 18px;
  background: #fbfdff;
}

.contact-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.contact-item-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.contact-item-meta b { color: #1f2937; font-size: 15px; }
.contact-item-meta span { color: #6b7280; font-size: 13px; }
.contact-item-meta .contact-item-company {
  background: #eef3fb;
  color: #0a66ff;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 12px;
}
.contact-item-meta .contact-item-time { color: #9ca3af; font-size: 12px; }

.contact-item-msg {
  color: #374151;
  font-size: 14px;
  line-height: 1.7;
  background: #fff;
  border: 1px solid #eef2f8;
  border-radius: 8px;
  padding: 12px 14px;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.empty-tip {
  text-align: center;
  color: #9ca3af;
  font-size: 14px;
  padding: 40px 20px;
  border: 1px dashed #c9d4e6;
  border-radius: 12px;
  background: #f7f9fd;
}

@media (max-width: 640px) {
  .contact-item-head { flex-direction: column; align-items: flex-start; }
  .contact-item-meta { gap: 8px; }
}

/* ---------- 登录记录（安全审计） ---------- */
.login-logs-list { display: flex; flex-direction: column; gap: 14px; }

.log-item {
  border: 1px solid #e5eaf3;
  border-radius: 12px;
  padding: 14px 18px;
  background: #fbfdff;
}

.log-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.log-item-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.log-item-meta b { color: #1f2937; font-size: 15px; }
.log-item-meta span { color: #6b7280; font-size: 13px; }

.log-status {
  display: inline-block;
  min-width: 44px;
  text-align: center;
  border-radius: 6px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
}
.log-status-ok { background: #e6f7ef; color: #0a9e5f; border: 1px solid #b7e8d2; }
.log-status-bad { background: #fdecec; color: #e5484d; border: 1px solid #f5c2c4; }

.log-item-time { color: #9ca3af; font-size: 12px; }
.log-item-ip { font-family: Consolas, Monaco, monospace; color: #0a66ff; font-size: 13px; }
.log-item-loc {
  background: #eef3fb;
  color: #0a66ff;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 12px;
}
.log-item-browser {
  background: #f3f4f6;
  color: #374151;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 12px;
}

.log-item-ua {
  color: #9ca3af;
  font-size: 12px;
  line-height: 1.6;
  margin: 0;
  word-break: break-all;
  white-space: pre-wrap;
}

@media (max-width: 640px) {
  .log-item-head { flex-direction: column; align-items: flex-start; }
  .log-item-meta { gap: 8px; }
}

/* ---------- 账号安全（v4.6：多管理员账号管理） ---------- */
.account-add-grid { max-width: 860px; }
.acc-row { display: flex; gap: 10px; flex-wrap: wrap; }
.acc-row input { flex: 1; min-width: 140px; }
.acc-current {
  display: inline-flex; align-items: center;
  background: #e6f7ef; color: #0a9e5f;
  border: 1px solid #b7e8d2; border-radius: 6px;
  padding: 2px 10px; font-size: 12px; font-weight: 600;
  white-space: nowrap;
}
.acc-meta { margin-bottom: 0; }
.acc-created { color: #9ca3af; font-size: 12px; }


/* ===== v5.2 上传进度条 ===== */
.upload-progress {
  position: relative;
  height: 6px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  margin-top: 6px;
  overflow: hidden;
}
.upload-progress-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #3b82f6, #38bdf8);
  border-radius: 3px;
  transition: width 0.2s ease;
}
.upload-progress-text {
  position: absolute;
  right: 0;
  top: -16px;
  font-size: 11px;
  color: #93c5fd;
  font-style: normal;
}

/* ========== v6.7 外观样式页签 ========== */
.th-color { display: inline-flex; align-items: center; gap: 8px; }
.th-color input[type=color] { width: 42px; height: 30px; padding: 0; border: 1px solid var(--border, #e5eaf3); border-radius: 6px; cursor: pointer; background: #fff; }
.th-color input[type=text] { width: 88px; font-family: Consolas, Menlo, monospace; }
.th-range { display: inline-flex; align-items: center; gap: 10px; width: 100%; }
.th-range input[type=range] { flex: 1; min-width: 120px; accent-color: #0a66ff; }
.th-range-val { min-width: 44px; text-align: right; font-size: 13px; color: #555; font-weight: 600; }
#tab-theme select, #tab-theme input[type=number] { min-height: 30px; border: 1px solid #d7dee8; border-radius: 6px; padding: 0 8px; }
