/* ============================================================
   聚鑫工作室 · 管理后台样式
   ============================================================ */

:root {
  --bg0: #04060d;
  --bg1: #0a1122;
  --panel: rgba(15, 23, 42, 0.62);
  --line: rgba(96, 140, 255, 0.16);
  --cyan: #22d3ee;
  --blue: #4f7cff;
  --purple: #a855f7;
  --green: #34d399;
  --amber: #fbbf24;
  --red: #fb7185;
  --text: #e8f1ff;
  --muted: #93a7c9;
  --font: "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  --mono: Consolas, "Courier New", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: var(--font);
  background: var(--bg0);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  background-image:
    linear-gradient(rgba(80, 140, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(80, 140, 255, 0.045) 1px, transparent 1px);
  background-size: 48px 48px;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font-family: inherit; }
::selection { background: rgba(34, 211, 238, 0.35); }
::-webkit-scrollbar { width: 9px; }
::-webkit-scrollbar-track { background: var(--bg0); }
::-webkit-scrollbar-thumb { background: #1c2b4d; border-radius: 5px; }

/* ---------- 通用按钮 ---------- */
.btn-primary {
  padding: 11px 22px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: #03121a;
  background: linear-gradient(90deg, #22d3ee, #4f7cff);
  transition: 0.25s;
  white-space: nowrap;
}
.btn-primary:hover { filter: brightness(1.12); box-shadow: 0 6px 22px rgba(34, 211, 238, 0.28); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; filter: none; box-shadow: none; }
.btn-ghost-sm {
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--muted);
  border: 1px solid var(--line);
  transition: 0.25s;
}
.btn-ghost-sm:hover { color: var(--cyan); border-color: rgba(34, 211, 238, 0.5); }

/* ---------- 登录 ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: 100%; max-width: 380px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 40px 34px 30px;
  backdrop-filter: blur(14px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  text-align: center;
}
.login-mark {
  width: 62px; height: 62px; margin: 0 auto 18px;
  display: grid; place-items: center;
  border-radius: 16px; overflow: hidden;
  color: #03121a;
  background: linear-gradient(135deg, #67e8f9, #4f7cff);
  box-shadow: 0 10px 30px rgba(79, 124, 255, 0.35);
}
.login-mark img { width: 100%; height: 100%; display: block; object-fit: cover; }
.login-card h1 { font-size: 21px; letter-spacing: 1px; }
.login-sub { font-size: 11px; letter-spacing: 3px; color: var(--muted); margin: 6px 0 26px; }
.field { display: block; text-align: left; margin-bottom: 16px; }
.field span { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 7px; }
.field input,
.inline-form input {
  width: 100%;
  background: rgba(8, 14, 28, 0.7);
  border: 1px solid rgba(90, 140, 255, 0.22);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text);
  font-size: 14px;
  transition: 0.25s;
}
.field input:focus,
.inline-form input:focus {
  outline: none;
  border-color: rgba(34, 211, 238, 0.6);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
}
.field textarea {
  width: 100%;
  background: rgba(8, 14, 28, 0.7);
  border: 1px solid rgba(90, 140, 255, 0.22);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  transition: 0.25s;
}
.field textarea:focus {
  outline: none;
  border-color: rgba(34, 211, 238, 0.6);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
}
.login-card .btn-primary { width: 100%; margin-top: 6px; padding: 12px; }
.login-err { min-height: 20px; margin-top: 12px; font-size: 12.5px; color: var(--red); }
.back-site { display: inline-block; margin-top: 8px; font-size: 12.5px; color: var(--muted); text-decoration: none; }
.back-site:hover { color: var(--cyan); }

/* ---------- 布局 ---------- */
.app { display: grid; grid-template-columns: 216px 1fr; min-height: 100vh; }

.side {
  background: rgba(8, 13, 26, 0.85);
  border-right: 1px solid var(--line);
  padding: 26px 16px 20px;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.side-logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 19px; font-weight: 700; letter-spacing: 2px;
  padding: 0 10px 22px;
}
.side-logo img {
  width: 30px; height: 30px; flex: 0 0 auto;
  border-radius: 9px; overflow: hidden; display: block;
  box-shadow: 0 4px 14px rgba(79, 124, 255, 0.35);
}
.side-logo em { display: block; font-size: 9.5px; letter-spacing: 3px; color: var(--muted); font-weight: 400; margin-top: 4px; }
.side-logo > span { display: block; line-height: 1.25; }
.side-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px;
  border-radius: 10px;
  font-size: 14px;
  color: var(--muted);
  text-align: left;
  transition: 0.22s;
}
.nav-item i { font-size: 14px; opacity: 0.85; width: 16px; text-align: center; }
.nav-item:hover { background: rgba(79, 124, 255, 0.1); color: var(--text); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.16), rgba(79, 124, 255, 0.1));
  color: #fff;
  box-shadow: inset 2px 0 0 var(--cyan);
}
.badge {
  margin-left: auto;
  min-width: 20px; height: 20px; padding: 0 6px;
  display: grid; place-items: center;
  border-radius: 10px;
  font-size: 11px; font-weight: 700;
  color: #03121a;
  background: var(--amber);
}
.badge[hidden] { display: none; }
.side-foot {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 12.5px; color: var(--muted);
}
.side-foot span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { padding: 34px 38px 80px; max-width: 1080px; }
.page-head { margin-bottom: 26px; }
.page-head h2 { font-size: 24px; letter-spacing: 0.5px; }
.page-head p { font-size: 13.5px; color: var(--muted); margin-top: 4px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeUp 0.32s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- 卡片 ---------- */
.card-block {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px 26px;
  margin-bottom: 18px;
}
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.block-head h3 { font-size: 15.5px; }
.block-desc { font-size: 13px; color: var(--muted); margin-bottom: 16px; }

.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
}
.stat-card em { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.stat-card strong { font-size: 28px; font-family: var(--mono); letter-spacing: 1px; color: #67e8f9; }
.stat-card strong.hl-amber { color: var(--amber); }

.pill {
  padding: 4px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
  color: var(--green);
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.3);
}
.pill.off { color: var(--amber); background: rgba(251, 191, 36, 0.12); border-color: rgba(251, 191, 36, 0.32); }

/* ---------- 开关 ---------- */
.switch-row { display: flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; }
.switch-row input { display: none; }
.switch {
  position: relative; width: 48px; height: 26px; border-radius: 999px;
  background: rgba(90, 120, 180, 0.3);
  transition: 0.28s;
  flex: 0 0 auto;
}
.switch::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #cfe0ff; transition: 0.28s;
}
.switch-row input:checked + .switch { background: linear-gradient(90deg, #22d3ee, #4f7cff); }
.switch-row input:checked + .switch::after { transform: translateX(22px); background: #fff; }
.switch-label { font-size: 13.5px; color: var(--text); }
#tab-settings .field { margin-top: 20px; }

/* ---------- 留言 ---------- */
.filter-row { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; }
.chip {
  padding: 7px 16px; border-radius: 999px;
  font-size: 13px; color: var(--muted);
  border: 1px solid var(--line);
  transition: 0.22s;
}
.chip:hover { color: var(--text); }
.chip.active { color: #03121a; background: linear-gradient(90deg, #22d3ee, #4f7cff); border-color: transparent; font-weight: 600; }
.filter-row .btn-ghost-sm { margin-left: auto; }

.msg-list { display: flex; flex-direction: column; gap: 12px; }
.msg-item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--amber);
  border-radius: 12px;
  padding: 18px 20px;
}
.msg-item.done { border-left-color: rgba(52, 211, 153, 0.6); opacity: 0.82; }
.msg-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.msg-name { font-size: 15px; font-weight: 600; }
.msg-contact {
  font-size: 13px; font-family: var(--mono);
  color: #7dd3fc;
  padding: 2px 8px; border-radius: 6px;
  background: rgba(34, 211, 238, 0.08);
}
.msg-time { font-size: 12px; color: var(--muted); margin-left: auto; }
.msg-body { font-size: 13.5px; color: #cfe0ff; white-space: pre-wrap; word-break: break-word; }
.msg-actions { display: flex; gap: 8px; margin-top: 14px; }
.mini-list .msg-item { padding: 14px 16px; }

.empty { padding: 46px 0; text-align: center; color: var(--muted); font-size: 13.5px; }

.msg-more { text-align: center; margin-top: 14px; }

/* ---------- 内容管理 ---------- */
.content-form .group { margin-bottom: 18px; }
.group-title {
  font-size: 13px; letter-spacing: 2px; color: var(--cyan);
  margin-bottom: 12px; padding-left: 10px;
  border-left: 3px solid var(--cyan);
}
.group-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.cf { display: block; }
.cf.wide { grid-column: 1 / -1; }
.cf span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.cf input, .cf textarea {
  width: 100%;
  background: rgba(8, 14, 28, 0.7);
  border: 1px solid rgba(90, 140, 255, 0.2);
  border-radius: 9px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 13.5px;
  font-family: inherit;
  resize: vertical;
  transition: 0.22s;
}
.cf input:focus, .cf textarea:focus {
  outline: none; border-color: rgba(34, 211, 238, 0.55);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.1);
}
.sticky-save {
  position: sticky; bottom: 0;
  padding: 16px 0 4px;
  background: linear-gradient(180deg, transparent, var(--bg0) 40%);
}

/* ---------- 管理员 ---------- */
.user-list { display: flex; flex-direction: column; gap: 10px; }
.user-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(8, 14, 28, 0.45);
  font-size: 13.5px;
}
.user-row .u-name { font-weight: 600; }
.user-row .u-me { font-size: 11px; color: var(--cyan); border: 1px solid rgba(34,211,238,.4); border-radius: 999px; padding: 1px 8px; }
.user-row .u-time { font-size: 12px; color: var(--muted); margin-left: auto; }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; }
.inline-form input { flex: 1; min-width: 180px; width: auto; }

/* ---------- 资源下载 ---------- */
.dl-item {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(8, 14, 28, 0.45);
  margin-bottom: 10px;
}
.dl-item .dl-info { flex: 1; min-width: 0; }
.dl-item .dl-n {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-weight: 600; font-size: 14px;
}
.dl-item .dl-v {
  font-size: 11.5px; font-family: var(--mono);
  color: var(--amber);
  border: 1px solid rgba(251, 191, 36, 0.32);
  border-radius: 5px; padding: 1px 7px;
}
.dl-item .dl-d { font-size: 12.5px; color: var(--muted); margin-top: 5px; word-break: break-word; }
.dl-item .dl-u {
  font-size: 11.5px; color: #7dd3fc; font-family: var(--mono);
  margin-top: 5px; word-break: break-all; opacity: 0.8;
}
.dl-item .dl-bk {
  display: flex; align-items: baseline; gap: 7px;
  margin-top: 6px; flex-wrap: wrap;
}
.dl-item .dl-bk > span:first-child {
  font-size: 10.5px; color: var(--amber);
  border: 1px solid rgba(251, 191, 36, 0.34);
  border-radius: 5px; padding: 1px 6px; flex: 0 0 auto;
}
.dl-item .dl-bk .dl-u { margin-top: 0; color: var(--muted); }
.dl-item .dl-acts { display: flex; gap: 7px; flex: 0 0 auto; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 36px;
  transform: translate(-50%, 20px);
  padding: 12px 22px;
  border-radius: 10px;
  font-size: 13.5px;
  background: rgba(10, 17, 34, 0.96);
  border: 1px solid rgba(34, 211, 238, 0.4);
  color: var(--text);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  opacity: 0; pointer-events: none;
  transition: 0.3s;
  z-index: 999;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { border-color: rgba(251, 113, 133, 0.55); }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; align-items: center; gap: 10px; overflow-x: auto; padding: 14px; }
  .side-logo { padding: 0; white-space: nowrap; }
  .side-logo em { display: none; }
  .side-nav { flex-direction: row; flex: 1; }
  .nav-item { white-space: nowrap; }
  .side-foot { border: none; padding: 0; }
  .main { padding: 22px 18px 70px; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .group-fields { grid-template-columns: 1fr; }
}

/* ---------- 强制修改初始密码（盖在后台上面，不给关掉） ---------- */
.force-wrap { display: none; position: fixed; inset: 0; z-index: 90; place-items: center; padding: 24px; background: rgba(4, 6, 13, 0.92); }
.force-wrap.on { display: grid; }
.force-card { max-width: 400px; }
.force-card .login-sub { letter-spacing: 0.5px; font-size: 12.5px; }
.force-card .btn-primary { width: 100%; margin-top: 6px; padding: 12px; }

/* 表格/表单下面的一句说明 */
.hint { font-size: 12px; color: var(--muted); margin-top: 10px; }
