:root {
  color-scheme: light;
  --navy: #06375e;
  --blue: #004b87;
  --sea: #0072bc;
  --green: #2e9e44;
  --orange: #ff7f00;
  --ink: #15293b;
  --muted: #64788a;
  --line: #dce6ed;
  --surface: #ffffff;
  --canvas: #eff4f7;
  --shadow: 0 24px 70px rgba(0, 43, 77, 0.15);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--canvas); }
button, input, select { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid rgba(0, 114, 188, 0.32); outline-offset: 2px; }

.loading-view {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  color: var(--muted);
  font-size: 15px;
}
.loading-mark {
  width: 38px;
  height: 38px;
  border: 4px solid #cfe0eb;
  border-top-color: var(--sea);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-lockup img { flex: 0 0 auto; border-radius: 14px; box-shadow: 0 8px 22px rgba(0, 25, 46, .18); }
.brand-lockup div { display: grid; gap: 3px; }
.brand-lockup strong { font-size: 17px; line-height: 1.25; }
.brand-lockup span { font-size: 12px; color: #a8cadf; }

.login-view { min-height: 100vh; padding: 30px; display: grid; place-items: center; }
.login-shell {
  width: min(1120px, 100%);
  min-height: min(760px, calc(100vh - 60px));
  display: grid;
  grid-template-columns: .92fr 1.08fr;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 30px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.login-brand {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 42px;
  color: white;
  background: radial-gradient(circle at 105% -10%, rgba(64, 164, 224, .45), transparent 38%), linear-gradient(145deg, #052e50, #064777);
}
.login-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .09;
  background-image: linear-gradient(rgba(255,255,255,.7) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.7) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(to bottom, #000, transparent 85%);
}
.login-brand > * { position: relative; z-index: 1; }
.login-brand-copy { margin: auto 0; max-width: 430px; }
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--green);
  color: white;
  font-size: 13px;
  font-weight: 700;
}
.status-pill i, .health-dot { width: 8px; height: 8px; border-radius: 50%; background: #8cf39f; box-shadow: 0 0 0 4px rgba(140,243,159,.14); }
.status-pill.light { background: #e9f7ed; color: #226e35; }
.status-pill.light i { background: var(--green); box-shadow: none; }
.login-brand h1 { margin: 22px 0 14px; font-size: clamp(32px, 3.1vw, 44px); line-height: 1.35; letter-spacing: -.02em; }
.login-brand-copy > p { margin: 0; max-width: 390px; color: #c1ddeb; font-size: 15px; line-height: 1.9; }
.brand-points { margin-top: 30px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.brand-points span { padding: 12px 14px; border: 1px solid rgba(255,255,255,.13); border-radius: 13px; background: rgba(255,255,255,.07); color: #edf8fd; font-size: 14px; }
.brand-foot { margin: 0; color: #91bdd5; font-size: 12px; }

.login-main { display: flex; align-items: center; justify-content: center; padding: 48px 64px; background: white; }
.login-form-wrap { width: min(480px, 100%); }
.mobile-brand { display: none; }
.eyebrow { margin: 0 0 7px; color: var(--sea); font-size: 13px; font-weight: 800; letter-spacing: .04em; }
.login-form-wrap h2 { margin: 0; font-size: clamp(27px, 3vw, 34px); letter-spacing: -.025em; }
.form-intro { margin: 12px 0 0; color: var(--muted); font-size: 14px; line-height: 1.75; }
#login-form { margin-top: 30px; }
#login-form label { display: block; margin: 0 0 8px; font-size: 14px; font-weight: 700; }
.password-label { margin-top: 19px; }
.input-wrap { position: relative; }
.input-wrap input {
  width: 100%;
  height: 48px;
  padding: 0 54px 0 48px;
  border: 1px solid #cfdae2;
  border-radius: 12px;
  background: #fbfdfe;
  color: var(--ink);
  font-size: 16px;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.input-wrap input:focus { outline: 0; border-color: var(--sea); background: white; box-shadow: 0 0 0 4px rgba(0,114,188,.1); }
.input-icon { position: absolute; left: 13px; top: 50%; translate: 0 -50%; width: 25px; height: 25px; display: grid; place-items: center; border-radius: 8px; background: #e8f2f8; color: var(--blue); font-size: 12px; font-weight: 800; }
.password-toggle { position: absolute; right: 12px; top: 50%; translate: 0 -50%; padding: 6px; border: 0; background: transparent; color: var(--sea); font-size: 13px; }
.form-error { margin: 13px 0 0; padding: 10px 12px; border: 1px solid #f0c4c7; border-radius: 10px; background: #fff4f4; color: #a12830; font-size: 13px; line-height: 1.5; }
.primary-button {
  width: 100%;
  height: 48px;
  margin-top: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 0;
  border-radius: 12px;
  background: var(--orange);
  color: white;
  font-size: 16px;
  font-weight: 800;
  box-shadow: 0 12px 24px rgba(255,127,0,.22);
}
.primary-button:hover { background: #eb7500; }
.primary-button:disabled { cursor: wait; opacity: .68; box-shadow: none; }
.security-note { margin-top: 22px; padding: 15px 16px; border: 1px solid #cbe1ef; border-radius: 14px; background: #f2f8fb; }
.security-note strong { color: #005b98; font-size: 14px; }
.security-note p { margin: 5px 0 0; color: var(--muted); font-size: 13px; line-height: 1.65; }

.app-view { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: 274px;
  display: flex;
  flex-direction: column;
  padding: 22px 16px 18px;
  color: #eaf5fb;
  background: linear-gradient(180deg, #07395f, #052d4d);
  box-shadow: 14px 0 36px rgba(5,45,77,.08);
}
.sidebar-brand { padding: 0 8px 20px; border-bottom: 1px solid rgba(255,255,255,.1); }
.sidebar-brand strong { font-size: 15px; }
.sidebar-profile { margin: 18px 2px 4px; padding: 12px; display: flex; align-items: center; gap: 11px; border: 1px solid rgba(255,255,255,.1); border-radius: 14px; background: rgba(255,255,255,.07); }
.sidebar-profile > div { min-width: 0; display: grid; gap: 4px; }
.sidebar-profile strong, .sidebar-profile span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-profile strong { font-size: 14px; }
.sidebar-profile div span { color: #a9cddd; font-size: 12px; }
.avatar { flex: 0 0 auto; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; background: #d9effb; color: var(--blue); font-size: 14px; font-weight: 800; }
.sidebar-nav { margin-top: 15px; display: grid; gap: 5px; }
.sidebar-nav > p { margin: 15px 10px 6px; color: #81aec5; font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.nav-item { min-height: 42px; width: 100%; padding: 0 12px; display: flex; align-items: center; gap: 11px; border: 0; border-radius: 11px; background: transparent; color: #d7e9f2; text-align: left; font-size: 14px; }
.nav-item > span { width: 21px; text-align: center; color: #8fc5df; font-size: 18px; }
.nav-item small { margin-left: auto; padding: 3px 7px; border-radius: 999px; background: rgba(255,255,255,.09); color: #a7c8d8; font-size: 10px; }
button.nav-item:hover { background: rgba(255,255,255,.08); }
.nav-item.is-active { background: #0d5f95; color: white; box-shadow: inset 3px 0 0 #63cf76; }
.nav-item.is-active > span { color: #85dd95; }
.nav-item.is-disabled { opacity: .58; cursor: default; }
.sidebar-status { margin-top: auto; padding: 13px 11px; display: flex; align-items: center; gap: 11px; border-top: 1px solid rgba(255,255,255,.1); }
.sidebar-status > div { display: grid; gap: 3px; }
.sidebar-status strong { font-size: 12px; }
.sidebar-status span { color: #83aec3; font-size: 11px; }
.health-dot { background: #ffb45e; }
.health-dot.is-ready { background: #72dd86; }

.workspace { min-height: 100vh; margin-left: 274px; }
.topbar { min-height: 78px; padding: 14px 28px; display: flex; align-items: center; gap: 18px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.95); backdrop-filter: blur(12px); }
.page-heading { min-width: 0; }
.page-heading p { margin: 0 0 2px; color: var(--sea); font-size: 11px; font-weight: 800; letter-spacing: .06em; }
.page-heading h1 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.scope-control { display: grid; gap: 3px; }
.scope-control > span { color: var(--muted); font-size: 10px; }
.scope-control select { min-width: 190px; height: 36px; padding: 0 30px 0 10px; border: 1px solid var(--line); border-radius: 9px; background: white; color: var(--ink); font-size: 13px; }
.quiet-button, .icon-button { height: 36px; border: 1px solid var(--line); border-radius: 9px; background: white; color: #3e5669; font-size: 13px; }
.quiet-button { padding: 0 14px; }
.quiet-button:hover, .icon-button:hover { border-color: #b8cbd8; background: #f7fafc; }
.icon-button { width: 38px; display: none; place-items: center; font-size: 18px; }
.content { padding: 28px; }
.page-section { width: min(1220px, 100%); margin: 0 auto; }

.welcome-card { min-height: 200px; padding: 30px; display: flex; align-items: center; justify-content: space-between; gap: 28px; overflow: hidden; border-radius: 22px; color: white; background: radial-gradient(circle at 96% 0, rgba(52,160,221,.5), transparent 34%), linear-gradient(128deg, #06385f 0%, #075488 100%); box-shadow: 0 18px 36px rgba(0,64,107,.15); }
.welcome-card h2 { margin: 18px 0 8px; font-size: clamp(24px, 3vw, 34px); letter-spacing: -.025em; }
.welcome-card p { max-width: 700px; margin: 0; color: #c7e2ef; font-size: 14px; line-height: 1.8; }
.connection-badge { min-width: 220px; padding: 18px; display: flex; align-items: center; gap: 13px; border: 1px solid rgba(255,255,255,.16); border-radius: 17px; background: rgba(255,255,255,.1); }
.health-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: var(--green); color: white; font-size: 20px; font-weight: 900; }
.connection-badge div { display: grid; gap: 4px; }
.connection-badge strong { font-size: 14px; }
.connection-badge span { color: #b9dbea; font-size: 12px; }

.dashboard-grid { margin-top: 20px; display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, .8fr); gap: 20px; }
.panel { padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 9px 24px rgba(12,49,76,.05); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.panel-heading h3 { margin: 0; font-size: 18px; }
.phase-badge, .verified-badge { padding: 6px 10px; border-radius: 999px; background: #e7f3fa; color: #08669f; font-size: 12px; font-weight: 800; }
.implementation-steps { margin: 20px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.implementation-steps li { min-height: 70px; padding: 12px 10px; display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 12px; border-radius: 12px; }
.implementation-steps li > span { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid #cfdae2; border-radius: 10px; color: #718393; font-size: 13px; font-weight: 800; }
.implementation-steps strong { font-size: 14px; }
.implementation-steps p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.implementation-steps b { color: var(--muted); font-size: 11px; }
.implementation-steps .is-complete { background: #f0f9f2; }
.implementation-steps .is-complete > span { border-color: #bfe3c7; background: var(--green); color: white; }
.implementation-steps .is-complete b { color: #28763b; }
.implementation-steps .is-current { background: #f1f7fb; }
.implementation-steps .is-current > span { border-color: #9fcae5; color: #0069aa; }
.implementation-steps .is-current b { color: #0069aa; }

.account-summary dl, .identity-card dl { margin: 18px 0 0; }
.account-summary dl div, .identity-card dl div { padding: 12px 0; display: flex; justify-content: space-between; gap: 15px; border-bottom: 1px solid #edf1f4; }
.account-summary dt, .identity-card dt { color: var(--muted); font-size: 13px; }
.account-summary dd, .identity-card dd { margin: 0; max-width: 65%; text-align: right; font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.secondary-button { width: 100%; min-height: 42px; margin-top: 18px; padding: 0 13px; display: flex; align-items: center; justify-content: space-between; border: 1px solid #c6dce9; border-radius: 11px; background: #f1f8fb; color: #005f9d; font-size: 13px; font-weight: 800; }
.secondary-button:hover { background: #e7f3f9; }
.empty-card { margin-top: 20px; padding: 22px; display: flex; align-items: center; gap: 18px; border: 1px dashed #bfcfda; border-radius: 17px; background: rgba(255,255,255,.63); }
.empty-icon { flex: 0 0 auto; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px; background: #e8f2f7; color: #0a6aa4; font-weight: 900; }
.empty-card h3 { margin: 0; font-size: 15px; }
.empty-card p { margin: 5px 0 0; color: var(--muted); font-size: 13px; line-height: 1.65; }

.section-intro { margin-bottom: 20px; display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.section-intro h2 { margin: 0; font-size: 24px; }
.section-intro > div > p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 14px; }
.verified-badge { background: #e9f7ed; color: #26753a; }
.accounts-grid { display: grid; grid-template-columns: minmax(280px, .75fr) minmax(0, 1.55fr); gap: 20px; }
.identity-head { padding-bottom: 18px; display: flex; align-items: center; gap: 14px; border-bottom: 1px solid var(--line); }
.large-avatar { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 16px; background: linear-gradient(145deg, #d8edf8, #eef8fc); color: var(--blue); font-size: 19px; font-weight: 900; }
.identity-head h3 { margin: 0; font-size: 18px; }
.identity-head p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.inline-status { padding: 4px 9px; border-radius: 999px; background: #e9f7ed; color: #26753a; font-size: 11px; }
.role-list { margin-top: 18px; display: grid; gap: 12px; }
.role-item { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fbfdfe; }
.role-item.is-active { border-color: #91c6e4; box-shadow: inset 3px 0 0 var(--sea); }
.role-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.role-title strong { font-size: 14px; }
.role-title span { padding: 4px 8px; border-radius: 999px; background: #e7f3fa; color: #08669f; font-size: 10px; font-weight: 800; }
.role-meta { margin: 9px 0 0; display: flex; flex-wrap: wrap; gap: 7px 16px; color: var(--muted); font-size: 12px; }
.permission-list { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.permission-list span { padding: 4px 8px; border-radius: 7px; background: #edf2f5; color: #4d6273; font-size: 10px; }
.security-panel { margin-top: 20px; padding: 18px 20px; border: 1px solid #cce0ec; border-radius: 15px; background: #f2f8fb; }
.security-panel strong { color: #005f9d; font-size: 14px; }
.security-panel p { margin: 5px 0 0; color: var(--muted); font-size: 13px; line-height: 1.65; }

.toast { position: fixed; z-index: 100; left: 50%; bottom: 25px; translate: -50% 0; max-width: min(440px, calc(100vw - 32px)); padding: 11px 16px; border-radius: 11px; background: #132f43; color: white; box-shadow: 0 14px 35px rgba(0,0,0,.18); font-size: 13px; }
.toast.is-error { background: #9f3037; }
.nav-overlay { display: none; }

@media (max-width: 900px) {
  .login-view { padding: 0; }
  .login-shell { min-height: 100vh; grid-template-columns: 1fr; border: 0; border-radius: 0; }
  .login-brand { display: none; }
  .login-main { min-height: 100vh; padding: 30px 22px; }
  .mobile-brand { display: flex; margin-bottom: 46px; }
  .mobile-brand span { color: var(--muted); }
  .sidebar { translate: -105% 0; transition: translate .22s ease; }
  body.nav-open { overflow: hidden; }
  body.nav-open .sidebar { translate: 0 0; }
  .nav-overlay { position: fixed; inset: 0; z-index: 25; border: 0; background: rgba(4,26,43,.46); }
  body.nav-open .nav-overlay { display: block; }
  .workspace { margin-left: 0; }
  .icon-button { display: grid; }
  .topbar { padding: 12px 16px; }
  .content { padding: 18px 16px 28px; }
  .dashboard-grid, .accounts-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .topbar { align-items: flex-start; flex-wrap: wrap; }
  .page-heading h1 { font-size: 18px; }
  .topbar-actions { width: 100%; order: 3; margin-left: 56px; }
  .scope-control { min-width: 0; flex: 1; }
  .scope-control select { width: 100%; min-width: 0; }
  .content { padding-inline: 12px; }
  .welcome-card { min-height: 0; padding: 22px; flex-direction: column; align-items: stretch; }
  .welcome-card h2 { font-size: 24px; }
  .connection-badge { min-width: 0; }
  .panel { padding: 18px; border-radius: 15px; }
  .implementation-steps li { grid-template-columns: 34px 1fr; }
  .implementation-steps li b { grid-column: 2; }
  .empty-card { align-items: flex-start; }
  .section-intro { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
