/* ==========================================================================
   图片多语言改图 · 双版本原型 — App styles
   Built on Kloderr tokens (styles/tokens.css). Green professional workbench.
   ========================================================================== */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--kl-font-body);
  color: var(--kl-ink);
  background:
    radial-gradient(1200px 700px at 50% -10%, #E7F1EA 0%, rgba(231,241,234,0) 60%),
    #DDE6E0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
:root { --proto-bar-h: 60px; }

button { font-family: inherit; cursor: pointer; border: none; background: none; }
img { display: block; }

/* ==========================================================================
   PROTOTYPE CONTROL BAR (meta-chrome, above the device frame)
   ========================================================================== */
.proto-bar {
  position: sticky; top: 0; z-index: 100;
  height: var(--proto-bar-h);
  display: flex; align-items: center; gap: var(--kl-space-4);
  padding: 0 var(--kl-space-5);
  background: var(--kl-surface-dark);
  border-bottom: 1px solid var(--kl-border-dark);
  color: #fff;
}
.proto-bar__brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--kl-font-display); font-weight: 600; font-size: 14px;
  color: #fff; letter-spacing: -0.01em; white-space: nowrap;
}
.proto-bar__brand .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--kl-green-400); box-shadow: 0 0 0 3px rgba(22,163,74,.25);
}
.proto-bar__brand .tag {
  font-family: var(--kl-font-mono); font-size: 11px; font-weight: 500;
  color: rgba(255,255,255,.5); letter-spacing: 0;
  padding-left: 10px; margin-left: 2px; border-left: 1px solid rgba(255,255,255,.16);
}
.proto-bar__spacer { flex: 1; }

/* segmented control (dark) */
.seg {
  display: inline-flex; align-items: center; gap: 2px; flex: none;
  padding: 3px; border-radius: var(--kl-r-pill);
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.10);
}
.seg button {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 14px; border-radius: var(--kl-r-pill);
  font-size: 13px; font-weight: 600; color: rgba(255,255,255,.62);
  transition: background .16s cubic-bezier(.2,.7,.2,1), color .16s;
  white-space: nowrap;
}
.seg button svg { width: 15px; height: 15px; }
.seg button:hover { color: #fff; }
.seg button.is-active { background: #fff; color: var(--kl-green-700); }
.seg button.is-active.newyes { color: var(--kl-green-700); }
.seg.compact button { padding: 6px 11px; }

.proto-ghost {
  display: inline-flex; align-items: center; gap: 7px; flex: none; white-space: nowrap;
  padding: 7px 14px; border-radius: var(--kl-r-pill);
  font-size: 13px; font-weight: 600; color: rgba(255,255,255,.78);
  border: 1px solid rgba(255,255,255,.16);
  transition: background .16s, color .16s, border-color .16s;
}
.proto-ghost svg { width: 15px; height: 15px; }
.proto-ghost:hover { background: rgba(255,255,255,.08); color: #fff; }
.proto-ghost.is-active {
  background: var(--kl-green-500); border-color: var(--kl-green-500); color: #fff;
}

/* ==========================================================================
   STAGE — fits a fixed-size frame into the viewport
   ========================================================================== */
.stage {
  position: fixed; left: 0; right: 0; top: var(--proto-bar-h); bottom: 0;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.stage.scroll { overflow: auto; align-items: flex-start; }
.fit-wrap { transform-origin: top center; }

/* ==========================================================================
   ICONS
   ========================================================================== */
.ic { display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ic svg { width: 1em; height: 1em; stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: block; }

/* ==========================================================================
   PC APP SHELL — left rail + content
   ========================================================================== */
.app { display: flex; height: 100%; width: 100%; background: var(--kl-bg-2); }
.rail {
  position: relative; z-index: 40;
  width: 232px; flex: none; background: #fff;
  border-right: 1px solid var(--kl-border);
  display: flex; flex-direction: column; padding: 18px 14px;
}
.rail__brand {
  display: flex; align-items: center; gap: 10px; height: 40px;
  padding: 0 8px 0 8px; margin-bottom: 18px;
}
.rail__brand img.wordmark { height: 22px; width: auto; }
.rail__brand .mark {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--kl-gradient-brand); color: #fff;
}
.rail__brand .mark svg { width: 18px; height: 18px; }
.rail__brand .name { font-family: var(--kl-font-display); font-weight: 600;
  font-size: 16px; color: var(--kl-ink); letter-spacing: -0.01em; }
.rail__name-sub { font-family: var(--kl-font-mono); font-size: 10px;
  color: var(--kl-fg-4); letter-spacing: .02em; }

.rail__group-label {
  font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--kl-fg-4); padding: 14px 10px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 9px 10px; border-radius: var(--kl-r-sm); margin-bottom: 2px;
  font-size: 14px; font-weight: 500; color: var(--kl-fg-2); text-align: left;
  position: relative; transition: background .15s, color .15s;
}
.nav-item .ic { font-size: 18px; color: var(--kl-fg-3); transition: color .15s; }
.nav-item .badge-count {
  margin-left: auto; font-size: 11px; font-weight: 700; font-family: var(--kl-font-mono);
  color: var(--kl-fg-3); background: var(--kl-bg-3); border-radius: var(--kl-r-pill);
  padding: 1px 7px;
}
.nav-item:hover { background: var(--kl-bg-3); color: var(--kl-ink); }
.nav-item:hover .ic { color: var(--kl-fg-2); }
.nav-item.is-active { background: var(--kl-green-50); color: var(--kl-green-700); font-weight: 600; }
.nav-item.is-active .ic { color: var(--kl-primary); }
.nav-item.is-active::before {
  content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--kl-primary);
}
.nav-item.is-disabled { opacity: .45; cursor: not-allowed; }
.nav-item.is-disabled .badge-count { background: transparent; color: var(--kl-fg-4); }
.rail__foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--kl-border); }
.rail__user { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--kl-r-sm); }
.rail__user:hover { background: var(--kl-bg-3); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: #fff;
  background: linear-gradient(135deg, var(--kl-green-500), var(--kl-green-700));
}
.avatar.sm { width: 26px; height: 26px; font-size: 11px; }
.avatar--lg { width: 38px; height: 38px; font-size: 15px; }

/* ---- rail account chip (now a button) + popovers ---- */
.rail__foot { position: relative; }
.rail__user { width: 100%; background: transparent; border: 0; cursor: pointer; font: inherit; }
.rail__user.is-open { background: var(--kl-bg-3); }
.pop-wrap { position: relative; display: inline-flex; }
.icon-btn.is-open { background: var(--kl-bg-3); color: var(--kl-primary); }

.menu-pop {
  position: absolute; z-index: 60; width: 264px;
  background: #fff; border: 1px solid var(--kl-border);
  border-radius: var(--kl-r-md); box-shadow: var(--kl-shadow-lg);
  padding: 6px; animation: pop-in .14s cubic-bezier(0.2,0.7,0.2,1);
}
.menu-pop--up { bottom: calc(100% + 8px); left: 0; right: 0; }
.menu-pop--down { top: calc(100% + 8px); right: 0; }
@keyframes pop-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.menu-pop__head { display: flex; align-items: center; gap: 10px; padding: 8px 10px 10px; }
.menu-pop__name { font-size: 13px; font-weight: 600; color: var(--kl-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-pop__sub { font-size: 11px; color: var(--kl-fg-4); font-family: var(--kl-font-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-pop__sep { height: 1px; background: var(--kl-border); margin: 5px 4px; }
.menu-pop__item {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 10px;
  border-radius: var(--kl-r-sm); font-size: 13px; font-weight: 500; color: var(--kl-fg-2);
  background: transparent; border: 0; cursor: pointer; text-align: left;
}
.menu-pop__item .ic { color: var(--kl-fg-4); }
.menu-pop__item:hover { background: var(--kl-bg-3); color: var(--kl-ink); }
.menu-pop__item:hover .ic { color: var(--kl-primary); }
.menu-pop__item--danger { color: var(--kl-danger); }
.menu-pop__item--danger .ic { color: var(--kl-danger); }
.menu-pop__item--danger:hover { background: var(--kl-danger-bg); color: var(--kl-danger); }

.menu-pop__bar { display: flex; align-items: center; padding: 6px 10px 8px; }
.menu-pop__bar > span { font-size: 13px; font-weight: 600; color: var(--kl-ink); }
.menu-pop__link { margin-left: auto; background: 0; border: 0; cursor: pointer; font-size: 11px; color: var(--kl-link); }
.menu-pop__msg { display: flex; align-items: flex-start; gap: 9px; padding: 9px 10px; border-radius: var(--kl-r-sm); }
.menu-pop__msg:hover { background: var(--kl-bg-3); }
.menu-pop__msg-t { font-size: 12.5px; line-height: 1.45; color: var(--kl-fg-2); }
.sdot { width: 8px; height: 8px; border-radius: 50%; flex: none; margin-top: 5px; }
.sdot--running { background: var(--kl-status-running); }
.sdot--queued { background: var(--kl-status-queued); }
.sdot--idle { background: var(--kl-status-idle); }
.menu-pop__foot { width: 100%; margin-top: 4px; padding: 8px; border-radius: var(--kl-r-sm); background: var(--kl-bg-2); border: 0; cursor: pointer; font-size: 12px; font-weight: 600; color: var(--kl-fg-3); }
.menu-pop__foot:hover { color: var(--kl-primary); }

/* main column */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: relative; z-index: 30;
  height: 60px; flex: none; display: flex; align-items: center; gap: 16px;
  padding: 0 28px; background: rgba(246,249,247,.82);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--kl-border);
}
.topbar__crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--kl-fg-3); font-weight: 500; }
.topbar__crumbs .cur { color: var(--kl-ink); font-weight: 600; }
.topbar__crumbs .ic { font-size: 14px; color: var(--kl-fg-4); }
.topbar__search {
  display: flex; align-items: center; gap: 8px; height: 34px; width: 260px;
  padding: 0 12px; border-radius: var(--kl-r-sm); background: #fff;
  border: 1px solid var(--kl-border); color: var(--kl-fg-4); font-size: 13px;
}
.topbar__search .ic { font-size: 15px; }
.topbar__search.is-focus { border-color: var(--kl-primary); box-shadow: var(--kl-shadow-focus); color: var(--kl-fg-3); }
.topbar__search input::placeholder { color: var(--kl-fg-4); }
.topbar__search-x { flex: none; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; border: 0; background: var(--kl-bg-3); border-radius: 50%; cursor: pointer; color: var(--kl-fg-3); }
.topbar__search-x:hover { background: var(--kl-border-strong); color: var(--kl-ink); }
.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: var(--kl-r-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--kl-fg-2); position: relative; transition: background .15s;
}
.icon-btn:hover { background: var(--kl-bg-3); }
.icon-btn .ic { font-size: 18px; }
.icon-btn .red-dot { position: absolute; top: 8px; right: 9px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--kl-danger); border: 1.5px solid var(--kl-bg-2); }

.content { flex: 1; min-height: 0; overflow: auto; }
.content__inner { max-width: 1180px; margin: 0 auto; padding: 32px 36px 64px; }
.content__inner.wide { max-width: 1320px; }

/* ==========================================================================
   TYPOGRAPHY HELPERS
   ========================================================================== */
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 24px; }
.page-head__txt h1 { font-family: var(--kl-font-display); font-weight: 600; font-size: 26px;
  letter-spacing: -.015em; color: var(--kl-ink); margin: 0; }
.page-head__txt p { font-size: 14px; color: var(--kl-fg-3); margin: 5px 0 0; }
.page-head__actions { margin-left: auto; display: flex; gap: 10px; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--kl-green-600); }

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: var(--kl-r-sm);
  font-size: 14px; font-weight: 600; color: var(--kl-fg-2);
  background: #fff; border: 1px solid var(--kl-border-strong);
  transition: background .15s, border-color .15s, transform .08s, box-shadow .15s;
  white-space: nowrap;
}
.btn .ic { font-size: 17px; }
.btn:hover { background: var(--kl-bg-3); }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--kl-primary); color: #fff; border-color: var(--kl-primary); }
.btn--primary:hover { background: var(--kl-primary-hover); border-color: var(--kl-primary-hover); }
.btn--primary:active { background: var(--kl-primary-active); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--kl-fg-2); }
.btn--ghost:hover { background: var(--kl-bg-3); }
.btn--lg { height: 48px; padding: 0 24px; font-size: 15px; }
.btn--sm { height: 32px; padding: 0 12px; font-size: 13px; gap: 6px; border-radius: var(--kl-r-xs); }
.btn--sm .ic { font-size: 15px; }
.btn--danger { color: var(--kl-danger); border-color: var(--kl-border-strong); }
.btn--danger:hover { background: var(--kl-danger-bg); border-color: var(--kl-danger); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--hero {
  height: 60px; padding: 0 40px; font-size: 18px; border-radius: var(--kl-r-md);
  background: var(--kl-primary); color: #fff; border: none;
  box-shadow: var(--kl-glow-green);
}
.btn--hero:hover { background: var(--kl-primary-hover); }
.btn--hero .ic { font-size: 22px; }
.linklike { color: var(--kl-link); font-weight: 600; font-size: 14px; }
.linklike:hover { text-decoration: underline; }

/* ==========================================================================
   CARDS / SURFACES
   ========================================================================== */
.card { background: #fff; border: 1px solid var(--kl-border); border-radius: var(--kl-r-md);
  box-shadow: var(--kl-shadow-xs); }
.card.pad { padding: 20px; }
.card.hoverable { transition: box-shadow .15s, transform .15s, border-color .15s; cursor: pointer; }
.card.hoverable:hover { box-shadow: var(--kl-shadow-md); transform: translateY(-2px); border-color: var(--kl-border-strong); }

/* chips / badges / status */
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px;
  border-radius: var(--kl-r-pill); font-size: 12px; font-weight: 600;
  background: var(--kl-bg-3); color: var(--kl-fg-2);
}
.chip .ic { font-size: 13px; }
.chip--green { background: var(--kl-green-100); color: var(--kl-green-700); }
.chip--amber { background: var(--kl-warning-bg); color: var(--kl-warning); }
.chip--red { background: var(--kl-danger-bg); color: var(--kl-danger); }
.chip--info { background: var(--kl-info-bg); color: var(--kl-info); }
.chip--lock { background: #ECE7DC; color: #7a5a14; }
.chip--outline { background: #fff; border: 1px solid var(--kl-border-strong); color: var(--kl-fg-2); }

.sdot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.sdot--running { background: var(--kl-status-running); box-shadow: 0 0 0 3px rgba(22,163,74,.18); }
.sdot--queued { background: var(--kl-status-queued); }
.sdot--idle { background: var(--kl-status-idle); }
.sdot--failed { background: var(--kl-status-failed); }
.sdot--done { background: var(--kl-green-500); }

.statusline { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; }

/* progress bar */
.pbar { height: 6px; border-radius: 99px; background: var(--kl-bg-3); overflow: hidden; }
.pbar > i { display: block; height: 100%; border-radius: 99px; background: var(--kl-primary);
  transition: width .5s cubic-bezier(.2,.7,.2,1); }
.pbar.amber > i { background: var(--kl-warning); }

/* meta grid for stats */
.stat { background: #fff; border: 1px solid var(--kl-border); border-radius: var(--kl-r-md); padding: 16px 18px; }
.stat .k { font-size: 12px; font-weight: 600; color: var(--kl-fg-3); display:flex; align-items:center; gap:6px; }
.stat .v { font-family: var(--kl-font-display); font-weight: 600; font-size: 28px; color: var(--kl-ink);
  margin-top: 6px; letter-spacing: -.02em; }
.stat .v small { font-size: 14px; color: var(--kl-fg-3); font-weight: 600; font-family: var(--kl-font-body); }
.stat .d { font-size: 12px; color: var(--kl-fg-3); margin-top: 2px; }
.mono { font-family: var(--kl-font-mono); }

/* ==========================================================================
   EMPTY / LOADING / ERROR STATES
   ========================================================================== */
.state-box { display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 64px 24px; }
.state-box .glyph { width: 72px; height: 72px; border-radius: 20px; display: flex; align-items: center; justify-content: center;
  background: var(--kl-green-50); color: var(--kl-primary); margin-bottom: 18px; }
.state-box .glyph .ic { font-size: 34px; }
.state-box.err .glyph { background: var(--kl-danger-bg); color: var(--kl-danger); }
.state-box h3 { font-family: var(--kl-font-display); font-weight: 600; font-size: 19px; margin: 0 0 6px; color: var(--kl-ink); }
.state-box p { font-size: 14px; color: var(--kl-fg-3); margin: 0 0 20px; max-width: 380px; }

/* spinner / lattice loader */
.lattice { width: 40px; height: 40px; position: relative; animation: latspin 2.4s linear infinite; }
.lattice svg { width: 100%; height: 100%; }
@keyframes latspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce){ .lattice { animation: none; } .pbar > i { transition: none; } }

.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--kl-green-200);
  border-top-color: var(--kl-primary); animation: latspin .7s linear infinite; }

/* dashed upload zone */
.dropzone {
  border: 2px dashed var(--kl-border-strong); border-radius: var(--kl-r-lg);
  background: var(--kl-bg-2); padding: 48px 32px; text-align: center;
  transition: border-color .15s, background .15s; cursor: pointer;
}
.dropzone:hover { border-color: var(--kl-green-400); background: var(--kl-green-50); }
.dropzone .glyph { width: 64px; height: 64px; border-radius: 18px; margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center; background: #fff;
  border: 1px solid var(--kl-border); color: var(--kl-primary); }
.dropzone .glyph .ic { font-size: 30px; }
.dropzone h3 { font-family: var(--kl-font-display); font-weight: 600; font-size: 18px; margin: 0 0 6px; }
.dropzone p { font-size: 13px; color: var(--kl-fg-3); margin: 0; }

/* tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 600; color: var(--kl-fg-3); font-size: 12px;
  padding: 10px 14px; border-bottom: 1px solid var(--kl-border); white-space: nowrap; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--kl-border); color: var(--kl-fg-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr.rowhover:hover td { background: var(--kl-bg-2); }

/* segmented inline (light) */
.segl { display: inline-flex; padding: 3px; border-radius: var(--kl-r-sm); background: var(--kl-bg-3); gap: 2px; }
.segl button { padding: 6px 12px; border-radius: var(--kl-r-xs); font-size: 13px; font-weight: 600; color: var(--kl-fg-3); }
.segl button.is-active { background: #fff; color: var(--kl-ink); box-shadow: var(--kl-shadow-xs); }

/* toast */
.toast {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--kl-r-md);
  background: var(--kl-surface-dark); color: #fff; font-size: 14px; font-weight: 500;
  box-shadow: var(--kl-shadow-lg);
}
.toast .ic { font-size: 18px; color: var(--kl-green-300); }

/* banner */
.banner { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: var(--kl-r-md);
  font-size: 13px; line-height: 1.5; }
.banner .ic { font-size: 18px; flex: none; margin-top: 1px; }
.banner--info { background: var(--kl-info-bg); color: #1c4f7e; }
.banner--info .ic { color: var(--kl-info); }
.banner--warn { background: var(--kl-warning-bg); color: #7a4f08; }
.banner--warn .ic { color: var(--kl-warning); }
.banner--green { background: var(--kl-green-50); color: var(--kl-green-800); }
.banner--green .ic { color: var(--kl-primary); }

/* font-preset selector */
.fopt { transition: background .14s; }
.fopt:hover { background: var(--kl-bg-2); }

/* image slot tuning */
image-slot { background: #fff; border: 1px solid var(--kl-border); }
.imgph {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: repeating-linear-gradient(45deg, #F2F6F3 0 10px, #EEF3EF 10px 20px);
  color: var(--kl-fg-4); border-radius: var(--kl-r-sm); text-align: center; gap: 8px;
}
.imgph .ic { font-size: 26px; }
.imgph span { font-size: 12px; font-weight: 600; }

/* fade/rise entrance */
.rise { animation: rise .42s cubic-bezier(.2,.7,.2,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
/* Respect reduced motion: skip entrance animations so content shows its
   resting (visible) state instead of fading. */
@media (prefers-reduced-motion: reduce) {
  .rise, .msheet, .msheet-scrim, .menu-pop { animation: none !important; }
}

/* ==========================================================================
   BRAND GLYPH (客通 · Kloderr-lattice derived)
   ========================================================================== */
.genmark { display: inline-flex; align-items: center; justify-content: center; flex: none; color: currentColor; }
.genmark svg { width: 100%; height: 100%; display: block; }
.kl-brandmark { object-fit: contain; filter: brightness(0) invert(1); display: block; }

/* ==========================================================================
   FORM FIELDS (login / inputs)
   ========================================================================== */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label { font-size: 12px; font-weight: 600; color: var(--kl-fg-3); letter-spacing: .01em; }
.kl-input {
  width: 100%; height: 46px; padding: 0 14px; border-radius: var(--kl-r-sm);
  background: #fff; border: 1px solid var(--kl-border-strong); color: var(--kl-ink);
  font-family: var(--kl-font-body); font-size: 14.5px; font-weight: 500;
  transition: border-color .15s, box-shadow .15s; outline: none;
}
.kl-input::placeholder { color: var(--kl-fg-4); font-weight: 400; }
.kl-input:focus { border-color: var(--kl-primary); box-shadow: var(--kl-shadow-focus); }
.input-affix { display: flex; align-items: stretch; gap: 8px; }
.input-affix .kl-input { flex: 1; min-width: 0; }
.input-icon { position: relative; }
.input-icon .ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--kl-fg-4); font-size: 18px; pointer-events: none; }
.input-icon .kl-input { padding-left: 40px; }
.otp-btn {
  flex: none; height: 46px; padding: 0 14px; border-radius: var(--kl-r-sm);
  font-size: 13px; font-weight: 600; white-space: nowrap;
  border: 1px solid var(--kl-border-strong); background: #fff; color: var(--kl-green-700);
  transition: background .15s, border-color .15s, color .15s;
}
.otp-btn:hover:not(:disabled) { background: var(--kl-green-50); border-color: var(--kl-green-400); }
.otp-btn:disabled { color: var(--kl-fg-4); cursor: not-allowed; }

/* light segmented tabs (验证码 / 密码) */
.seg-tab { display: inline-flex; padding: 4px; gap: 2px; background: var(--kl-bg-3); border-radius: var(--kl-r-sm); }
.seg-tab button {
  height: 32px; padding: 0 16px; border-radius: var(--kl-r-xs); font-size: 13px; font-weight: 600;
  color: var(--kl-fg-3); transition: background .15s, color .15s;
}
.seg-tab button.is-active { background: #fff; color: var(--kl-ink); box-shadow: var(--kl-shadow-xs); }

/* SSO buttons */
.sso-row { display: flex; gap: 10px; }
.sso-btn {
  flex: 1; height: 46px; border-radius: var(--kl-r-sm); display: flex; align-items: center;
  justify-content: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--kl-fg-2);
  background: #fff; border: 1px solid var(--kl-border-strong); transition: background .15s, border-color .15s;
}
.sso-btn:hover { background: var(--kl-bg-3); border-color: var(--kl-fg-4); }
.sso-btn .ic { font-size: 18px; color: var(--kl-fg-3); }
.auth-or { display: flex; align-items: center; gap: 14px; color: var(--kl-fg-4); font-size: 12px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--kl-border); }

/* ==========================================================================
   LOGIN — PC split layout
   ========================================================================== */
.auth-pc { display: grid; grid-template-columns: 1.05fr 1fr; height: 100%; background: #fff; }
.auth-brand {
  position: relative; overflow: hidden; background: var(--kl-surface-dark);
  display: flex; flex-direction: column; padding: 52px 56px; color: #fff;
}
.auth-brand__glow {
  position: absolute; width: 560px; height: 560px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(22,163,74,.42) 0%, rgba(22,163,74,0) 68%);
  top: -160px; right: -180px;
}
.auth-brand__lattice { position: absolute; inset: 0; pointer-events: none; opacity: .07; }
.auth-brand__lattice img { position: absolute; right: -110px; bottom: -120px; width: 520px; height: 520px; object-fit: contain; filter: brightness(0) invert(1); }
.auth-brand > * { position: relative; z-index: 1; }
.auth-logo { display: flex; align-items: center; gap: 12px; }
.auth-logo .mk {
  width: 46px; height: 46px; border-radius: 12px; flex: none; display: flex; align-items: center; justify-content: center;
  background: var(--kl-gradient-brand); color: #fff; box-shadow: var(--kl-glow-green);
}
.auth-logo .nm { font-family: var(--kl-font-display); font-weight: 600; font-size: 22px; letter-spacing: -.01em; }
.auth-logo .sub { font-family: var(--kl-font-mono); font-size: 11px; color: rgba(255,255,255,.55); margin-top: 2px; letter-spacing: .02em; }
.auth-head { font-family: var(--kl-font-display); font-weight: 600; font-size: 34px; line-height: 1.2; letter-spacing: -.02em; }
.auth-head .accent { background: var(--kl-gradient-brand); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.auth-sub { font-size: 15px; line-height: 1.6; color: rgba(255,255,255,.7); max-width: 380px; }
.auth-feats { display: flex; flex-direction: column; gap: 16px; }
.auth-feat { display: flex; align-items: center; gap: 12px; font-size: 14px; color: rgba(255,255,255,.86); }
.auth-feat .fk {
  width: 34px; height: 34px; border-radius: 9px; flex: none; display: flex; align-items: center; justify-content: center;
  background: rgba(22,163,74,.18); border: 1px solid rgba(22,163,74,.4); color: var(--kl-green-300);
}
.auth-feat .fk .ic { font-size: 17px; }
.auth-logo .mk--logo {
  width: auto; min-width: 46px; height: 46px; padding: 0 14px; border-radius: 12px;
  background: #fff; box-shadow: var(--kl-shadow-sm);
}
.auth-logo .mk--logo img { height: 22px; width: auto; display: block; }
.powered { display: inline-flex; align-items: center; gap: 12px; font-size: 12px; line-height: 1; color: rgba(255,255,255,.5); font-weight: 500; }
.powered > span:last-child { display: inline-flex; align-items: center; }
.powered .genmark, .powered .lattice { color: var(--kl-green-300); }
.powered__logo { height: 15px; width: auto; display: block; filter: brightness(0) invert(1); opacity: .92; }
.powered__mark { width: 34px; height: 34px; flex: none; border-radius: 9px; background: #fff; box-shadow: var(--kl-shadow-sm); display: flex; align-items: center; justify-content: center; }
.powered__mark img { width: 22px; height: 22px; display: block; }
.powered b { color: rgba(255,255,255,.78); font-weight: 600; }
.powered__tail { color: rgba(255,255,255,.4); }
.powered--light { color: var(--kl-fg-3); }
.powered--light .powered__mark { border: 1px solid var(--kl-green-200); }
.powered--light b { color: var(--kl-ink); }

.auth-form { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 48px; }
.auth-card { width: 100%; max-width: 372px; display: flex; flex-direction: column; gap: 20px; }
.auth-card__head h2 { font-family: var(--kl-font-display); font-weight: 600; font-size: 24px; color: var(--kl-ink); margin: 0; letter-spacing: -.01em; }
.auth-card__head p { font-size: 13.5px; color: var(--kl-fg-3); margin: 6px 0 0; }
.auth-fine { font-size: 12px; color: var(--kl-fg-4); line-height: 1.6; text-align: center; }
.auth-fine a { color: var(--kl-link); font-weight: 600; }
.auth-row-between { display: flex; align-items: center; justify-content: space-between; }

/* ==========================================================================
   LOGIN — mobile
   ========================================================================== */
.auth-m { height: 100%; display: flex; flex-direction: column; background: #fff; }
.auth-m__top {
  position: relative; overflow: hidden; flex: none; padding: 70px 28px 30px;
  background: linear-gradient(160deg, var(--kl-green-50) 0%, #fff 100%);
  border-bottom: 1px solid var(--kl-border);
}
.auth-m__top .lat { position: absolute; right: -40px; top: -30px; width: 180px; height: 180px; color: var(--kl-green-200); opacity: .55; }
.auth-m__logo { position: relative; z-index: 1; display: flex; align-items: center; gap: 11px; }
.auth-m__logo .mk { width: 42px; height: 42px; border-radius: 11px; flex: none; display: flex; align-items: center; justify-content: center; background: var(--kl-gradient-brand); color: #fff; box-shadow: var(--kl-shadow-sm); }
.auth-m__logo .mk--logo-light { width: auto; min-width: 42px; padding: 0 13px; background: #fff; border: 1px solid var(--kl-green-200); box-shadow: var(--kl-shadow-sm); }
.auth-m__logo .mk--logo-light img { height: 20px; width: auto; display: block; }
.auth-m__logo .nm { font-family: var(--kl-font-display); font-weight: 600; font-size: 19px; color: var(--kl-ink); }
.auth-m__logo .sub { font-family: var(--kl-font-mono); font-size: 10px; color: var(--kl-fg-4); margin-top: 2px; }
.auth-m__tagline { position: relative; z-index: 1; margin-top: 18px; font-family: var(--kl-font-display); font-weight: 600; font-size: 20px; line-height: 1.35; color: var(--kl-ink); letter-spacing: -.01em; }
.auth-m__body { flex: 1; min-height: 0; overflow: auto; padding: 26px 28px; display: flex; flex-direction: column; gap: 18px; }
.auth-m__foot { flex: none; padding: 14px 28px 30px; }

/* ==========================================================================
   SETTINGS LAYOUT (grouped vertical sub-nav)
   ========================================================================== */
.set-layout { display: grid; grid-template-columns: 224px 1fr; gap: 22px; align-items: start; }
.set-nav { display: flex; flex-direction: column; gap: 6px; position: sticky; top: 4px; }
.set-nav__grp { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }
.set-nav__label { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--kl-fg-4); padding: 4px 10px 6px; }
.set-nav__item { position: relative; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--kl-r-sm);
  font-size: 13.5px; font-weight: 600; color: var(--kl-fg-2); text-align: left; transition: background .14s, color .14s; }
.set-nav__item .ic { color: var(--kl-fg-4); transition: color .14s; }
.set-nav__item:hover { background: var(--kl-bg-3); }
.set-nav__item.is-active { background: var(--kl-green-50); color: var(--kl-green-800); }
.set-nav__item.is-active .ic { color: var(--kl-primary); }
.set-nav__rail { position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: var(--kl-primary); }
.set-nav__badge { font-family: var(--kl-font-mono); font-size: 11px; font-weight: 700; color: var(--kl-fg-3);
  background: var(--kl-bg-3); border-radius: 99px; padding: 1px 8px; }
.set-nav__item.is-active .set-nav__badge { background: var(--kl-green-200); color: var(--kl-green-800); }
.set-body { min-width: 0; }

/* member row */
.mbr-row { display: flex; align-items: center; gap: 13px; padding: 13px 0; border-top: 1px solid var(--kl-border); }
.mbr-row:first-child { border-top: 0; }
.role-select { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 1px solid var(--kl-border-strong);
  border-radius: var(--kl-r-sm); background: #fff; font-size: 12.5px; font-weight: 600; color: var(--kl-fg-2); cursor: pointer; }
.role-select:hover { border-color: var(--kl-primary); }

/* ==========================================================================
   MOBILE BOTTOM SHEET
   ========================================================================== */
.msheet-scrim { position: absolute; inset: 0; z-index: 60; background: rgba(7,20,13,.45); backdrop-filter: blur(2px);
  display: flex; align-items: flex-end; animation: msheet-fade .18s ease both; }
.msheet { width: 100%; max-height: 86%; display: flex; flex-direction: column; background: var(--kl-bg-2);
  border-radius: 20px 20px 0 0; box-shadow: var(--kl-shadow-lg); animation: msheet-up .26s cubic-bezier(.2,.7,.2,1) both; }
.msheet__grab { width: 38px; height: 4px; border-radius: 99px; background: var(--kl-border-strong); margin: 9px auto 2px; flex: none; }
.msheet__head { display: flex; align-items: center; gap: 10px; padding: 8px 16px 12px; flex: none; }
.msheet__title { font-family: var(--kl-font-display); font-weight: 600; font-size: 17px; color: var(--kl-ink); flex: 1; }
.msheet__body { flex: 1; min-height: 0; overflow: auto; padding: 0 16px 8px; }
.msheet__foot { flex: none; padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--kl-border); background: #fff; }
@keyframes msheet-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes msheet-up { from { transform: translateY(100%); } to { transform: none; } }

/* mobile tappable list row affordance */
.m-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--kl-border); width: 100%; text-align: left; transition: background .14s; }
.m-row:last-child { border-bottom: 0; }
.m-row:active { background: var(--kl-bg-3); }

/* ==========================================================================
   USAGE GUIDE (ProtoGuide) — harness tour + per-version quick-start
   ========================================================================== */
.pg-scrim {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: rgba(7,20,13,.46); backdrop-filter: blur(2px);
  animation: pg-fade .18s ease both;
}
.pg-scrim--top { align-items: flex-start; }
.pg-scrim--top .pg-card { margin-top: calc(var(--proto-bar-h) + 12px); }
@keyframes pg-fade { from { opacity: 0; } to { opacity: 1; } }

.pg-card {
  position: relative; width: 400px; max-width: 100%;
  background: var(--kl-bg-1); border: 1px solid var(--kl-border);
  border-radius: var(--kl-r-lg); box-shadow: var(--kl-shadow-lg);
  padding: 20px; font-family: var(--kl-font-body);
}
.pg-card--tour { width: 380px; text-align: center; }

/* little up-pointer tying the harness card to the proto-bar */
.pg-arrow {
  position: absolute; top: -7px; left: 50%; transform: translateX(-50%) rotate(45deg);
  width: 12px; height: 12px; background: var(--kl-bg-1);
  border-left: 1px solid var(--kl-border); border-top: 1px solid var(--kl-border);
}

.pg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.pg-kicker {
  font-family: var(--kl-font-body); font-weight: 700; font-size: 11px;
  letter-spacing: .12em; text-transform: uppercase; color: var(--kl-green-600);
}
.pg-count { font-family: var(--kl-font-mono); font-size: 12px; color: var(--kl-fg-3); }
.pg-title {
  font-family: var(--kl-font-display); font-weight: 600; font-size: 18px;
  line-height: 1.25; letter-spacing: -0.01em; color: var(--kl-ink); margin: 4px 0 0;
}
.pg-card--tour .pg-title { font-size: 19px; margin: 12px 0 0; }

.pg-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.pg-row { display: flex; align-items: flex-start; gap: 12px; }
.pg-ic, .pg-step-ic {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  border-radius: var(--kl-r-md); background: var(--kl-green-50); color: var(--kl-green-600);
}
.pg-ic { width: 34px; height: 34px; }
.pg-ic .ic { font-size: 18px; }
.pg-row-t { font-weight: 600; font-size: 14px; color: var(--kl-ink); }
.pg-row-d { font-size: 13px; line-height: 1.5; color: var(--kl-fg-3); margin-top: 2px; }

.pg-step { padding: 6px 0 4px; }
.pg-step-ic { width: 52px; height: 52px; margin: 0 auto; }
.pg-step-ic .ic { font-size: 26px; }
.pg-step-d { font-size: 14px; line-height: 1.6; color: var(--kl-fg-2); margin: 8px auto 0; max-width: 300px; }

.pg-dots { display: flex; justify-content: center; gap: 6px; margin: 18px 0; }
.pg-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--kl-border-strong); transition: all .18s; }
.pg-dots i.is-on { width: 18px; border-radius: 3px; background: var(--kl-primary); }

.pg-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pg-foot-r { display: flex; align-items: center; gap: 8px; }

@media (prefers-reduced-motion: reduce) { .pg-scrim { animation: none; } }
.pg-head-stack { margin-bottom: 16px; }
.pg-head-stack .pg-title { margin-top: 6px; }
