/* ===== 主页面一：开屏 + 登录 ===== */
.splash {
  position: fixed; inset: 0; z-index: 2; overflow-x: hidden; overflow-y: auto;
  display: grid; grid-template-rows: auto minmax(min-content, 1fr) auto;
}
.splash-scrim {
  position: fixed; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 44% 54% at 19% 58%, rgba(248, 251, 253, .9) 0%, rgba(248, 251, 253, .7) 42%, rgba(248, 251, 253, 0) 82%),
    linear-gradient(90deg, rgba(248, 251, 253, .55) 0%, rgba(248, 251, 253, .24) 34%, rgba(248, 251, 253, 0) 52%),
    linear-gradient(180deg, rgba(251, 253, 254, .75) 0%, rgba(251, 253, 254, 0) 26%);
}

/* top HUD */
.hud-top {
  position: relative; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: clamp(14px, 3.6vh, 28px) clamp(20px, 4.2vw, 64px) 0;
}
.brand { display: inline-flex; align-items: center; gap: 14px; border-radius: 10px; }
.hud-meta { display: flex; align-items: center; font-size: 12px; color: var(--text-lo); letter-spacing: .14em; white-space: nowrap; }
.hud-meta .clock { color: var(--text-md); min-width: 8ch; text-align: right; }

/* left ruler */
.hud-ruler {
  position: fixed; left: clamp(10px, 1.6vw, 26px); top: 22vh; bottom: 22vh; width: 12px; pointer-events: none; z-index: 2;
  background:
    repeating-linear-gradient(180deg, rgba(71, 84, 103, .3) 0 1px, transparent 1px 8px) left top / 5px 100% no-repeat,
    repeating-linear-gradient(180deg, rgba(71, 84, 103, .58) 0 1px, transparent 1px 40px) left top / 11px 100% no-repeat;
  display: flex; flex-direction: column; justify-content: space-between;
}
.hud-ruler span { font-size: 10.5px; line-height: 1; color: var(--text-lo); transform: translate(17px, -40%); letter-spacing: .1em; }

/* live instrument readout (top right) */
.hud-readout {
  position: absolute; z-index: 3; top: clamp(150px, 22vh, 260px); right: clamp(20px, 4.2vw, 64px); width: 268px;
  font-size: 11px; letter-spacing: .14em; color: var(--text-lo); pointer-events: none;
  transition: opacity .4s var(--ease), transform .6s var(--ease-out);
}
.ro-head { display: flex; align-items: center; gap: 10px; color: var(--text-lo); padding-bottom: 10px; }
.ro-head i { flex: 1; height: 1px; background: linear-gradient(90deg, var(--hairline-2), transparent); }
.ro-head b { font-weight: 500; color: var(--mint-700); display: inline-flex; align-items: center; gap: 6px; }
.ro-head b::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--mint-400); box-shadow: 0 0 8px rgba(var(--mint-rgb), .65); animation: ro-blink 1.6s ease-in-out infinite; }
@keyframes ro-blink { 50% { opacity: .25; } }
.hud-readout dl { margin: 0; border-top: 1px solid var(--hairline); }
.hud-readout dl > div { display: flex; justify-content: space-between; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--hairline); }
.hud-readout dt { color: var(--text-lo); }
.hud-readout dd { margin: 0; color: var(--text-md); font-variant-numeric: tabular-nums; letter-spacing: .08em; }
.ro-bar { position: relative; height: 2px; margin-top: 10px; background: rgba(15, 27, 45, .08); overflow: hidden; }
.ro-bar i { position: absolute; inset: 0; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, rgba(var(--mint-rgb), .4), var(--mint-400)); transition: transform .12s linear; }
.login-open .hud-readout { opacity: 0; transform: translateY(-8px); }
@media (max-width: 1099px), (max-height: 640px) { .hud-readout { display: none; } }

/* hero */
.splash-body {
  position: relative; z-index: 3; display: flex; align-items: center; align-items: safe center;
  padding: 0 clamp(20px, 4.2vw, 64px) 0 clamp(36px, 7.2vw, 128px);
}
.hero {
  width: min(640px, 100%); padding: clamp(10px, 3.5vh, 40px) 0 clamp(14px, 5vh, 60px);
  transform-origin: 0% 50%;
  transition: transform .7s var(--ease-out), opacity .5s var(--ease), filter .5s var(--ease);
}
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: 12.5px; letter-spacing: .24em; color: var(--text-md); }
.eyebrow .br { color: rgba(var(--mint-rgb), 1); font-size: 15px; letter-spacing: 0; }
.hero-title { position: relative; margin-top: clamp(10px, 2.2vh, 22px); display: flex; flex-direction: column; gap: clamp(6px, 1.4vh, 14px); font-family: var(--font-cn); }
.hero-title::before {
  content: ''; position: absolute; z-index: -1; left: -8%; top: -28%; width: 86%; height: 120%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(var(--blue-rgb), .05), rgba(var(--blue-rgb), 0));
}
.t-main {
  display: block; overflow: hidden; padding-bottom: .06em;
  font-size: clamp(46px, min(6.6vw, 11.2vh), 108px); font-weight: 700; line-height: 1.04; letter-spacing: .05em;
}
.t-main > span {
  display: inline-block;
  background: linear-gradient(180deg, #0B1628 0%, #15305A 46%, #2563EB 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.t-sub { display: flex; align-items: center; gap: 16px; font-size: clamp(16px, min(1.65vw, 2.8vh), 26px); font-weight: 500; letter-spacing: .48em; color: var(--text-md); white-space: nowrap; }
.t-rule { width: 44px; height: 1.5px; flex: none; background: linear-gradient(90deg, var(--mint-400), rgba(var(--mint-rgb), 0)); }
.hero-tagline { margin-top: clamp(14px, 3.2vh, 30px); font-size: clamp(18px, 1.45vw, 21px); font-weight: 600; color: var(--text-hi); letter-spacing: .06em; font-family: var(--font-cn); }
.hero-intro { margin-top: clamp(6px, 1.2vh, 12px); max-width: 34em; font-size: 15.5px; line-height: 1.85; color: var(--text-md); font-family: var(--font-cn); }
.hero-tags { margin-top: clamp(12px, 2.3vh, 22px); display: flex; flex-wrap: wrap; gap: 10px; }
.hero-tags li {
  display: inline-flex; align-items: center; gap: 10px; height: 34px; padding: 0 14px 0 12px; border-radius: 9px;
  font-size: 14.5px; color: var(--text-hi); font-family: var(--font-cn);
  background: rgba(255, 255, 255, .9); box-shadow: 0 0 0 1px var(--hairline-2) inset;
}
.hero-tags .mono { font-size: 11.5px; color: var(--mint-700); letter-spacing: .08em; }
.hero-cta { margin-top: clamp(18px, 3.8vh, 36px); display: flex; align-items: center; gap: 20px; flex-wrap: wrap; min-height: 56px; transition: opacity .35s var(--ease), transform .5s var(--ease-out); }
.kbd-hint { font-size: 11.5px; letter-spacing: .18em; color: var(--text-lo); display: inline-flex; align-items: center; gap: 8px; }
.cta-login { min-width: 210px; }
.cta-login::after {
  content: ''; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, .55) 50%, transparent 65%) -150% 0 / 250% 100% no-repeat;
  mix-blend-mode: soft-light; animation: cta-sheen 5.2s 1s var(--ease-in-out) infinite;
}
@keyframes cta-sheen { 0% { background-position: -150% 0; } 26%, 100% { background-position: 150% 0; } }

/* welcome back card */
.welcome {
  position: relative; display: grid; grid-template-columns: auto 1fr; gap: 14px 16px; align-items: center;
  width: min(100%, 470px); padding: 20px 22px; border-radius: var(--r-lg);
  background: linear-gradient(160deg, rgba(255, 255, 255, .94), rgba(248, 250, 252, .9));
  box-shadow: 0 0 0 1px var(--hairline-2) inset, var(--shadow-2);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.wc-avatar {
  position: relative; width: 58px; height: 58px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: conic-gradient(from 210deg, rgba(var(--mint-rgb), .9), rgba(var(--azure-rgb), .5), rgba(var(--mint-rgb), .1), rgba(var(--mint-rgb), .9));
  padding: 2px;
}
.wc-avatar span {
  width: 100%; height: 100%; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 30% 25%, #FFFFFF, var(--mint-50) 75%); font-size: 23px; font-weight: 700; color: var(--mint-700);
}
.wc-name { font-size: 20px; font-weight: 700; line-height: 1.35; margin-top: 4px; font-family: var(--font-cn); }
.wc-acc { font-size: 13px; color: var(--text-lo); }
.wc-actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-top: 6px; }
.wc-actions .btn--primary { grid-column: 1 / -1; }
.wc-actions .btn--ghost { --bh: 40px; font-size: 14.5px; font-weight: 500; }
.wc-actions .btn--ghost .ico { color: var(--text-lo); transition: color var(--t-fast); }
.wc-actions .btn--ghost:hover .ico { color: var(--blue-600); }
.wc-actions [data-action="logout"]:hover { background: rgba(var(--coral-rgb), .08); box-shadow: 0 0 0 1px rgba(var(--coral-rgb), .4) inset; color: #B42318; }
.wc-actions [data-action="logout"]:hover .ico { color: var(--coral-400); }
/* first start, no administrator yet: same card, notice tone */
.welcome--notice { grid-template-columns: auto 1fr; }
.welcome--notice .hud-corner { border-color: rgba(var(--amber-rgb), .75); }
.wc-avatar--notice { background: conic-gradient(from 210deg, rgba(var(--amber-rgb), .85), rgba(var(--blue-rgb), .45), rgba(var(--amber-rgb), .12), rgba(var(--amber-rgb), .85)); }
.wc-avatar--notice span { background: radial-gradient(circle at 30% 25%, #FFFFFF, #FFF4E5 78%); color: var(--amber-700); }
.welcome--notice .eyebrow-sm { color: var(--amber-700); }
.welcome--notice .wc-name { font-size: 18px; }
.welcome--notice .wc-acc { font-family: var(--font-cn); font-size: 13.5px; color: var(--text-md); margin-top: 2px; }

/* login panel */
.login-panel {
  position: absolute; z-index: 5; top: 50%; right: clamp(20px, 6.4vw, 120px);
  width: min(424px, calc(100vw - 40px)); padding: 0; border-radius: var(--r-xl);
  background: linear-gradient(165deg, rgba(255, 255, 255, .9) 0%, rgba(250, 252, 254, .8) 100%);
  box-shadow: 0 0 0 1px var(--hairline-2) inset, 0 40px 100px -30px rgba(16, 24, 40, .3), 0 0 0 1px rgba(255, 255, 255, .7);
  -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%);
  opacity: 0; visibility: hidden; transform: translate(36px, -50%) scale(.985);
  transition: opacity .38s var(--ease), transform .62s var(--ease-out), visibility 0s linear .62s;
}
.login-open .login-panel { opacity: 1; visibility: visible; transform: translate(0, -50%); transition: opacity .42s var(--ease) .06s, transform .66s var(--ease-out), visibility 0s; }
/* the panel never leaves the safe zone between the top HUD and the footer: if it would,
   its content scrolls inside (corner brackets stay on the outer box) */
.lp-scroll { padding: 30px 30px 24px; max-height: calc(100vh - 148px); max-height: calc(100dvh - 148px); overflow-y: auto; overscroll-behavior: contain; border-radius: inherit; }
.lp-scan {
  position: absolute; left: 0; right: 0; top: 0; height: 1px; pointer-events: none; opacity: 0;
  background: linear-gradient(90deg, transparent, rgba(var(--mint-rgb), .9), transparent);
}
.login-open .lp-scan { animation: lp-scan 1.1s .1s var(--ease-in-out) both; }
@keyframes lp-scan { 0% { opacity: 0; transform: translateY(0); } 15% { opacity: 1; } 100% { opacity: 0; transform: translateY(520px); } }
.lp-head { position: relative; padding-right: 40px; }
.lp-head h2 { margin-top: 10px; font-size: 26px; font-weight: 700; line-height: 1.25; font-family: var(--font-cn); }
.lp-sub { margin-top: 6px; font-size: 14.5px; color: var(--text-md); font-family: var(--font-cn); }
.lp-close { position: absolute; top: -8px; right: -10px; }
.lp-form { margin-top: 24px; display: flex; flex-direction: column; gap: 18px; }
.pw-toggle { width: 34px; height: 34px; margin-right: -6px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; color: var(--text-lo); transition: color var(--t-fast), background-color var(--t-fast); }
.pw-toggle:hover { color: var(--text-hi); background: rgba(15, 27, 45, .06); }
.caps-hint { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--amber-400); }
.form-error {
  display: flex; align-items: center; gap: 10px; min-height: 0; max-height: 0; overflow: hidden; opacity: 0;
  padding: 0 14px; border-radius: 12px; font-size: 14.5px; font-weight: 600; color: #B42318;
  background: rgba(var(--coral-rgb), .07); box-shadow: 0 0 0 1px rgba(var(--coral-rgb), .3) inset;
  transition: max-height .3s var(--ease), opacity .25s var(--ease), padding .3s var(--ease), margin .3s var(--ease);
  margin: -9px 0;
}
.form-error.is-on { max-height: 80px; opacity: 1; padding: 11px 14px; margin: 0; }
.form-error .ico { color: var(--coral-400); }
.lp-submit { margin-top: 4px; overflow: hidden; }
.lp-submit .spinner, .lp-submit .okmark { position: absolute; left: 18px; top: 50%; opacity: 0; transform: translateY(-50%) scale(.6); transition: opacity .2s, transform .3s var(--ease-out); }
.lp-submit .spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); border-top-color: var(--text-on-brand); animation: spin .7s linear infinite; }
.lp-submit.is-loading .spinner { opacity: 1; transform: translateY(-50%) scale(1); }
.lp-submit.is-loading .go, .lp-submit.is-success .go { opacity: 0; }
.lp-submit.is-success .okmark { opacity: 1; transform: translateY(-50%) scale(1); }
.lp-submit.is-success { background: linear-gradient(180deg, #17B08C, #0C8D6E); }
@keyframes spin { to { transform: translateY(-50%) rotate(360deg); } }
.lp-foot {
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--hairline);
  display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-lo); font-family: var(--font-cn);
}
.lp-foot .ico { color: var(--text-lo); }

/* staggered field entrance when the panel opens */
.lp-st { opacity: 0; transform: translateY(10px); transition: opacity .3s var(--ease), transform .45s var(--ease-out); }
.login-open .lp-st { opacity: 1; transform: none; transition-delay: calc(.12s + var(--s) * .055s); }

/* hero yields when the panel opens */
.login-open .hero { transform: translateX(-1.2vw) scale(.965); opacity: .2; filter: saturate(.5) blur(1.5px); }
.login-open .hero-cta { opacity: 0; transform: translateY(8px); pointer-events: none; }

/* bottom HUD */
.hud-bottom {
  position: relative; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 12px clamp(20px, 4.2vw, 64px) clamp(12px, 3vh, 24px); font-size: 13px; color: var(--text-lo); font-family: var(--font-cn);
}
.hud-bottom .hint { display: inline-flex; align-items: center; gap: 8px; color: var(--text-lo); }
.hud-bottom .hint .ico { color: var(--mint-700); }

/* ----- intro choreography ----- */
.splash.is-intro .rv { animation: rv-in .62s var(--ease-out) both; animation-delay: var(--d, 0s); }
.splash.is-intro .rv-mask > span { animation: rv-mask .8s var(--ease-out) both; animation-delay: var(--d, 0s); }
/* The login button must be visible and clickable at once (≤1s even on slow PCs):
   it is fully opaque from the first frame and only slides/glows in. */
.splash.is-intro .hero-cta { animation: cta-in .7s var(--ease-out) both; }
.splash.is-intro .cta-login { animation: cta-glow 1.4s var(--ease-out) .1s both; }
@keyframes cta-in { from { transform: translateY(10px); } to { transform: none; } }
@keyframes cta-glow {
  0% { box-shadow: 0 1px 0 rgba(255, 255, 255, .26) inset, 0 0 0 1px rgba(29, 78, 216, .6), 0 0 0 0 rgba(var(--blue-rgb), .4); }
  60% { box-shadow: 0 1px 0 rgba(255, 255, 255, .26) inset, 0 0 0 1px rgba(29, 78, 216, .6), 0 0 0 14px rgba(var(--blue-rgb), 0); }
  100% { box-shadow: 0 1px 0 rgba(255, 255, 255, .26) inset, 0 -1px 0 rgba(8, 30, 92, .2) inset, 0 8px 24px -8px rgba(var(--blue-rgb), .5), 0 0 0 1px rgba(29, 78, 216, .6); }
}
@keyframes rv-in { from { opacity: 0; transform: translateY(16px); filter: blur(6px); } to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes rv-mask { from { transform: translateY(108%); } to { transform: none; } }
.splash.is-quick .splash-body, .splash.is-quick .hud-top, .splash.is-quick .hud-bottom { animation: rv-in .55s var(--ease-out) both; }
.splash.is-quick .hud-top { animation-delay: .05s; }
.splash.is-quick .hud-bottom { animation-delay: .12s; }
.splash.is-leaving { pointer-events: none; }
.splash.is-leaving .splash-body, .splash.is-leaving .hud-top, .splash.is-leaving .hud-bottom, .splash.is-leaving .login-panel {
  animation: rv-out .42s var(--ease) both;
}
.splash.is-leaving .login-panel { animation-name: rv-out-panel; }
@keyframes rv-out { to { opacity: 0; transform: translateY(-18px); filter: blur(4px); } }
@keyframes rv-out-panel { from { opacity: 1; transform: translate(0, -50%); } to { opacity: 0; transform: translate(0, -50%) translateY(-18px) scale(.98); } }

/* logo drawing */
.splash.is-intro .logo-mark.is-animated .lm-fil { stroke-dasharray: 1 1; animation: lm-draw .7s var(--ease-out) both; animation-delay: calc(.08s + var(--i) * .045s); }
.splash.is-intro .logo-mark.is-animated .lm-trace,
.splash.is-intro .logo-mark.is-animated .lm-base { stroke-dasharray: 1 1; animation: lm-draw .8s var(--ease-out) .5s both; }
.splash.is-intro .logo-mark.is-animated .lm-tip { transform-box: fill-box; transform-origin: center; animation: lm-pop .5s var(--ease-out) both; animation-delay: calc(.42s + var(--i) * .045s); }
@keyframes lm-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes lm-pop { 0% { transform: scale(0); opacity: 0; } 60% { transform: scale(1.5); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }

/* ----- responsive ----- */
@media (max-width: 1180px) {
  .login-open .hero { opacity: .2; transform: translateX(-2vw) scale(.95); }
}
@media (max-width: 900px) {
  .splash-scrim { background: linear-gradient(180deg, rgba(248, 251, 253, .84) 0%, rgba(248, 251, 253, .74) 50%, rgba(248, 251, 253, .3) 100%); }
  .hud-ruler { display: none; }
  .splash-body { padding: 0 20px; align-items: flex-start; }
  .hero { padding-top: 6vh; }
  .login-open .hero { opacity: 0; transform: translateY(-10px); pointer-events: none; }
  .login-panel { top: 50%; left: 50%; right: auto; transform: translate(-50%, -46%) scale(.985); }
  .login-open .login-panel { transform: translate(-50%, -50%); }
  @keyframes rv-out-panel { to { opacity: 0; transform: translate(-50%, -54%); } }
}
@media (max-width: 560px) {
  .hud-top { padding-top: 18px; }
  .hud-meta { display: none; }
  .t-main { font-size: clamp(44px, 14vw, 62px); }
  .t-sub { font-size: 15px; letter-spacing: .36em; gap: 12px; }
  .t-rule { width: 26px; }
  .hero-tagline { margin-top: 22px; font-size: 17px; }
  .hero-intro { font-size: 15px; }
  .hero-tags li { height: 32px; font-size: 14px; }
  .hero-cta { margin-top: 28px; }
  .cta-login { width: 100%; }
  .kbd-hint { display: none; }
  .login-panel { width: calc(100vw - 24px); }
  .lp-scroll { padding: 24px 20px 18px; max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); }
  .hud-bottom { flex-direction: column; align-items: flex-start; gap: 6px; padding-bottom: 16px; font-size: 12.5px; }
  .welcome { padding: 18px; }
}
@media (hover: none) {
  .hud-bottom .hint { display: none; }
}
/* ----- short viewports (laptops: browser chrome eats ~110px) ----- */
@media (max-height: 820px) and (min-width: 901px) {
  /* compact welcome card: one action row */
  .welcome { width: min(100%, 560px); padding: 14px 16px 14px 14px; gap: 12px 14px; }
  .wc-avatar { width: 48px; height: 48px; }
  .wc-avatar span { font-size: 19px; }
  .wc-name { font-size: 18px; margin-top: 2px; }
  .wc-actions { grid-template-columns: 1fr auto auto; gap: 8px; padding-top: 2px; }
  .wc-actions .btn--primary { grid-column: auto; --bh: 44px; font-size: 15.5px; }
  .wc-actions .btn--ghost { --bh: 44px; padding: 0 14px; }
}
@media (max-height: 760px) and (min-width: 561px) {
  /* compact login panel */
  .lp-scroll { padding: 22px 26px 16px; max-height: calc(100vh - 136px); max-height: calc(100dvh - 136px); }
  .lp-head h2 { margin-top: 6px; font-size: 22px; }
  .lp-sub { margin-top: 3px; font-size: 13.5px; }
  .lp-form { margin-top: 16px; gap: 12px; }
  .login-panel .field { gap: 6px; }
  .login-panel .field-box { height: 44px; }
  .lp-submit { --bh: 44px; }
  .form-error { margin: -6px 0; }
  .lp-foot { margin-top: 12px; padding-top: 10px; }
}
@media (max-height: 660px) and (min-width: 901px) {
  .hero { padding: 4px 0 10px; }
  .hero-title { margin-top: 8px; }
  .hero-tagline { margin-top: 12px; }
  .hero-tags { margin-top: 10px; }
  .hero-cta { margin-top: 16px; }
  .hero-intro { font-size: 14.5px; line-height: 1.7; }
  .hero-tags { gap: 8px; }
  .hero-tags li { height: 30px; font-size: 14px; }
  .hud-bottom { padding-top: 8px; }
}
