/* ============================================================
 * 门户 + 登录页 公共样式（现代设计）
 * 设计变量统一管理，双页共用
 * ============================================================ */
:root {
  --brand: #2563eb;
  --brand-deep: #1d4ed8;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --amber: #f59e0b;
  --radius: 14px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
 * 门户页：深蓝渐变 + 光斑装饰 + 玻璃卡片
 * ============================================================ */
.portal {
  position: relative;
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 40px 20px;
  color: #fff;
  background:
    radial-gradient(720px 420px at 12% 8%, rgba(56, 189, 248, .28), transparent 60%),
    radial-gradient(680px 480px at 88% 20%, rgba(129, 140, 248, .26), transparent 60%),
    radial-gradient(900px 520px at 50% 108%, rgba(37, 99, 235, .35), transparent 62%),
    linear-gradient(160deg, #0b1f4b 0%, #122a5e 45%, #0e1e42 100%);
  overflow: hidden;
}
/* 漂浮装饰点 */
.portal::before, .portal::after {
  content: ""; position: absolute; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .12);
}
.portal::before { width: 460px; height: 460px; top: -160px; right: -120px; animation: floaty 9s ease-in-out infinite; }
.portal::after  { width: 320px; height: 320px; bottom: -110px; left: -90px; animation: floaty 11s ease-in-out infinite reverse; }
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(18px); }
}

.portal .brand {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 10px;
}
.portal .brand .logo-mark {
  width: 52px; height: 52px; border-radius: 14px;
  background: linear-gradient(135deg, #38bdf8, #2563eb);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  box-shadow: 0 10px 26px rgba(37, 99, 235, .5);
}
.portal h1 { font-size: 34px; letter-spacing: 2px; font-weight: 700; }
.portal .subtitle {
  font-size: 14px; letter-spacing: 4px;
  color: rgba(226, 232, 240, .72);
  margin: 14px 0 46px;
}
.portal .cards { display: flex; gap: 28px; flex-wrap: wrap; justify-content: center; }

.portal .card {
  position: relative;
  width: 252px; padding: 38px 26px 34px; text-align: center;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 20px; cursor: pointer;
  transition: transform .3s cubic-bezier(.2, .8, .3, 1), box-shadow .3s, background .3s, border-color .3s;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow: hidden;
}
.portal .card::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, .14), transparent 45%);
  opacity: 0; transition: opacity .3s;
}
.portal .card:hover {
  background: rgba(255, 255, 255, .13);
  border-color: rgba(125, 211, 252, .55);
  transform: translateY(-8px);
  box-shadow: 0 24px 48px rgba(2, 8, 30, .5);
}
.portal .card:hover::after { opacity: 1; }
.portal .card .icon {
  width: 76px; height: 76px; margin: 0 auto 18px;
  border-radius: 22px;
  display: flex; align-items: center; justify-content: center;
  font-size: 38px;
  background: linear-gradient(135deg, rgba(56, 189, 248, .25), rgba(37, 99, 235, .35));
  border: 1px solid rgba(147, 197, 253, .35);
}
.portal .card .name { font-size: 20px; font-weight: 700; letter-spacing: 1px; margin-bottom: 8px; }
.portal .card .desc { font-size: 13px; color: rgba(226, 232, 240, .68); line-height: 1.7; }
.portal .card .go {
  display: inline-block; margin-top: 18px; padding: 7px 20px;
  font-size: 12px; letter-spacing: 2px; border-radius: 20px;
  color: #bfdbfe; border: 1px solid rgba(147, 197, 253, .4);
  transition: all .25s;
}
.portal .card:hover .go { background: var(--brand); border-color: var(--brand); color: #fff; }

.portal .foot {
  position: absolute; bottom: 22px;
  font-size: 12px; letter-spacing: 2px; color: rgba(226, 232, 240, .38);
}

@media (max-width: 640px) {
  .portal h1 { font-size: 26px; }
  .portal .cards { flex-direction: column; align-items: center; gap: 18px; }
  .portal .card { width: 100%; max-width: 300px; padding: 28px 22px; }
}

/* ============================================================
 * 登录页
 * ============================================================ */
.login-page {
  position: relative;
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background:
    radial-gradient(640px 400px at 85% 12%, rgba(56, 189, 248, .22), transparent 60%),
    radial-gradient(700px 460px at 10% 90%, rgba(99, 102, 241, .2), transparent 60%),
    linear-gradient(160deg, #0b1f4b 0%, #122a5e 50%, #0e1e42 100%);
}
.login-box {
  position: relative;
  width: 400px; max-width: 94vw;
  background: rgba(255, 255, 255, .98);
  border-radius: 20px;
  padding: 44px 38px 36px;
  box-shadow: 0 28px 70px rgba(2, 8, 30, .55);
  animation: rise .45s cubic-bezier(.2, .8, .3, 1);
}
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
.login-box::before {
  content: ""; position: absolute; top: 0; left: 26px; right: 26px; height: 4px;
  border-radius: 0 0 6px 6px;
  background: linear-gradient(90deg, #38bdf8, #2563eb, #6366f1);
}
.login-box .login-brand {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-bottom: 4px;
}
.login-box .login-brand .logo-mark {
  width: 40px; height: 40px; border-radius: 11px;
  background: linear-gradient(135deg, #38bdf8, #2563eb);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  box-shadow: 0 8px 18px rgba(37, 99, 235, .35);
}
.login-box h2 { font-size: 21px; letter-spacing: 1px; }
.login-box .tip { text-align: center; color: var(--muted); font-size: 12px; letter-spacing: 2px; margin: 10px 0 30px; }

.form-item { margin-bottom: 18px; }
.form-item label { display: block; font-size: 13px; color: #334155; margin-bottom: 7px; font-weight: 500; }
.form-item input {
  width: 100%; height: 46px; padding: 0 14px;
  border: 1.5px solid var(--line); border-radius: 10px;
  font-size: 14px; outline: none; transition: border .2s, box-shadow .2s;
  background: #f8fafc;
}
.form-item input:focus {
  border-color: var(--brand); background: #fff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}
.btn-login {
  width: 100%; height: 48px; margin-top: 10px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff; border: none; border-radius: 12px;
  font-size: 16px; font-weight: 600; cursor: pointer; letter-spacing: 8px;
  box-shadow: 0 10px 24px rgba(37, 99, 235, .35);
  transition: transform .15s, box-shadow .2s, opacity .2s;
}
.btn-login:hover { box-shadow: 0 14px 30px rgba(37, 99, 235, .45); transform: translateY(-1px); }
.btn-login:active { transform: scale(.98); }
.login-error { color: #e11d48; font-size: 13px; text-align: center; min-height: 20px; margin-top: 12px; }
.login-back { display: block; text-align: center; margin-top: 16px; color: var(--brand); font-size: 13px; text-decoration: none; }
.login-back:hover { text-decoration: underline; }

/* ---------- 轻提示（两端共用） ---------- */
.qm-toast {
  position: fixed; top: 76px; left: 50%;
  transform: translateX(-50%) translateY(-14px);
  background: rgba(15, 23, 42, .88); color: #fff;
  padding: 10px 26px; border-radius: 24px;
  font-size: 14px; z-index: 9999;
  opacity: 0; transition: all .3s; pointer-events: none;
  box-shadow: 0 10px 28px rgba(2, 8, 30, .35);
  backdrop-filter: blur(6px);
}
.qm-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
