:root {
  --bg0: #0b1220;
  --bg1: #132038;
  --panel: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.12);
  --text: #e8eef8;
  --muted: #9bb0c9;
  --accent: #2f8cff;
  --accent2: #1f6fd1;
  --ok: #22c55e;
  --bad: #ef4444;
  --warn: #f59e0b;
  --radius: 14px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --bottom-nav: 56px;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(47, 140, 255, 0.25), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(34, 197, 94, 0.12), transparent 50%),
    linear-gradient(160deg, var(--bg0), var(--bg1));
  line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; }
.shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 18px 16px 40px;
}
.shell-fluid {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 8px 10px 20px;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.brand {
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 800;
  letter-spacing: 0.08em;
}
/* 登录/注册：HQ 顶部居中；登录框靠右且垂直居中 */
.auth-page {
  position: relative;
  min-height: 100vh;
  padding: 0;
}
.auth-brand-top {
  position: absolute;
  top: 28px;
  left: 0;
  right: 0;
  text-align: center;
  z-index: 2;
  pointer-events: none;
}
.auth-brand-top .brand {
  display: inline-block;
  margin: 0;
}
.auth-blank { display: none; }
.auth-side {
  position: absolute;
  right: clamp(16px, 6vw, 72px);
  top: 50%;
  transform: translateY(-50%);
  width: min(300px, calc(100% - 32px));
  z-index: 1;
}
.auth-box-compact {
  width: 100%;
  padding: 16px 14px;
}
.btn-sm {
  width: auto;
  min-width: 72px;
  padding: 8px 12px;
  font-size: 13px;
}
.row-actions-sm {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  justify-content: flex-start;
}
.portal-header { text-align: center; margin: 8px 0 22px; }
.portal-header .brand { margin-bottom: 6px; }
.project-list-clean { max-width: 420px; margin: 0 auto; }
.project-item-clean { justify-content: center; text-align: center; }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
.card { padding: 18px; }
.form-group { margin-bottom: 12px; }
.form-label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.required { color: var(--bad); }
.form-input, .form-select {
  width: 100%;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  outline: none;
}
.form-input:focus, .form-select:focus { border-color: var(--accent); }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 14px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 650;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; }
.btn-ghost { background: rgba(255,255,255,0.08); color: var(--text); border: 1px solid var(--line); }
.btn-ok { background: var(--ok); color: #fff; }
.btn-bad { background: var(--bad); color: #fff; }
.alert {
  margin: 10px 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  border: 1px solid transparent;
}
.alert-info { background: rgba(47,140,255,.12); border-color: rgba(47,140,255,.35); color: #cfe3ff; }
.alert-ok { background: rgba(34,197,94,.12); border-color: rgba(34,197,94,.35); color: #c7f5d6; }
.alert-bad { background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.35); color: #ffd0d0; }
.alert-warn { background: rgba(245,158,11,.12); border-color: rgba(245,158,11,.35); color: #ffe4b0; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 13px; }
.iframe-stage {
  position: fixed;
  inset: 0;
  background: var(--bg0);
  z-index: 50;
}
.iframe-stage iframe { width: 100%; height: 100%; border: 0; display: block; }
.iframe-stage.no-chrome .stage-bar { display: none; }
.stage-bar {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 60;
  display: flex;
  gap: 8px;
  align-items: center;
}
.stage-bar .btn { width: auto; padding: 8px 12px; font-size: 13px; }
.project-list { display: grid; gap: 10px; }
.project-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  cursor: pointer;
}
.project-item:hover { background: rgba(255,255,255,0.08); }
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  background: rgba(47,140,255,.2);
  color: #cfe3ff;
}
.badge-ok { background: rgba(34,197,94,.25); color: #c7f5d6; }

/* 手机底部菜单（类公众号） */
.bottom-nav {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: var(--bottom-nav);
  background: rgba(12, 18, 30, 0.96);
  border-top: 1px solid var(--line);
  z-index: 40;
  grid-template-columns: repeat(3, 1fr);
}
.bottom-nav button {
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
}
.bottom-nav button.active { color: var(--accent); }
.bottom-nav .ico { font-size: 16px; line-height: 1; }
.has-bottom-nav { padding-bottom: calc(var(--bottom-nav) + 16px); }

@media (max-width: 860px) {
  /* 手机：HQ 固定在视口最上方（安全区下），登录框在其下方，不再绝对叠在卡片里 */
  .auth-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: env(safe-area-inset-top, 0px) 12px calc(var(--bottom-nav) + 20px);
  }
  .auth-brand-top {
    position: static;
    flex: 0 0 auto;
    padding: 10px 0 6px;
    text-align: center;
  }
  .auth-side {
    position: static;
    right: auto;
    top: auto;
    transform: none;
    width: 100%;
    max-width: 360px;
    margin: 8px auto 0;
    flex: 0 0 auto;
  }
  .bottom-nav { display: grid; }
  .brand { font-size: 32px; letter-spacing: 0.12em; }
  .desktop-only { display: none !important; }
}
@media (min-width: 861px) {
  .mobile-only { display: none !important; }
}
