:root {
  --bg: #f4f7fc;
  --ink: #16233a;
  --ink-2: #4d5c75;
  --ink-3: #8792a6;
  --line: #e5eaf2;
  --blue: #2b7ef0;
  --blue-dark: #1c5fc4;
  --green: #07a86b;
  --amber: #a76b00;
  --amber-bg: #fff8e6;
  --red: #c0392b;
  --red-bg: #fdf0ee;
  --card: #ffffff;
  --radius: 16px;
  --shadow: 0 18px 50px rgba(23, 48, 91, 0.10);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Hiragino Sans GB", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 40%) 1fr;
}

/* ---------- 左侧品牌区 ---------- */
.brand {
  position: relative;
  padding: 64px 56px;
  color: #fff;
  background: linear-gradient(155deg, #0a4fb8 0%, #1e6ee0 48%, #3b9bf5 100%);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.brand::before {
  content: "";
  position: absolute;
  width: 520px; height: 520px;
  right: -230px; top: -180px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
}
.brand::after {
  content: "";
  position: absolute;
  width: 340px; height: 340px;
  left: -160px; bottom: -140px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
}
.brand > * { position: relative; z-index: 1; }
.brand-logo { margin-bottom: 26px; }
.brand h1 { margin: 0; font-size: 30px; font-weight: 650; letter-spacing: 1px; }
.brand-sub { margin: 10px 0 0; font-size: 15px; color: rgba(255, 255, 255, 0.78); }
.brand-divider { width: 42px; height: 3px; border-radius: 2px; background: rgba(255,255,255,.65); margin: 34px 0 30px; }
.feature-list { list-style: none; margin: 0; padding: 0; }
.feature-list li { display: flex; align-items: center; gap: 12px; font-size: 14px; color: rgba(255,255,255,.9); margin-bottom: 16px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #fff; flex: none; box-shadow: 0 0 0 4px rgba(255,255,255,.16); }
.brand-foot { margin-top: auto; font-size: 12px; color: rgba(255,255,255,.6); }

/* ---------- 右侧登录区 ---------- */
.stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
  gap: 18px;
}
.card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px 36px 26px;
}
.card-head { text-align: center; margin-bottom: 24px; }
.card-title { font-size: 22px; font-weight: 650; letter-spacing: .5px; }
.card-desc { margin-top: 9px; font-size: 13px; color: var(--ink-3); }

.qr-wrap { position: relative; min-height: 380px; display: flex; align-items: center; justify-content: center; }
.qr-panel { width: 320px; height: 380px; display: flex; align-items: center; justify-content: center; }
.qr-panel iframe { width: 320px; height: 380px; border: 0; }
.qr-loading {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; font-size: 13px; color: var(--ink-3);
  background: #fff;
}
.spinner { width: 26px; height: 26px; border: 2px solid var(--line); border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.fallback { text-align: center; padding: 8px 0 4px; }
.btn {
  width: 100%; height: 44px; border-radius: 9px; font-size: 14px; font-weight: 600;
  cursor: pointer; border: 1px solid transparent; transition: .18s ease;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-ghost { background: #f3f7ff; color: var(--blue-dark); border-color: #d8e7ff; }
.btn-ghost:hover { background: #e7f0ff; }
.hint { margin: 12px 0 0; font-size: 12px; color: var(--ink-3); line-height: 1.6; }

.notice {
  max-width: 420px; width: 100%;
  padding: 12px 16px; border-radius: 10px; font-size: 13px; line-height: 1.6;
  background: var(--amber-bg); color: var(--amber); border: 1px solid #f5e2b0;
}
.error {
  margin-top: 16px; padding: 11px 14px; border-radius: 9px; font-size: 13px; line-height: 1.6;
  background: var(--red-bg); color: var(--red); border: 1px solid #f6d6d1;
}
.setup { padding: 6px 0; }
.setup-title { font-size: 16px; font-weight: 650; margin-bottom: 8px; }
.setup-detail { font-size: 13px; color: var(--ink-2); line-height: 1.7; margin: 0 0 12px; }
.setup-code {
  margin: 0; padding: 14px; border-radius: 9px; background: #f6f8fc;
  border: 1px solid var(--line); color: #31405a; font-size: 12px; line-height: 1.7;
  white-space: pre-wrap; word-break: break-all;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
.mock-box { margin-top: 18px; text-align: center; }
.mock-qr {
  width: 220px; height: 220px; border: 2px dashed #cfdcf0; border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; color: var(--ink-3); font-size: 13px; background: #fafcff;
}
.mock-qr svg { opacity: .75; }

.card-foot {
  margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 12px; color: var(--ink-3); text-align: center; line-height: 1.6;
}
.card-foot svg { flex: none; color: var(--green); }
.stage-foot { font-size: 12px; color: var(--ink-3); margin: 0; text-align: center; }

/* ---------- 登录成功页 ---------- */
.topbar {
  height: 64px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; padding: 0 32px;
}
.topbar .tb-brand { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 650; }
.tb-logo { width: 28px; height: 28px; border-radius: 8px; background: var(--blue); color: #fff; display: grid; place-items: center; font-size: 13px; }
.btn-logout { height: 34px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); font-size: 13px; cursor: pointer; }
.btn-logout:hover { border-color: var(--blue); color: var(--blue); }
.home-main { max-width: 720px; margin: 48px auto; padding: 0 24px; }
.success-banner {
  display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-radius: 12px;
  background: #ecfaf3; border: 1px solid #c9efdd; color: #0b7c51; font-size: 14px; font-weight: 600;
}
.success-banner svg { flex: none; }
.profile { margin-top: 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; }
.profile-head { display: flex; align-items: center; gap: 18px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.avatar { width: 62px; height: 62px; border-radius: 16px; object-fit: cover; background: linear-gradient(135deg, #2b7ef0, #55b0ff); color: #fff; display: grid; place-items: center; font-size: 24px; font-weight: 600; flex: none; }
.profile-name { font-size: 20px; font-weight: 650; }
.profile-pos { margin-top: 5px; font-size: 13px; color: var(--ink-3); }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 12px 20px; padding-top: 22px; font-size: 13px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; color: var(--ink); word-break: break-all; font-family: "SFMono-Regular", Consolas, monospace; }
.next-box { margin-top: 20px; padding: 22px; border: 1px dashed #cfdcf0; border-radius: 12px; background: #fafcff; }
.next-box h3 { margin: 0 0 8px; font-size: 15px; }
.next-box p { margin: 0; font-size: 13px; line-height: 1.8; color: var(--ink-2); }
.next-box code { background: #eef3fb; padding: 2px 6px; border-radius: 4px; font-size: 12px; }

@media (max-width: 880px) {
  .page { grid-template-columns: 1fr; }
  .brand { padding: 32px 28px; }
  .brand-divider, .feature-list, .brand-foot { display: none; }
  .brand h1 { font-size: 22px; }
  .brand-logo { margin-bottom: 12px; }
  .brand-logo svg { width: 34px; height: 34px; }
  .stage { padding: 32px 20px; }
  .card { padding: 28px 24px 22px; }
  .topbar { padding: 0 20px; }
  .kv { grid-template-columns: 1fr; gap: 4px 0; }
  .kv dd { margin-bottom: 12px; }
}

[hidden] { display: none !important; }
