/* ==========================================================
   admin.css — 本地内容管理后台
   ========================================================== */
.admin-body { background: var(--surface); min-height: 100vh; }

.login {
  min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; overflow: hidden; background: var(--night); color: #f5f3ee;
}
.login__orb { position: absolute; width: 70vmax; height: 70vmax; border-radius: 50%; filter: blur(90px); opacity: 0.5;
  background: conic-gradient(from 0deg, #6e4bd8, #da7756, #9b7bf0, #4a2fa3, #6e4bd8); animation: auraSpin 24s linear infinite; }
.login__card {
  position: relative; width: min(420px, 100%); padding: 44px 38px 36px; border-radius: 30px;
  background: rgba(20, 16, 30, 0.6); backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(255,255,255,0.12); box-shadow: 0 50px 100px -40px rgba(0,0,0,0.8);
}
.login__card h1 { margin: 0; font-size: 40px; font-weight: 600; }
.login__card p { margin: 8px 0 28px; font-size: 14px; color: rgba(245,243,238,0.6); }
.field { display: block; margin-bottom: 18px; }
.field span { display: block; font-size: 12px; letter-spacing: 0.2em; color: rgba(245,243,238,0.6); margin-bottom: 8px; font-family: var(--font-mono); }
.input {
  width: 100%; padding: 14px 16px; border-radius: 14px; font: inherit; font-size: 16px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.14); color: inherit; outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.input:focus { border-color: #9b7bf0; box-shadow: 0 0 0 4px rgba(155,123,240,0.25); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 22px; border-radius: 999px; font-size: 15px;
  background: var(--purple-4); color: #fff; transition: background 0.3s, transform 0.3s var(--ease-spring), opacity 0.3s;
}
.btn:hover { background: var(--purple-5); transform: translateY(-1px); }
.btn:active { transform: scale(0.97); }
.btn--block { width: 100%; padding: 15px; }
.btn--ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--warn { background: var(--accent); }
.btn--warn:hover { background: #c4623f; }
.login__err { min-height: 22px; margin-top: 14px; font-size: 14px; color: #ffb59b; }
.shake { animation: shake 0.5s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

.dash { display: none; min-height: 100vh; grid-template-columns: 260px minmax(0, 1fr); }
.is-authed .login { display: none; }
.is-authed .dash { display: grid; }
.side { background: var(--night); color: #f5f3ee; padding: 28px 20px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px; }
.side__brand { font-size: 22px; font-weight: 600; margin: 0 10px 26px; display: flex; align-items: center; gap: 10px; }
.side__tab { text-align: left; padding: 12px 14px; border-radius: 14px; font-size: 15px; opacity: 0.7; transition: background 0.3s, opacity 0.3s; }
.side__tab:hover { opacity: 1; background: rgba(255,255,255,0.06); }
.side__tab.is-active { opacity: 1; background: rgba(155,123,240,0.22); }
.side__foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.side__foot a, .side__foot button { padding: 10px 14px; border-radius: 12px; font-size: 14px; opacity: 0.65; text-align: left; }
.side__foot a:hover, .side__foot button:hover { opacity: 1; background: rgba(255,255,255,0.06); }

.main { padding: 36px clamp(20px, 4vw, 56px) 80px; min-width: 0; }
.main__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.main__head h2 { margin: 0; font-size: 38px; font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin: 28px 0; }
.stat { padding: 22px 24px; border-radius: 22px; background: #fff; border: 1px solid var(--line); position: relative; overflow: hidden; }
.stat__n { font-size: 46px; font-weight: 600; line-height: 1.1; }
.stat__l { font-size: 13px; color: var(--ink-3); letter-spacing: 0.08em; }
.stat::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: radial-gradient(circle, rgba(155,123,240,0.35), transparent 70%); }

.panel { background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 24px; }
.panel + .panel { margin-top: 20px; }
.panel h3 { margin: 0 0 4px; font-size: 20px; }
.panel .hint { font-size: 13px; color: var(--ink-3); margin: 0 0 16px; }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.form-grid label { display: block; }
.form-grid label span { display: block; font-size: 12px; color: var(--ink-3); margin-bottom: 6px; letter-spacing: 0.08em; }
.panel .input, .panel textarea {
  width: 100%; background: var(--paper); border: 1px solid var(--line); color: var(--ink); border-radius: 12px; padding: 12px 14px; font: inherit; font-size: 15px; outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.panel .input:focus, .panel textarea:focus { border-color: var(--purple-3); box-shadow: 0 0 0 4px rgba(155,123,240,0.18); }
.code { font-family: var(--font-mono) !important; font-size: 13px !important; line-height: 1.6; min-height: 420px; resize: vertical; white-space: pre; tab-size: 2; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.preview { width: 100%; height: 520px; border: 0; border-radius: 18px; background: var(--night); }

.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translate(-50%, 30px); opacity: 0; z-index: 300;
  padding: 12px 22px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 14px;
  transition: opacity 0.4s, transform 0.5s var(--ease-spring); pointer-events: none;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast.is-err { background: #b4472a; }

@media (max-width: 860px) {
  .dash { grid-template-columns: 1fr; }
  .side { position: relative; height: auto; flex-direction: row; flex-wrap: wrap; }
  .side__brand { width: 100%; margin-bottom: 10px; }
  .side__foot { margin: 0; flex-direction: row; }
}
