/* ============================================
   智序 ZhiXu — V2 Cinematic Glass Login
   Dark stage + glass card · 高端大气
   ============================================ */

:root {
  /* Brand (preserved) */
  --brand:        #1F3A5F;
  --brand-deep:   #0E2541;
  --brand-mid:    #2D5277;
  --accent:       #2D9D8F;
  --accent-deep:  #1D9E75;
  --accent-soft:  rgba(45,157,143,0.16);

  /* Functional */
  --warn:         #F0B147;
  --warn-soft:    rgba(240,177,71,0.16);
  --danger:       #E15555;
  --danger-soft:  rgba(225,85,85,0.18);

  /* Dark stage tokens */
  --stage-bg:     #081729;
  --stage-bg-2:   #0E2541;
  --text:         #FFFFFF;
  --text-dim:     rgba(255,255,255,0.65);
  --text-mute:    rgba(255,255,255,0.45);
  --text-faint:   rgba(255,255,255,0.28);
  --card-bg:      rgba(255,255,255,0.04);
  --card-border:  rgba(255,255,255,0.10);
  --input-bg:     rgba(255,255,255,0.05);
  --input-border: rgba(255,255,255,0.10);
  --hairline:     rgba(255,255,255,0.10);

  /* Type */
  --font-sans:    Inter, -apple-system, BlinkMacSystemFont, "PingFang SC",
                  "Microsoft YaHei UI", "Noto Sans SC", Helvetica, Arial, sans-serif;
  --font-serif:   "Noto Serif SC", "Source Han Serif SC", Georgia, serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Radii / shadows */
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-pill: 999px;
  --shadow-card: 0 32px 80px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.1);
  --shadow-btn:  0 8px 24px rgba(45,157,143,0.4);
}

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

html, body { height: 100%; }

body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--stage-bg);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

/* ============================================
   STAGE — full-bleed dark background
   ============================================ */
.stage {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(45,82,119,0.4) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(45,157,143,0.18) 0%, transparent 50%),
    linear-gradient(135deg, var(--stage-bg-2) 0%, var(--stage-bg) 100%);
  z-index: 0;
}
.stage svg.dots {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.18;
  pointer-events: none;
}

/* ============================================
   TOP BAR
   ============================================ */
.topbar {
  position: relative;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 56px;
}
.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  width: 40px;
  height: 40px;
  background: #FFFFFF;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.brand-text {
  line-height: 1.1;
}
.brand-text .line1 {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.brand-text .cn {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 19px;
  color: #FFFFFF;
  letter-spacing: -0.01em;
}
.brand-text .en {
  font-weight: 600;
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.18em;
}
.brand-text .sub {
  font-size: 10.5px;
  font-weight: 500;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 4px;
}

.topbar-right {
  display: flex;
  gap: 24px;
  align-items: center;
  font-size: 12.5px;
  color: var(--text-dim);
}
.topbar-status {
  display: flex;
  align-items: center;
  gap: 6px;
}
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: blink 2.4s infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.topbar-version {
  font-family: var(--font-mono);
  letter-spacing: 0.14em;
}
/* Language picker */
.lang-picker {
  position: relative;
}
.lang-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--card-border);
  border-radius: var(--r-pill);
  color: var(--text-dim);
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.18s;
  line-height: 1;
}
.lang-trigger:hover {
  background: rgba(255,255,255,0.09);
  color: var(--text);
  border-color: rgba(255,255,255,0.18);
}
.lang-picker.open .lang-trigger {
  background: rgba(255,255,255,0.09);
  color: var(--text);
  border-color: rgba(255,255,255,0.22);
}
.lang-glyph { font-size: 12px; opacity: 0.85; }
.lang-current { font-weight: 500; }
.lang-chev {
  font-size: 10px;
  opacity: 0.65;
  transition: transform 0.2s;
}
.lang-picker.open .lang-chev { transform: rotate(180deg); }

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  padding: 6px;
  background: rgba(14,37,65,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: var(--r-md);
  box-shadow: 0 16px 40px rgba(0,0,0,0.5);
  opacity: 0;
  transform: translateY(-4px) scale(0.98);
  transform-origin: top right;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 50;
}
.lang-picker.open .lang-menu {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.lang-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background 0.15s;
}
.lang-item:hover { background: rgba(255,255,255,0.06); }
.lang-item.active {
  background: var(--accent-soft);
}
.lang-item.active::after {
  content: '✓';
  margin-left: auto;
  color: var(--accent);
  font-weight: 700;
}
.lang-flag {
  font-size: 18px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}
.lang-name {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
}
.lang-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-mute);
  letter-spacing: 0.08em;
  margin-left: auto;
  padding-left: 12px;
}
.lang-item.active .lang-sub { display: none; }

/* ============================================
   STAGE LAYOUT — slogan left + card right
   ============================================ */
.scene {
  position: relative;
  z-index: 2;
  min-height: calc(100vh - 100px);
  display: grid;
  /* 列宽固定上限,grid 整体 justify-content: center 居中,
     大屏自然两侧留白而非被撑开 */
  grid-template-columns: minmax(0, 600px) minmax(0, 440px);
  justify-content: center;
  align-items: center;
  padding: 0 60px;
  gap: 80px;
}

/* HERO SLOGAN ----------- */
.hero {
  position: relative;
  max-width: 660px;
}
.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.26em;
  color: var(--accent);
  margin-bottom: 28px;
}
.hero-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(72px, 8.5vw, 108px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: #FFFFFF;
  text-shadow: 0 2px 32px rgba(0,0,0,0.45);
  margin: 0;
}
.hero-accent {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 36px;
}
.hero-accent-line {
  width: 60px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}
.hero-accent-text {
  font-size: 14px;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}
.hero-metrics {
  display: flex;
  gap: 48px;
  margin-top: 56px;
}
.hero-metric .n {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 26px;
  color: #FFFFFF;
  letter-spacing: -0.02em;
}
.hero-metric .l {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-mute);
  letter-spacing: 0.18em;
  margin-top: 6px;
  text-transform: uppercase;
}

/* GLASS CARD ----------- */
.card-col {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}
.glass-card {
  width: 100%;
  max-width: 440px;
  padding: 40px 40px 32px;
  border-radius: var(--r-lg);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  box-shadow: var(--shadow-card);
  position: relative;
}
.glass-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--r-lg);
  pointer-events: none;
  background: linear-gradient(160deg, rgba(255,255,255,0.06) 0%, transparent 40%);
}

.card-eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  color: var(--accent);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 28px;
  line-height: 1.18;
  letter-spacing: -0.02em;
  color: #FFFFFF;
  margin: 0;
}
.card-subtitle {
  margin-top: 8px;
  font-size: 13.5px;
  color: var(--text-dim);
}

/* form fields */
.fields {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--text-mute);
  text-transform: uppercase;
}
.input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--r-md);
  transition: all 0.18s;
}
.input-wrap:focus-within {
  border-color: var(--accent);
  background: rgba(255,255,255,0.07);
  box-shadow: 0 0 0 3px rgba(45,157,143,0.18);
}
.input-wrap.error {
  border-color: var(--danger);
  background: rgba(225,85,85,0.08);
  animation: shake 0.4s;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}
.input-wrap .lead {
  opacity: 0.55;
  font-size: 14px;
  user-select: none;
}
.input-wrap input,
.input-wrap select {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: #FFFFFF;
  font-size: 14px;
  font-family: inherit;
  min-width: 0;
}
.input-wrap input::placeholder { color: var(--text-faint); }
.input-wrap select { color: #FFFFFF; cursor: pointer; }
.input-wrap select option { background: var(--stage-bg-2); color: #FFFFFF; }
.input-wrap input[type="password"] { letter-spacing: 0.18em; }
.input-wrap .trail {
  cursor: pointer;
  opacity: 0.55;
  font-size: 14px;
  transition: opacity 0.15s;
}
.input-wrap .trail:hover { opacity: 0.95; }

/* captcha */
.captcha-row { display: flex; gap: 10px; }
.captcha-row .input-wrap { flex: 1; }
.captcha-block {
  width: 100px;
  height: 44px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.2em;
  cursor: pointer;
  font-style: italic;
  transition: all 0.2s;
  user-select: none;
}
.captcha-block:hover {
  border-color: var(--accent);
  background: rgba(45,157,143,0.12);
}
.captcha-block:active { transform: scale(0.97); }

/* check + forgot row */
.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  font-size: 12.5px;
}
.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
}
.check input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
  cursor: pointer;
}
.link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
}
.link:hover { text-decoration: underline; }
.link-muted {
  color: var(--text-dim);
  text-decoration: none;
}
.link-muted:hover { color: var(--text); }

/* primary button */
.btn {
  padding: 13px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.18s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
}
.btn:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.18);
}
.btn.primary {
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: #FFFFFF;
  border-color: transparent;
  box-shadow: var(--shadow-btn);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.btn.primary:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}
.btn.large {
  width: 100%;
  padding: 14px 16px;
  font-size: 14.5px;
  margin-top: 16px;
}
.btn.loading {
  color: transparent !important;
  pointer-events: none;
}
.btn.loading::after {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  width: 16px; height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.btn:not(.primary).loading::after {
  border-color: rgba(255,255,255,0.15);
  border-top-color: var(--accent);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* divider */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 14px;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--hairline);
}
.divider span {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-mute);
  letter-spacing: 0.2em;
}

/* SSO */
.sso-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.sso-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 6px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--r-md);
  cursor: pointer;
  font-size: 12.5px;
  color: var(--text-dim);
  font-family: inherit;
  transition: all 0.18s;
  position: relative;
}
.sso-btn:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text);
  border-color: rgba(255,255,255,0.2);
}
.sso-btn .icon {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sso-btn.loading { pointer-events: none; opacity: 0.7; }
.sso-btn.loading .icon, .sso-btn.loading span { visibility: hidden; }
.sso-btn.loading::after {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  width: 14px; height: 14px;
  margin: -7px 0 0 -7px;
  border: 2px solid rgba(255,255,255,0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* card footer */
.card-foot {
  text-align: center;
  margin-top: 22px;
  font-size: 12.5px;
  color: var(--text-mute);
}
.card-foot .link { font-weight: 500; }

/* ============================================
   STATE SWITCHING — login / register
   ============================================ */
.state { display: none; }
.state.active { display: block; animation: fade 0.3s ease; }
@keyframes fade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* register header */
.reg-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.reg-head h2 {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: -0.02em;
  color: #FFFFFF;
  margin: 0;
}

.steps {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 0 22px;
}
.step {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  color: var(--text-mute);
  border: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 700;
  transition: all 0.3s;
  flex-shrink: 0;
}
.step.active .step-num,
.step.done .step-num {
  background: var(--accent);
  color: #FFFFFF;
  border-color: var(--accent);
}
.step.done .step-num::before { content: '✓'; }
.step.done .step-num span { display: none; }
.step-text {
  font-size: 11px;
  color: var(--text-mute);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.step.active .step-text { color: var(--text); font-weight: 600; }
.step.done .step-text { color: var(--accent); }
.step-line {
  flex: 1;
  min-width: 8px;
  height: 1px;
  background: var(--hairline);
  transition: background 0.3s;
}
.step-line.done { background: var(--accent); }

/* In 4-step mode, only show label of active step to save horizontal room */
.steps[data-count="4"] .step:not(.active) .step-text { display: none; }

.req { color: var(--danger); margin-left: 2px; }

/* Step hint (above each register step) */
.step-hint {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 20px;
  background: rgba(45,157,143,0.08);
  border: 1px solid rgba(45,157,143,0.18);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-md);
}
.step-hint-num {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.04em;
  flex-shrink: 0;
  padding-top: 1px;
}
.step-hint-text {
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.5;
}
.step-hint-text strong {
  color: var(--text);
  font-weight: 600;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.grid-2 > * { min-width: 0; }
.field { min-width: 0; }
.input-wrap { min-width: 0; }

/* password strength */
.pw-strength {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.pw-bar {
  flex: 1;
  min-width: 0;
  height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
}
.pw-fill {
  height: 100%;
  width: 0%;
  background: var(--danger);
  transition: width 0.3s, background 0.3s;
}
.pw-fill.weak   { width: 33%; background: var(--danger); }
.pw-fill.medium { width: 66%; background: var(--warn); }
.pw-fill.strong { width: 100%; background: var(--accent); }
.pw-text {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-mute);
  min-width: 0;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.pw-text.weak   { color: var(--danger); }
.pw-text.medium { color: var(--warn); }
.pw-text.strong { color: var(--accent); }

/* OTP */
.otp-info {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--accent-soft);
  border: 1px solid rgba(45,157,143,0.25);
  border-radius: var(--r-md);
  margin-bottom: 22px;
}
.otp-info .icon { font-size: 22px; }
.otp-info .t { font-size: 12px; color: var(--text-dim); margin-bottom: 2px; }
.otp-info .phone {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 600;
  color: #FFFFFF;
  letter-spacing: 0.06em;
}
.otp-row {
  display: grid;
  /* V0.6.5 #19 fix: minmax(0, 1fr) 强制 grid item 可 shrink 到 0
     不带 minmax 时 input default min-content (~150px) 撑爆 6 cell = 900px */
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}
.otp-cell {
  height: 48px;
  min-width: 0;   /* V0.6.5 #19 核心 fix: 重置 input default min-content 让 grid 真 shrink */
  box-sizing: border-box;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  border-radius: var(--r-md);
  text-align: center;
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: #FFFFFF;
  outline: none;
  transition: all 0.15s;
  padding: 0;     /* 防 default padding 偏数字 */
}
.otp-cell:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(45,157,143,0.18);
}
.otp-cell.filled {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.otp-cell.error {
  border-color: var(--danger);
  background: rgba(225,85,85,0.12);
  animation: shake 0.4s;
}
.otp-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--text-mute);
}

/* success */
.success-wrap { text-align: center; padding: 8px 0; }
.success-circle {
  width: 64px; height: 64px;
  margin: 0 auto 16px;
  background: var(--accent-soft);
  border: 1px solid rgba(45,157,143,0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 28px;
  animation: pop 0.6s cubic-bezier(0.16,1,0.3,1);
}
@keyframes pop {
  0% { transform: scale(0.3); opacity: 0; }
  60% { transform: scale(1.1); }
  100% { transform: scale(1); }
}
.success-title {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.success-desc { font-size: 12.5px; color: var(--text-dim); margin-bottom: 18px; }
.next-box {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--card-border);
  border-radius: var(--r-md);
  padding: 14px 16px;
  text-align: left;
}
.next-title { font-size: 11px; color: var(--text-mute); font-family: var(--font-mono); letter-spacing: 0.18em; margin-bottom: 10px; text-transform: uppercase; }
.next-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
  font-size: 12.5px;
  color: var(--text-dim);
}
.next-item .ic { font-size: 14px; }

/* ============================================
   GLOBAL FOOTER + MODE SWITCHER
   ============================================ */
.global-footer {
  position: fixed;
  bottom: 18px;
  left: 0; right: 0;
  display: flex;
  justify-content: center;
  gap: 24px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-faint);
  letter-spacing: 0.14em;
  z-index: 5;
}
.global-footer a { color: inherit; text-decoration: none; }
.global-footer a:hover { color: var(--text-dim); }

.mode-switcher {
  position: fixed;
  top: 18px;
  right: 16px;
  z-index: 1000;
  background: rgba(8,23,41,0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  border-radius: var(--r-sm);
  padding: 6px;
  display: none; /* hidden by default — shown only in demo */
  gap: 4px;
  align-items: center;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.mode-switcher.visible { display: flex; }
.mode-label {
  font-size: 10.5px;
  color: var(--text-mute);
  padding: 0 8px 0 4px;
  font-weight: 500;
}
.mode-btn {
  padding: 5px 9px;
  border-radius: 5px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 11.5px;
  cursor: pointer;
  font-family: inherit;
}
.mode-btn.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
.mode-btn:hover:not(.active) {
  background: rgba(255,255,255,0.06);
  color: var(--text);
}

/* demo toggle (small dot bottom-right) */
.demo-toggle {
  position: fixed;
  bottom: 50px;
  right: 16px;
  z-index: 1000;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(8,23,41,0.7);
  border: 1px solid var(--card-border);
  cursor: pointer;
  font-size: 11px;
  color: var(--text-mute);
  display: flex;
  align-items: center;
  justify-content: center;
}
.demo-toggle:hover { color: var(--text); }

/* ============================================
   DEPLOYMENT MODE — visibility rules
   ============================================ */
.saas-only, .private-only, .offline-only { display: none; }
body[data-deploy="saas"] .saas-only { display: revert; }
body[data-deploy="saas"] .saas-only-grid { display: grid; }
body[data-deploy="saas"] .saas-only-flex { display: flex; }
body[data-deploy="private-online"] .private-only,
body[data-deploy="private-online"] .private-only-flex { display: flex; }
body[data-deploy="private-online"] .saas-only-grid { display: grid; }
body[data-deploy="private-online"] .saas-only-flex { display: flex; }
body[data-deploy="private-offline"] .offline-only,
body[data-deploy="private-offline"] .offline-only-flex { display: flex; }
body[data-deploy="private-offline"] .online-feature { display: none !important; }

/* ============================================
   AI GREETING OVERLAY
   ============================================ */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(8,23,41,0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.3s;
}
.overlay.show {
  display: flex;
  opacity: 1;
}
.greeting-card {
  background: rgba(20,40,68,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: var(--r-lg);
  padding: 32px;
  width: 90%;
  max-width: 480px;
  box-shadow: var(--shadow-card);
  transform: scale(0.95);
  transition: transform 0.3s;
}
.overlay.show .greeting-card { transform: scale(1); }

.greet-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.ai-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  border: 1px solid rgba(45,157,143,0.3);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
}
.greet-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 18px;
  color: #FFFFFF;
  letter-spacing: -0.01em;
}
.greet-sub {
  font-size: 12px;
  color: var(--text-mute);
  margin-top: 2px;
}
.greet-body {
  font-size: 13.5px;
  color: var(--text-dim);
  line-height: 1.7;
  margin-bottom: 18px;
}
.greet-summary {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--card-border);
  border-radius: var(--r-md);
  padding: 16px 18px;
  margin-bottom: 22px;
}
.summary-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  font-size: 13px;
}
.summary-row .n {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  min-width: 36px;
  letter-spacing: -0.02em;
}
.summary-row .n.warn   { color: var(--warn); }
.summary-row .n.danger { color: var(--danger); }
.summary-row .t { color: var(--text-dim); flex: 1; }

.greet-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ============================================
   SSO AUTHORIZATION MODAL
   ============================================ */
.sso-modal-card {
  width: 90%;
  max-width: 420px;
  background: rgba(20,40,68,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transform: scale(0.95);
  transition: transform 0.3s;
}
.overlay.show .sso-modal-card { transform: scale(1); }

.sso-modal-header {
  position: relative;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #07C160; /* default, JS overrides */
  color: #FFFFFF;
}
.sso-modal-provider { display: flex; align-items: center; gap: 12px; }
.sso-modal-providerIcon {
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.18);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sso-modal-providerName {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.sso-modal-providerSub {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.75);
  margin-top: 2px;
}
.sso-modal-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  transition: background 0.18s;
}
.sso-modal-close:hover { background: rgba(255,255,255,0.3); }

.sso-modal-body {
  padding: 22px;
}

.sso-modal-app {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--card-border);
  border-radius: var(--r-md);
  margin-bottom: 20px;
}
.sso-modal-appLogo {
  width: 36px;
  height: 36px;
  background: #FFFFFF;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sso-modal-appName {
  font-size: 13.5px;
  font-weight: 600;
  color: #FFFFFF;
  letter-spacing: -0.01em;
}
.sso-modal-appScope {
  font-size: 11.5px;
  color: var(--text-mute);
  margin-top: 2px;
}

.sso-qr-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.sso-qr {
  position: relative;
  width: 168px;
  height: 168px;
  background: #FFFFFF;
  border-radius: var(--r-md);
  padding: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.sso-qr svg { display: block; }
.sso-qr-mask {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.96);
  border-radius: var(--r-md);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  animation: fade 0.3s ease;
}
.sso-qr-mask.show { display: flex; }
.sso-qr-mask-icon {
  width: 48px;
  height: 48px;
  background: var(--accent);
  color: #FFFFFF;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  animation: pop 0.5s cubic-bezier(0.16,1,0.3,1);
}
.sso-qr-mask-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-deep);
}

.sso-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-dim);
}
.sso-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: blink 1.8s infinite;
}
.sso-status.scanned .sso-status-dot {
  background: var(--warn);
}
.sso-status.success .sso-status-dot {
  background: var(--accent);
  animation: none;
}

.sso-modal-foot {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.sso-modal-disclaimer {
  font-size: 11px;
  color: var(--text-mute);
  text-align: center;
  line-height: 1.5;
  padding-top: 12px;
  border-top: 1px solid var(--hairline);
}

/* ============================================
   REGISTER TRANSITION
   ============================================ */
.rt-overlay {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 30%, rgba(45,157,143,0.3) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 70%, rgba(45,82,119,0.5) 0%, transparent 60%),
    linear-gradient(135deg, var(--stage-bg-2) 0%, var(--stage-bg) 100%);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 5000;
  opacity: 0;
  transition: opacity 0.4s;
  overflow: hidden;
}
.rt-overlay.show { display: flex; opacity: 1; }
.rt-content {
  position: relative;
  text-align: center;
  color: #FFFFFF;
  animation: rt-in 0.5s cubic-bezier(0.16,1,0.3,1);
}
@keyframes rt-in {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.rt-logo {
  width: 72px;
  height: 72px;
  margin: 0 auto 22px;
  background: #FFFFFF;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(45,157,143,0.4);
  animation: rt-logo 2s ease-in-out infinite;
}
@keyframes rt-logo {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
.rt-spinner {
  width: 36px;
  height: 36px;
  margin: 0 auto 18px;
  border: 3px solid rgba(255,255,255,0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.rt-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
  margin-bottom: 32px;
  min-height: 26px;
  transition: opacity 0.3s;
}
.rt-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 320px;
  margin: 0 auto;
}
.rt-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--card-border);
  border-radius: var(--r-md);
  font-size: 12.5px;
  color: var(--text-mute);
  text-align: left;
  transition: all 0.4s;
}
.rt-step.active {
  background: var(--accent-soft);
  border-color: rgba(45,157,143,0.4);
  color: #FFFFFF;
  transform: translateX(4px);
}
.rt-step.done {
  background: rgba(45,157,143,0.12);
  color: var(--text-dim);
}
.rt-step.done .rt-icon::before {
  content: '✓';
  color: var(--accent);
  font-weight: 700;
}
.rt-step.done .rt-icon span { display: none; }
.rt-icon { width: 18px; text-align: center; font-size: 13px; }

/* ============================================
   TOAST
   ============================================ */
.toast-stack {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  align-items: center;
}
.toast {
  background: rgba(20,40,68,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-sm);
  padding: 10px 14px 10px 12px;
  min-width: 240px;
  max-width: 380px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #FFFFFF;
  pointer-events: auto;
  transform: translateY(-16px);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.16,1,0.3,1), opacity 0.3s;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-left-color: var(--accent); }
.toast.error   { border-left-color: var(--danger); }
.toast.warn    { border-left-color: var(--warn); }
.toast.info    { border-left-color: var(--brand-mid); }
.toast-icon {
  width: 18px; height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #FFFFFF;
  flex-shrink: 0;
}
.toast.success .toast-icon { background: var(--accent); }
.toast.error .toast-icon   { background: var(--danger); }
.toast.warn .toast-icon    { background: var(--warn); }
.toast.info .toast-icon    { background: var(--brand-mid); }
.toast-msg { flex: 1; line-height: 1.4; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1280px) {
  /* 1280 以下: 列宽 + gap + padding 同步缩,保证 600+80+440+60*2=1240 不溢出 */
  .scene {
    grid-template-columns: minmax(0, 540px) minmax(0, 400px);
    gap: 60px;
    padding: 0 40px;
  }
}
@media (max-width: 1100px) {
  .scene {
    grid-template-columns: minmax(0, 480px) minmax(0, 380px);
    gap: 48px;
    padding: 0 32px;
  }
  .hero-metrics { gap: 32px; }
}

@media (max-width: 880px) {
  .scene {
    grid-template-columns: 1fr;
    padding: 80px 24px 40px;
    gap: 40px;
    min-height: auto;
  }
  .hero-title { font-size: 56px; }
  .hero-metrics { gap: 24px; flex-wrap: wrap; }
  .card-col { justify-content: center; }
  .glass-card { max-width: 100%; }
  .topbar { padding: 20px 24px; }
  .topbar-right { gap: 12px; }
  .topbar-status { display: none; }
  .global-footer { display: none; }
  .mode-switcher { top: auto; bottom: 12px; right: 12px; left: 12px; justify-content: center; }
  .mode-label { display: none; }
}
