:root {

  --brand-1: #6366f1;
  --brand-2: #22d3ee;
  --brand-3: #8b5cf6;

  --brand-text: #22d3ee;
  --grad-brand: linear-gradient(135deg, #6366f1 0%, #22d3ee 100%);
  --grad-brand-soft: linear-gradient(135deg, rgba(99, 102, 241, .22) 0%, rgba(34, 211, 238, .14) 100%);
  --grad-deep: radial-gradient(1100px 620px at 12% -10%, rgba(99, 102, 241, .30) 0%, transparent 62%),
               radial-gradient(900px 560px at 108% 8%, rgba(34, 211, 238, .20) 0%, transparent 60%),
               radial-gradient(700px 520px at 50% 118%, rgba(139, 92, 246, .22) 0%, transparent 62%);

  --bg: #070b14;
  --bg-2: #0a1020;
  --surface: rgba(255, 255, 255, .045);
  --surface-2: rgba(255, 255, 255, .075);
  --surface-3: rgba(255, 255, 255, .105);
  --surface-solid: #0f1626;
  --grad-card: linear-gradient(160deg, rgba(255, 255, 255, .070) 0%, rgba(255, 255, 255, .028) 100%);

  --text: #eaf0ff;
  --text-2: #a9b7d6;

  --text-3: #7887ab;

  --line: rgba(255, 255, 255, .10);
  --line-2: rgba(255, 255, 255, .17);

  --ok: #34d399;
  --err: #fb7185;
  --warn: #fbbf24;
  --info: #38bdf8;
  --ok-soft: rgba(52, 211, 153, .15);
  --err-soft: rgba(251, 113, 133, .15);
  --warn-soft: rgba(251, 191, 36, .15);
  --info-soft: rgba(56, 189, 248, .15);
  --brand-soft: rgba(99, 102, 241, .16);

  --sh-1: 0 1px 2px rgba(0, 0, 0, .32);
  --sh-2: 0 8px 24px rgba(0, 0, 0, .38);
  --sh-3: 0 20px 52px rgba(0, 0, 0, .48);
  --sh-glow: 0 10px 30px rgba(99, 102, 241, .34);
  --sh-inset: inset 0 1px 0 rgba(255, 255, 255, .07);

  --r-xs: 6px;
  --r-sm: 9px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-pill: 999px;

  --titlebar-h: 34px;
  --topbar-h: 60px;
  --statusbar-h: 32px;
  --sidebar-w: 190px;

  --ease: cubic-bezier(.22, .61, .36, 1);
  --t-fast: .14s var(--ease);
  --t: .22s var(--ease);
  --t-slow: .4s var(--ease);

  --font: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Source Han Sans SC",
          system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Cascadia Mono", "Consolas", "SFMono-Regular", "JetBrains Mono", "Courier New", monospace;
}

[data-theme="light"] {
  --bg: #f4f6fc;
  --bg-2: #eaeefb;
  --surface: rgba(255, 255, 255, .86);
  --surface-2: rgba(255, 255, 255, .96);
  --surface-3: #ffffff;
  --surface-solid: #ffffff;
  --grad-card: linear-gradient(160deg, #ffffff 0%, #f7f9ff 100%);
  --grad-deep: radial-gradient(1100px 620px at 10% -12%, rgba(99, 102, 241, .20) 0%, transparent 60%),
               radial-gradient(900px 560px at 108% 6%, rgba(34, 211, 238, .18) 0%, transparent 58%),
               radial-gradient(720px 520px at 50% 118%, rgba(139, 92, 246, .14) 0%, transparent 62%);

  --text: #131c33;
  --text-2: #4d5c7c;

  --brand-text: #4f46e5;

  --text-3: #5f6b88;

  --line: rgba(19, 28, 51, .11);
  --line-2: rgba(19, 28, 51, .18);

  --ok: #047857;
  --err: #be123c;
  --warn: #b45309;
  --info: #0369a1;
  --ok-soft: rgba(5, 150, 105, .12);
  --err-soft: rgba(225, 29, 72, .11);
  --warn-soft: rgba(217, 119, 6, .13);
  --info-soft: rgba(2, 132, 199, .12);
  --brand-soft: rgba(99, 102, 241, .12);

  --sh-1: 0 1px 2px rgba(19, 28, 51, .07);
  --sh-2: 0 10px 26px rgba(19, 28, 51, .10);
  --sh-3: 0 22px 52px rgba(19, 28, 51, .16);
  --sh-glow: 0 10px 26px rgba(99, 102, 241, .26);
  --sh-inset: inset 0 1px 0 rgba(255, 255, 255, .9);
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; height: 100dvh; max-height: 100%; max-height: 100dvh; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: .2px; }
p { margin: 0; }
a { color: var(--brand-text); text-decoration: none; }
b, strong { font-weight: 650; }
code { font-family: var(--font-mono); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
svg { display: block; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--line-2);
  border-radius: var(--r-pill);
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-3); background-clip: content-box; }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--brand-text);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

.ic { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ic-14 { width: 14px; height: 14px; }
.ic-16 { width: 16px; height: 16px; }
.ic-18 { width: 18px; height: 18px; }
.ic-20 { width: 20px; height: 20px; }
.ic-22 { width: 22px; height: 22px; }
.ic-26 { width: 26px; height: 26px; stroke-width: 1.5; }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

.screen { position: fixed; inset: var(--titlebar-h) 0 0 0; display: none; }
.screen.active { display: block; }

#screen-login {
  display: none;
  overflow: auto;
  background: var(--bg);
}
#screen-login.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: safe center;
  padding: 24px 0 32px;
}

.login-aurora {
  position: fixed; inset: 0;
  background: var(--grad-deep);
  pointer-events: none;
}
.login-aurora::after {
  content: "";
  position: absolute; left: 50%; top: -18%;
  width: 620px; height: 620px; margin-left: -310px;
  background: conic-gradient(from 210deg, rgba(99, 102, 241, .30), rgba(34, 211, 238, .22), rgba(139, 92, 246, .26), rgba(99, 102, 241, .30));
  filter: blur(90px);
  opacity: .55;
  border-radius: 50%;
  animation: auroraSpin 34s linear infinite;
}
.login-grid {
  position: fixed; inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px),
                    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(720px 520px at 50% 34%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(720px 520px at 50% 34%, #000 0%, transparent 78%);
  opacity: .5;
  pointer-events: none;
}
@keyframes auroraSpin { to { transform: rotate(360deg); } }

.login-card {
  position: relative;
  width: min(452px, calc(100vw - 36px));
  margin: 0 auto;
  padding: 24px 26px 18px;
  background: var(--grad-card), var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-3), var(--sh-inset);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  animation: cardIn .5s var(--ease) both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to { opacity: 1; transform: none; }
}

.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.login-brand-text { flex: 1; min-width: 0; }
.login-brand h1 {
  font-size: 21px;
  line-height: 1.25;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.login-brand p { font-size: 12px; color: var(--text-3); margin-top: 2px; }

.brand-mark {
  display: grid; place-items: center;
  width: 34px; height: 34px; flex: 0 0 auto;
  color: #fff;
  background: var(--grad-brand);
  border-radius: var(--r-md);
  box-shadow: var(--sh-glow);
}
.brand-mark.lg { width: 44px; height: 44px; border-radius: var(--r-lg); }
.brand-mark.lg .ic { width: 26px; height: 26px; }

.ver-chip {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 3px 9px;
  white-space: nowrap;
}
.ver-chip.sm { font-size: 10.5px; padding: 2px 8px; }

.machine-bar {
  display: flex; align-items: center; gap: 8px;
  margin-top: 16px;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px dashed var(--line-2);
  border-radius: var(--r-md);
  flex-wrap: wrap;
}
.mb-ic { color: var(--brand-text); display: grid; place-items: center; }
.mb-label { font-size: 12px; color: var(--text-3); flex: 0 0 auto; }
.mb-code {
  flex: 1; min-width: 0;
  font-size: 12px;
  color: var(--text-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  cursor: pointer;
  letter-spacing: .4px;
}
.mb-code:hover { color: var(--brand-text); }

.notice-strip {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 9px 11px;
  margin-top: 16px;
  background: var(--brand-soft);
  border: 1px solid rgba(99, 102, 241, .28);
  border-radius: var(--r-md);
  color: var(--text-2);
  font-size: 12.5px;
}
.notice-strip > .ic { margin-top: 2px; color: var(--brand-text); }
.ns-body { min-width: 0; flex: 1; display: flex; gap: 6px; align-items: flex-start; }
.ns-tag {
  flex: 0 0 auto;
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: var(--r-pill);
  background: var(--grad-brand);
  color: #fff;
  letter-spacing: .5px;
}
.ns-text {
  min-width: 0; flex: 1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.55;
}

.login-foot { margin-top: 16px; }
.foot-actions {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; margin-top: 12px; flex-wrap: wrap;
}
.copyright { text-align: center; font-size: 11.5px; color: var(--text-3); margin-top: 10px; }
.login-row { margin: 2px 0 14px; }

.app-shell {
  position: absolute; inset: 0;
  display: grid;
  grid-template-rows: var(--topbar-h) minmax(0, 1fr) var(--statusbar-h);
  background: var(--bg-2);
}
.app-shell::before {
  content: ""; position: absolute; inset: 0;
  background: var(--grad-deep);
  opacity: .75;
  pointer-events: none;
}

.topbar {
  position: relative; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.tb-left { display: flex; align-items: center; gap: 9px; min-width: 0; flex: 0 1 auto; }
.tb-name { font-size: 15px; font-weight: 650; letter-spacing: .4px; white-space: nowrap; }
.tb-right { display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-width: 0; flex: 1 1 auto; }
.tb-right > .btn, .tb-right > .badge, .tb-vip { flex: 0 0 auto; }
.tb-user { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 0 1 auto; }
.avatar {
  display: grid; place-items: center;
  width: 30px; height: 30px; flex: 0 0 auto;
  border-radius: 50%;
  background: var(--grad-brand);
  color: #fff; font-weight: 700; font-size: 13px;
  box-shadow: var(--sh-1);
  text-transform: uppercase;
}
.tb-user-txt { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.tb-account { font-size: 13px; font-weight: 600; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-sub { font-size: 10.5px; color: var(--text-3); }
.tb-vip { display: flex; align-items: center; flex: 0 0 auto; }
.tb-meta { display: none; }
#topDaysBadge { flex: 0 0 auto; padding: 3px 10px; }
.kv { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-2); }

.app-body {
  position: relative; z-index: 10;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 0;
}

.sidebar {
  display: flex; flex-direction: column;
  gap: 10px;
  padding: 12px 10px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  min-height: 0;
  overflow: auto;
}
.nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 9px 11px;
  border-radius: var(--r-md);
  color: var(--text-2);
  font-size: 13.5px;
  text-align: left;
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item:active { transform: scale(.985); }
.nav-item.active {
  color: var(--text);
  background: var(--grad-brand-soft);
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, .35);
}

.nav-item span { flex: 1; }
.nav-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--brand-text);
  opacity: 0; transform: scale(.4);
  transition: opacity var(--t), transform var(--t);
}
.nav-item.active .nav-dot { opacity: 1; transform: none; }

.sidebar-foot { margin-top: auto; }
.srv-card {
  display: flex; align-items: center; gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text-2);
  transition: border-color var(--t-fast), color var(--t-fast);
}
.srv-card:hover { border-color: var(--line-2); color: var(--text); }
.srv-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; text-align: left; }
.srv-k { font-size: 10px; color: var(--text-3); }
.srv-v { font-size: 11.5px; font-family: var(--font-mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 122px; }

.content {
  min-width: 0; min-height: 0;
  overflow: auto;
  padding: 16px 18px 24px;
  scroll-behavior: smooth;
}

.statusbar {
  position: relative; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  height: var(--statusbar-h);
  min-height: var(--statusbar-h);
  box-sizing: border-box;
  padding: 0 14px;
  font-size: 11.5px;
  color: var(--text-3);
  background: var(--surface);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.sb-group { display: flex; align-items: center; gap: 9px; min-width: 0; }
.sb-item { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; min-width: 0; }
#sbServer, #sbUdid {
  max-width: min(240px, 32vw);
  overflow: hidden;
  text-overflow: ellipsis;
}
.sb-item b { color: var(--text-2); font-weight: 600; }
.dot-sep { width: 1px; height: 11px; background: var(--line-2); flex: 0 0 auto; }
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-3);
  flex: 0 0 auto;
  transition: background var(--t), box-shadow var(--t);
}
.status-dot.ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.status-dot.bad { background: var(--err); box-shadow: 0 0 0 3px var(--err-soft); }
.status-dot.warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }

.link.xs { font-size: 11.5px; }

.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 15px;
  border-radius: var(--r-md);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: transform var(--t-fast), background var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast), opacity var(--t-fast);
  user-select: none;
}
.btn:active:not(:disabled) { transform: translateY(1px) scale(.995); }
.btn:disabled, .btn.is-loading { opacity: .62; cursor: not-allowed; pointer-events: none; }

.btn-primary { background: var(--grad-brand); color: #fff; box-shadow: var(--sh-glow); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.07); box-shadow: 0 12px 34px rgba(99, 102, 241, .42); }

.btn-ghost {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--line);
}
.btn-ghost:hover:not(:disabled) { background: var(--surface-3); border-color: var(--line-2); }

.btn-soft { background: var(--brand-soft); color: var(--brand-text); border-color: rgba(99, 102, 241, .3); }
.btn-soft:hover:not(:disabled) { background: rgba(99, 102, 241, .24); }

.btn-danger { background: var(--err-soft); color: var(--err); border-color: rgba(251, 113, 133, .34); }
.btn-danger:hover:not(:disabled) { background: rgba(251, 113, 133, .24); }

.btn-block { width: 100%; height: 42px; font-size: 14.5px; letter-spacing: 2px; }
.btn-sm { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: var(--r-sm); gap: 5px; }
.btn-xs { height: 25px; padding: 0 9px; font-size: 11.5px; border-radius: var(--r-xs); gap: 4px; }

.link {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--text-3);
  font-size: 12.5px;
  transition: color var(--t-fast);
}
.link:hover { color: var(--brand-text); }

.ghost-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 5px;
  flex: 0 0 auto;
  height: 26px; padding: 0 9px;
  border-radius: var(--r-xs);
  font-size: 12px;
  color: var(--brand-text);
  background: var(--brand-soft);
  border: 1px solid rgba(99, 102, 241, .3);
  transition: background var(--t-fast), border-color var(--t-fast), opacity var(--t-fast);
}
.ghost-btn:hover:not(:disabled) { background: rgba(99, 102, 241, .24); border-color: rgba(99, 102, 241, .3); }
.ghost-btn:disabled { opacity: .62; cursor: not-allowed; pointer-events: none; }

.icon-btn {
  display: grid; place-items: center;
  width: 30px; height: 30px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  border: 1px solid transparent;
  transition: background var(--t-fast), color var(--t-fast);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

.spin {
  display: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  animation: spin .7s linear infinite;
}

.is-loading .spin { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

form { margin: 0; }
.field { margin-bottom: 13px; }
.field:last-child { margin-bottom: 0; }

.btn .label { color: inherit; font-size: inherit; margin-bottom: 0; }
.label {
  display: flex; align-items: baseline; gap: 5px;
  font-size: 12.5px;
  color: var(--text-2);
  margin-bottom: 6px;
}
.control {
  display: flex; align-items: center; gap: 8px;
  padding: 0 10px;
  height: 40px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: visible;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.control > .ghost-btn { flex: 0 0 auto; white-space: nowrap; }
.control:hover { border-color: var(--line-2); }
.control:focus-within {
  border-color: rgba(99, 102, 241, .66);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .16);
  background: var(--surface-2);
}
.ctl-ic { color: var(--text-3); }
.control:focus-within .ctl-ic { color: var(--brand-text); }

.input, .select, .textarea {
  flex: 1 1 auto; min-width: 0;

  height: 22px;
  line-height: 1.45;
  padding: 0 8px 0 6px;
  overflow: visible;
  text-overflow: clip;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  outline: none;
  font-size: 13.5px;
  color: var(--text);
}
.input::placeholder, .textarea::placeholder {
  color: var(--text-3);
  opacity: 1;
  overflow: visible;
  text-overflow: clip;
}
.input:-webkit-autofill,
.input:-webkit-autofill:hover,
.input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--surface-solid) inset;
  transition: background-color 9999s ease-out;
}

.control.col { height: auto; padding: 0; align-items: stretch; }
.textarea {
  height: auto;
  min-height: 84px;
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.6;
  font-family: var(--font);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.textarea:focus { border-color: rgba(99, 102, 241, .66); box-shadow: 0 0 0 3px rgba(99, 102, 241, .16); }

.select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 18px;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 8px) 9px, calc(100% - 3px) 9px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}
.select option { background: var(--surface-solid); color: var(--text); }

.field.invalid .control,
.field.invalid .textarea { border-color: rgba(251, 113, 133, .62); }
.field.invalid .control:focus-within { box-shadow: 0 0 0 3px var(--err-soft); }
.err {
  display: none;
  font-size: 11.5px;
  color: var(--err);
  margin-top: 5px;
  padding-left: 2px;
  animation: errIn .18s var(--ease);
}
.field.invalid .err, .err.show { display: block; }
@keyframes errIn { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }

.check { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); cursor: pointer; user-select: none; }
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check .box {
  display: grid; place-items: center;
  width: 17px; height: 17px; flex: 0 0 auto;
  border-radius: var(--r-xs);
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: transparent;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.check:hover .box { border-color: var(--brand-1); }
.check input:checked + .box { background: var(--grad-brand); border-color: transparent; color: #fff; }
.check input:focus-visible + .box { outline: 2px solid var(--brand-text); outline-offset: 2px; }
.check.agree { margin: 4px 0 12px; align-items: flex-start; line-height: 1.5; }
.check.agree .box { margin-top: 2px; }

.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
#form-reg .grid-2 { grid-template-columns: minmax(0, 1fr); }

.hint-box {
  display: flex; align-items: flex-start; gap: 7px;
  padding: 8px 10px;
  margin: 2px 0 14px;
  font-size: 12px;
  color: var(--text-3);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.hint-box .ic { margin-top: 2px; color: var(--info); }

.tabs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.tab {
  height: 32px;
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--text-3);
  transition: background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--surface-3); color: var(--text); box-shadow: var(--sh-1); font-weight: 600; }
.tab-panel { display: none; animation: fadeUp .26s var(--ease); }
.tab-panel.active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.segment { display: flex; flex-wrap: wrap; gap: 8px; }
.seg-item {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 13px;
  color: var(--text-2);
  transition: border-color var(--t-fast), background var(--t-fast), color var(--t-fast);
}
.seg-item:hover { border-color: var(--line-2); color: var(--text); }
.seg-item.on {
  border-color: rgba(99, 102, 241, .6);
  background: var(--brand-soft);
  color: var(--text);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .12);
}
.seg-item .tick {
  display: grid; place-items: center;
  width: 15px; height: 15px; border-radius: 50%;
  border: 1px solid var(--line-2);
  color: transparent;
}
.seg-item.on .tick { background: var(--grad-brand); border-color: transparent; color: #fff; }
.pay-ic { font-size: 15px; line-height: 1; }

.page { max-width: 1100px; }
.content.enter .page { animation: pageIn .3s var(--ease); }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.page-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px; flex-wrap: wrap;
}
.page-title { display: flex; align-items: center; gap: 9px; font-size: 17px; }
.page-title .ic { color: var(--brand-text); }
.page-sub { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.card {
  background: var(--grad-card), var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.card + .card { margin-top: 14px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  padding: 12px 15px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.card-title { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 650; }
.card-title .ic { color: var(--brand-text); }
.card-title .count { font-size: 11px; color: var(--text-3); font-weight: 400; }
.card-body { padding: 15px; }
.card-body.tight { padding: 11px 15px; }
.card-body.flush { padding: 0; }

.cols { display: grid; gap: 14px; align-items: start; }
.cols.split { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
.cols.side { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: stretch; }

.cols.side > .card {
  display: flex;
  flex-direction: column;
}
.cols.side > .card .card-body,
.cols.side > .card .bubbles { flex: 1 1 auto; min-height: 0; }

.cols.side.about { align-items: start; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(126px, 1fr)); gap: 10px; }
.stat {
  min-height: 70px;

  padding: 11px 14px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: border-color var(--t-fast), transform var(--t-fast);
}
.stat:hover { border-color: var(--line-2); transform: translateY(-1px); }
.stat-k { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--text-3); }
.stat-v { font-size: 17px; font-weight: 700; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-v.mono { font-family: var(--font-mono); font-size: 14px; }

.kv-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2px 22px; }
.kv-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 9px 2px;
  border-bottom: 1px dashed var(--line);
  font-size: 13px;
  min-width: 0;
}
.kv-row:last-child { border-bottom: 0; }
.kv-k { display: flex; align-items: center; gap: 6px; color: var(--text-3); font-size: 12.5px; white-space: nowrap; flex: 0 0 auto; }
.kv-v { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; color: var(--text); min-width: 0; flex: 1 1 auto; text-align: right; }
.kv-v .ghost-btn { flex: 0 0 auto; }
.kv-v .mono {
  font-family: var(--font-mono); font-size: 12.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  min-width: 0;
}

.kv-v .mono.full { max-width: none; overflow: visible; text-overflow: clip; letter-spacing: .2px; }

.act-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(124px, 1fr));
  gap: 8px;
  width: 100%;
  min-width: 0;
}
.act-grid .btn { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

.goods-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(216px, 1fr)); gap: 12px; }
.goods {
  position: relative;
  display: flex; flex-direction: column;
  padding: 14px;
  border-radius: var(--r-lg);
  background: var(--grad-card), var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
  transition: transform var(--t), border-color var(--t), box-shadow var(--t);
}
.goods::after {
  content: "";
  position: absolute; inset: 0 0 auto 0; height: 2px;
  background: var(--grad-brand);
  opacity: 0;
  transition: opacity var(--t);
}
.goods:hover { transform: translateY(-3px); border-color: var(--line-2); box-shadow: var(--sh-2); }
.goods:hover::after { opacity: 1; }
.goods-top { display: flex; align-items: flex-start; gap: 10px; }
.goods-ic {
  display: grid; place-items: center;
  width: 38px; height: 38px; flex: 0 0 auto;
  border-radius: var(--r-md);
  background: var(--grad-brand-soft);
  color: var(--brand-text);
  border: 1px solid rgba(99, 102, 241, .26);
}

.goods-name {
  font-size: 14.5px; font-weight: 650; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.goods-desc {
  font-size: 12px; color: var(--text-3); margin-top: 8px; min-height: 34px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.goods-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: 12px; }
.price { display: flex; align-items: baseline; gap: 3px; }
.price .cur { font-size: 12px; color: var(--warn); }
.price .num { font-size: 20px; font-weight: 750; color: var(--warn); font-family: var(--font-mono); letter-spacing: -.5px; }
.price .unit { font-size: 11px; color: var(--text-3); }

.price-fen .num { color: var(--brand-text); }

.fen-zone { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px; background: var(--grad-brand-soft); }
.fen-zone-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; color: var(--brand-text); }
.fen-zone-head b { font-size: 14px; }
.fen-zone-head .muted { margin-left: auto; }

.table-wrap { overflow: auto; max-width: 100%; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; table-layout: fixed; }
.table th {
  position: sticky; top: 0; z-index: 2;
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .4px;
  color: var(--text-3);
  padding: 10px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--text-2);
  vertical-align: middle;
}

.table td:not([colspan]) {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.table td[colspan] { white-space: normal; overflow: visible; }

.table td.cell-goods { display: flex; align-items: center; gap: 6px; }
.table td.cell-goods .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table td.cell-goods .pay { flex: none; }
.table tbody tr { transition: background var(--t-fast); }
.table tbody tr:hover td { background: var(--surface); color: var(--text); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-family: var(--font-mono); }
.table .mono { font-family: var(--font-mono); font-size: 12px; }
.table .nowrap { white-space: nowrap; }
.table .strong { color: var(--text); font-weight: 600; }
.table .act-cell { text-align: right; white-space: nowrap; }
.table.compact td { padding: 8px 12px; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.65;
  white-space: nowrap;
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--line);
}
.badge[data-tone="ok"] { background: var(--ok-soft); color: var(--ok); border-color: rgba(52, 211, 153, .3); }
.badge[data-tone="err"] { background: var(--err-soft); color: var(--err); border-color: rgba(251, 113, 133, .3); }
.badge[data-tone="warn"] { background: var(--warn-soft); color: var(--warn); border-color: rgba(251, 191, 36, .3); }
.badge[data-tone="info"] { background: var(--info-soft); color: var(--info); border-color: rgba(56, 189, 248, .3); }
.badge[data-tone="brand"] { background: var(--brand-soft); color: #a5b4fc; border-color: rgba(99, 102, 241, .34); }
.badge[data-tone="muted"] { background: var(--surface-2); color: var(--text-3); }
[data-theme="light"] .badge[data-tone="brand"] { color: #4f46e5; }
.badge.dot::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.pager {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
}
.pager-info { font-size: 12px; color: var(--text-3); }
.pager-ctl { display: flex; align-items: center; gap: 5px; }
.pg {
  min-width: 29px; height: 29px;
  padding: 0 7px;
  display: inline-grid; place-items: center;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-2);
  font-size: 12.5px;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.pg:hover:not(:disabled) { color: var(--text); border-color: var(--line-2); background: var(--surface-2); }
.pg.on { background: var(--grad-brand); color: #fff; border-color: transparent; font-weight: 650; }
.pg:disabled { opacity: .38; cursor: not-allowed; }
.pg-gap { color: var(--text-3); padding: 0 2px; }

.page-fill { display: flex; flex-direction: column; }
.page-fill > .cols { flex: 1 1 auto; min-height: 0; }
.page-fill .card-body { display: flex; flex-direction: column; min-height: 0; }
.page-fill .msg-list,
.page-fill .bubbles { max-height: none; flex: 1 1 auto; min-height: 0; }

.page-fill .card-body > .pager,
.page-fill .reply-box { flex: 0 0 auto; }

.page-fill .cols > .card { min-height: 0; }
.page-fill .cols > .card > .msg-detail-head { flex: 0 0 auto; }
.page-fill .cols > .card > .bubbles { flex: 1 1 auto; min-height: 0; max-height: none; }
.page-fill .cols > .card > .reply-box { flex: 0 0 auto; }

@supports selector(:has(*)) {
  .content:has(> .page-fill) { display: flex; flex-direction: column; overflow: hidden; }
  .content:has(> .page-fill) > .page-fill { flex: 1 1 auto; min-height: 0; }
}

@supports not selector(:has(*)) {
  .page-fill { min-height: calc(100vh - var(--titlebar-h) - var(--topbar-h) - var(--statusbar-h) - 40px); }
}

.msg-list { display: flex; flex-direction: column; max-height: 430px; overflow: auto; }
.msg-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background var(--t-fast);
  text-align: left;
  width: 100%;
}
.msg-item:hover { background: var(--surface); }
.msg-item.active { background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--brand-1); }
.msg-ic {
  display: grid; place-items: center;
  width: 30px; height: 30px; flex: 0 0 auto;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text-3);
  border: 1px solid var(--line);
}
.msg-item.active .msg-ic { color: var(--brand-text); border-color: rgba(99, 102, 241, .3); }
.msg-main { min-width: 0; flex: 1; }
.msg-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.msg-title { font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-time { font-size: 11px; color: var(--text-3); flex: 0 0 auto; font-family: var(--font-mono); }
.msg-preview { font-size: 12px; color: var(--text-3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.msg-detail-head {

  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 10px; padding: 12px 15px; border-bottom: 1px solid var(--line);
}

.msg-detail-title {
  font-size: 14.5px; font-weight: 650;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow: hidden;
}
.msg-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; font-size: 11.5px; color: var(--text-3); }

.bubbles { display: flex; flex-direction: column; gap: 10px; padding: 14px 15px; max-height: 330px; overflow: auto; }
.bub { display: flex; flex-direction: column; max-width: 84%; }
.bub-head { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-3); margin-bottom: 3px; }
.bub-body {
  padding: 9px 12px;
  border-radius: var(--r-md);
  font-size: 13px;
  line-height: 1.62;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.bub.me { align-self: flex-end; }
.bub.me .bub-head { justify-content: flex-end; }
.bub.me .bub-body { background: var(--grad-brand-soft); border-color: rgba(99, 102, 241, .32); }
.bub-text + .bub-img { margin-top: 8px; }
.bub-img { display: block; }
.bub-img + .bub-img { margin-top: 6px; }
.bub-img img {
  display: block;
  max-width: 220px;
  max-height: 220px;
  border-radius: var(--r-sm);
  object-fit: cover;
}
.bub.sys { align-self: center; max-width: 100%; }
.bub.sys .bub-body { font-size: 11.5px; color: var(--text-3); background: transparent; border-style: dashed; }

.reply-box { padding: 12px 15px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 9px; }
.reply-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.reply-files { display: flex; flex-wrap: wrap; gap: 8px; }
.reply-files:empty { display: none; }
.file-chip { position: relative; width: 64px; height: 64px; }
.file-chip img { width: 64px; height: 64px; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--line); }
.file-x {
  position: absolute; top: -6px; right: -6px; width: 18px; height: 18px;
  border: 0; border-radius: 50%; background: var(--danger, #e11d48); color: #fff;
  font-size: 12px; line-height: 18px; cursor: pointer;
}

.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px;
  padding: 40px 20px;
  text-align: center;
}
.empty-art {
  position: relative;
  width: 108px; height: 84px;
  display: grid; place-items: center;
  border-radius: var(--r-lg);
  background: var(--grad-brand-soft);
  border: 1px dashed rgba(99, 102, 241, .4);
  color: var(--brand-text);
}
.empty-art::before,
.empty-art::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: var(--grad-brand);
  opacity: .5;
}
.empty-art::before { width: 7px; height: 7px; left: -3px; top: 12px; }
.empty-art::after { width: 5px; height: 5px; right: 6px; bottom: -2px; opacity: .34; }
.empty-art .ic { width: 38px; height: 38px; stroke-width: 1.4; }
.empty-title { font-size: 14px; font-weight: 600; }

.empty-desc { font-size: 12.5px; color: var(--text-3); max-width: 380px; text-wrap: pretty; }
.empty-actions { margin-top: 4px; display: flex; gap: 8px; }

.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--surface-2);
  border-radius: var(--r-sm);
  height: 12px;

  animation: skeletonIn .12s var(--ease) 160ms both;
}
@keyframes skeletonIn { from { opacity: 0; } to { opacity: 1; } }
.skeleton::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .10), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.35s infinite;
}
[data-theme="light"] .skeleton::after { background: linear-gradient(90deg, transparent, rgba(19, 28, 51, .07), transparent); }
@keyframes shimmer { to { transform: translateX(100%); } }
.sk-row { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.sk-row .skeleton { flex: 1; }
.sk-card { padding: 14px; display: flex; flex-direction: column; gap: 9px; }

.loading-inline { display: flex; align-items: center; justify-content: center; gap: 9px; padding: 34px; color: var(--text-3); font-size: 13px; }
.ring {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid var(--line-2);
  border-top-color: var(--brand-text);
  animation: spin .75s linear infinite;
}

.modal-host {
  position: fixed; inset: 0; z-index: 900;
  display: none;
  align-items: center; justify-content: center;
  padding: 20px;
}
.modal-host.show { display: flex; }
.modal-mask {
  position: absolute; inset: 0;
  background: rgba(3, 6, 14, .62);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: fadeIn .18s var(--ease);
}
[data-theme="light"] .modal-mask { background: rgba(19, 28, 51, .34); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  position: relative;
  width: min(432px, 100%);
  max-height: calc(100vh - 44px);
  display: flex; flex-direction: column;
  background: var(--surface-solid);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-3);
  animation: modalIn .24s var(--ease);
  overflow: hidden;
}
.modal.wide { width: min(560px, 100%); }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }

.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;

  padding: 12px 15px;
  border-bottom: 1px solid var(--line);
}
.modal-title { display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 650; }
.modal-title .ic { color: var(--brand-text); }
.modal-title.tone-err .ic { color: var(--err); }
.modal-title.tone-warn .ic { color: var(--warn); }
.modal-body { padding: 15px; overflow: auto; }
.modal-body .field:last-child { margin-bottom: 0; }
.modal-text { font-size: 13.5px; color: var(--text-2); line-height: 1.7; }
.modal-text + .modal-extra { margin-top: 12px; }
.modal-extra {
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--text-3);
}
.modal-foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 9px;
  padding: 12px 15px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.titlebar {
  position: fixed; left: 0; right: 0; top: 0; height: var(--titlebar-h);
  display: flex; align-items: center; gap: 8px; padding: 0 6px 0 12px;
  background: var(--surface-solid); border-bottom: 1px solid var(--line);
  z-index: 1000; user-select: none; -webkit-user-select: none; cursor: default;
}
.titlebar .tb-logo {
  width: 21px; height: 21px; border-radius: var(--r-xs); flex: 0 0 auto;
  display: grid; place-items: center; color: #fff;
  background: var(--grad-brand); box-shadow: 0 1px 6px rgba(99, 102, 241, .35);
}
.titlebar .tb-logo .ic { stroke-width: 2.1; }
.titlebar .tb-title { font-size: 12.5px; font-weight: 650; letter-spacing: .2px; }
.titlebar .tb-ver { font-size: 11px; color: var(--text-3); }
.titlebar .tb-spacer { flex: 1; }
.titlebar .tb-btn {
  width: 34px; height: 24px; flex: 0 0 auto;
  display: grid; place-items: center; cursor: pointer;
  border: 0; border-radius: var(--r-xs); background: transparent; color: var(--text-2);
  transition: background var(--t-fast), color var(--t-fast);
}
.titlebar .tb-btn:hover { background: rgba(148, 163, 184, .2); color: var(--text); }
.titlebar .tb-btn.danger:hover { background: #e5484d; color: #fff; }
.titlebar .tb-btn:active { transform: scale(.96); }

.rz-layer { position: fixed; inset: 0; z-index: 1300; pointer-events: none; }
.rz { position: absolute; pointer-events: auto; display: block; }
.rz-n, .rz-s { left: 10px; right: 10px; height: 4px; cursor: ns-resize; }
.rz-w, .rz-e { top: 10px; bottom: 10px; width: 4px; cursor: ew-resize; }
.rz-n { top: 0; } .rz-s { bottom: 0; } .rz-w { left: 0; } .rz-e { right: 0; }
.rz-nw, .rz-ne, .rz-sw, .rz-se { width: 12px; height: 12px; }
.rz-nw { top: 0; left: 0; cursor: nwse-resize; }
.rz-ne { top: 0; right: 0; cursor: nesw-resize; }
.rz-sw { bottom: 0; left: 0; cursor: nesw-resize; }
.rz-se { bottom: 0; right: 0; cursor: nwse-resize; }

body.win-busy { user-select: none; -webkit-user-select: none; }
body.win-busy, body.win-busy .titlebar { cursor: grabbing; }

#winFrame {
  position: fixed; inset: 0; z-index: 1400; pointer-events: none;
  border: 1px solid var(--line-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}
[data-theme="light"] #winFrame { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9); }
body.win-inactive #winFrame { border-color: var(--line); box-shadow: none; }
body.win-inactive .titlebar { opacity: .68; }
body.win-inactive .titlebar .tb-logo { box-shadow: none; }

.toast-host {

  position: fixed; right: 16px; bottom: calc(var(--statusbar-h) + 12px); z-index: 1000;
  display: flex; flex-direction: column; gap: 9px;
  pointer-events: none;
  max-width: min(360px, calc(100vw - 28px));
}
.toast {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 10px 19px 10px 12px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  border-radius: var(--r-md);
  background: var(--surface-solid);
  border: 1px solid var(--line-2);
  box-shadow: var(--sh-2);
  font-size: 13px;
  color: var(--text);
  pointer-events: auto;
  cursor: pointer;
  animation: toastIn .26s var(--ease);
  transition: opacity var(--t), transform var(--t);
}
.toast.out { opacity: 0; transform: translateY(10px) scale(.98); }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
.toast .t-ic { display: grid; place-items: center; width: 19px; height: 19px; border-radius: 50%; flex: 0 0 auto; margin-top: 1px; }
.toast .t-ic .ic { width: 13px; height: 13px; stroke-width: 2.2; }
.toast .t-txt { flex: 1; word-break: break-word; line-height: 1.55; }
.toast::after {
  content: "";
  position: absolute; left: 0; bottom: 0;
  height: 2px; width: 100%;
  border-radius: 0 0 var(--r-md) var(--r-md);
  background: currentColor;
  opacity: .5;
  animation: toastBar var(--toast-dur, 3000ms) linear forwards;
  transform-origin: left;
}
@keyframes toastBar { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.toast { position: relative; overflow: hidden; }
.toast.success { border-color: rgba(52, 211, 153, .38); color: var(--text); }
.toast.success .t-ic { background: var(--ok-soft); color: var(--ok); }
.toast.success::after { background: var(--ok); }
.toast.error { border-color: rgba(251, 113, 133, .38); }
.toast.error .t-ic { background: var(--err-soft); color: var(--err); }
.toast.error::after { background: var(--err); }
.toast.warn { border-color: rgba(251, 191, 36, .38); }
.toast.warn .t-ic { background: var(--warn-soft); color: var(--warn); }
.toast.warn::after { background: var(--warn); }
.toast.info .t-ic { background: var(--info-soft); color: var(--info); }
.toast.info::after { background: var(--info); }

.progress {
  height: 7px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--line);
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0;
  border-radius: var(--r-pill);
  background: var(--grad-brand);
  transition: width .3s var(--ease);
  position: relative;
  overflow: hidden;
}
.progress-bar::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .34), transparent);
  animation: shimmer 1.3s infinite;
}
.progress.lg { height: 10px; }

.ovl {
  position: fixed; inset: 0; z-index: 1100;
  display: none;
  align-items: center; justify-content: center;
  background: rgba(3, 6, 14, .74);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  padding: 20px;
}
.ovl.show { display: flex; }
.ovl-card {
  width: min(420px, 100%);
  padding: 24px;
  text-align: center;
  background: var(--surface-solid);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-3);
  animation: modalIn .26s var(--ease);
}
.ovl-card h3 { font-size: 15.5px; margin-bottom: 5px; }
.ovl-card .progress { margin: 16px 0 8px; }
.upd-ring {
  display: grid; place-items: center;
  width: 50px; height: 50px; margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--grad-brand-soft);
  border: 1px solid rgba(99, 102, 241, .34);
  color: var(--brand-text);
  animation: pulse 1.9s var(--ease) infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, .34); }
  50% { box-shadow: 0 0 0 12px rgba(99, 102, 241, 0); }
}
.upd-pct { font-size: 22px; font-weight: 750; font-family: var(--font-mono); color: var(--brand-text); }

.spinner-page {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; height: 100%; min-height: 260px;
  color: var(--text-3); font-size: 13px;
}
.spinner-page .ring { width: 26px; height: 26px; border-width: 3px; }

.muted { color: var(--text-3); }
.small { font-size: 12px; }
.xs { font-size: 11.5px; }
.mono { font-family: var(--font-mono); }
.strong { font-weight: 650; color: var(--text); }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-0 { margin-bottom: 0; }
.mb-4 { margin-bottom: 4px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-1 { flex: 1; min-width: 0; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }

.gap-12 { gap: 12px; }
.wrap { flex-wrap: wrap; }
.text-ok { color: var(--ok); }
.text-err { color: var(--err); }
.text-warn { color: var(--warn); }
.text-info { color: var(--info); }
.text-brand { color: var(--brand-text); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pre-wrap { white-space: pre-wrap; word-break: break-word; }
.hidden { display: none !important; }
.divider { height: 1px; background: var(--line); margin: 13px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cfg-foot { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.cfg-foot .muted { margin: 0; line-height: 1.55; }
.cfg-btns { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }

.img-preview {
  position: fixed; inset: 0; z-index: 1200;
  display: flex; align-items: center; justify-content: center;
  background: rgba(4, 7, 16, .84);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  padding: 28px;
  cursor: zoom-out;
}
.img-preview[hidden] { display: none; }
.img-preview img {
  max-width: 94vw; max-height: 86vh;
  border-radius: var(--r-md);
  box-shadow: 0 26px 70px rgba(0, 0, 0, .55);
  background: #fff;
}
.img-preview-tip {
  position: absolute; left: 0; right: 0; bottom: 16px;
  text-align: center; font-size: 12px; color: rgba(255, 255, 255, .72);
}

.bub-img {
  display: block; padding: 0; border: 0; background: none;
  cursor: zoom-in; line-height: 0;
}
.bub-img:focus-visible { outline: 2px solid var(--brand, #6366f1); outline-offset: 3px; }

.emoji-panel {
  margin-top: 8px;
  max-height: 170px;
  overflow: auto;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(127, 127, 127, .07);
}
.emoji-panel[hidden] { display: none; }
.emoji-group + .emoji-group { margin-top: 8px; }
.emoji-group-t { font-size: 11px; color: var(--text-3); margin-bottom: 4px; }
.emoji-row { display: flex; flex-wrap: wrap; gap: 2px; }
.emoji-item {
  width: 30px; height: 30px; line-height: 1; padding: 0;
  border: 0; border-radius: var(--r-xs); background: none;
  font-size: 18px; cursor: pointer;
}
.emoji-item:hover { background: rgba(127, 127, 127, .16); }

@media (max-width: 1000px) {
  :root { --sidebar-w: 164px; }
  .content { padding: 14px 14px 22px; }

  .cols.split { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 720px) {
  .page-head { align-items: flex-start; }
  .tb-right .btn span { display: none; }
}

@media (max-width: 900px) {

  .cols.side { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
  .app-shell { grid-template-rows: var(--topbar-h) minmax(0, 1fr) auto; }
  .app-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .sidebar {
    flex-direction: row; align-items: center;
    gap: 8px; padding: 8px 10px;
    border-right: 0; border-bottom: 1px solid var(--line);
    overflow-x: auto; overflow-y: hidden;
  }
  .nav { flex-direction: row; gap: 6px; flex: 0 0 auto; }
  .nav-item { width: auto; padding: 7px 10px; font-size: 12.5px; white-space: nowrap; }
  .nav-item.active::before { display: none; }
  .nav-item span { flex: 0 0 auto; }
  .nav-dot { display: none; }
  .sidebar-foot { margin-top: 0; margin-left: auto; }
  .srv-txt { display: none; }
  .srv-card { padding: 7px; }
  .statusbar { flex-wrap: wrap; gap: 6px 9px; padding: 6px 12px; }
  .tb-account { max-width: 92px; }
}

@media (max-width: 860px) {
  .goods-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .login-card { padding: 20px 18px 16px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }

  .cols.side { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 820px) {
  .table th:nth-child(1), .table td:nth-child(1) { display: none; }
  .page-title { font-size: 16px; }
  .tb-sub { display: none; }
}

@media (max-height: 640px) {

  #screen-login.active { padding: 12px 0 10px; }

  .reply-box { padding: 9px 12px; gap: 7px; }

  .reply-box textarea { height: 48px; min-height: 48px; }
  .reply-actions .muted.xs { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; overflow: hidden; }

  .msg-detail-title { -webkit-line-clamp: 1; }
  .login-card { padding: 18px 20px 14px; }
  .login-brand { margin-bottom: 13px; }
  .tabs { margin-bottom: 13px; }
  .notice-strip { margin-top: 11px; }
  .field { margin-bottom: 10px; }
  .content { padding-top: 12px; }
}

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

@media print {
  .sidebar, .statusbar, .topbar, .toast-host, .modal-host { display: none !important; }
  body, .app-shell { background: #fff; color: #000; }
}

.g-loading {
  position: fixed; inset: 0; z-index: 1080;
  display: none;
  align-items: center; justify-content: center;
  background: rgba(3, 6, 14, .55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);

  inset: var(--titlebar-h, 34px) 0 0 0;
  pointer-events: auto;
  cursor: progress;
}
.g-loading.show { display: flex; animation: fadeIn .14s var(--ease); }
.g-loading-card {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 20px;
  background: var(--surface-solid);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md, 10px);
  box-shadow: var(--sh-3);
  color: var(--text-2);
  font-size: 13px;
}
.g-loading-text { white-space: nowrap; }

.g-loading-sub { display: block; margin-top: 6px; text-align: center; }

.err-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px;
  padding: 40px 20px;
  text-align: center;
}
.err-art {
  width: 108px; height: 84px;
  display: grid; place-items: center;
  border-radius: var(--r-lg);
  background: rgba(245, 158, 11, .12);
  border: 1px dashed rgba(245, 158, 11, .45);
  color: var(--warn, #f59e0b);
}
.err-title { font-size: 14px; font-weight: 600; color: var(--text); }
.err-desc { font-size: 12.5px; color: var(--text-3); max-width: 380px; line-height: 1.7; text-wrap: pretty; }
.err-actions { margin-top: 4px; display: flex; gap: 8px; }

.login-alert {
  display: flex; align-items: center; gap: 9px;
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  border: 1px solid rgba(245, 158, 11, .38);
  background: rgba(245, 158, 11, .10);
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.6;
  animation: fadeIn .18s var(--ease);
}
.login-alert[hidden] { display: none; }
.login-alert.err {
  border-color: rgba(239, 68, 68, .40);
  background: rgba(239, 68, 68, .10);
}
.login-alert.warn {
  border-color: rgba(245, 158, 11, .38);
  background: rgba(245, 158, 11, .10);
}
.login-alert .la-ic { flex: none; display: grid; place-items: center; margin-top: 1px; color: var(--warn, #f59e0b); }
.login-alert.err .la-ic { color: var(--err, #ef4444); }
.login-alert .la-text { flex: 1; min-width: 0; word-break: break-word; }
.login-alert .la-retry {
  flex: none;
  padding: 2px 9px;
  font-size: 12px;
  border-radius: var(--r-xs);
  border: 1px solid currentColor;
  background: transparent;
  color: var(--brand-text);
  cursor: pointer;
}
.login-alert .la-retry:hover { background: rgba(99, 102, 241, .12); }
.login-alert .la-close {
  flex: none;
  width: 18px; height: 18px;
  display: grid; place-items: center;
  border: 0; background: transparent;
  color: var(--text-3);
  font-size: 15px; line-height: 1;
  cursor: pointer; border-radius: var(--r-xs);
}
.login-alert .la-close:hover { color: var(--text); background: rgba(255, 255, 255, .06); }

.guest-preview {
  max-height: none;
  overflow: visible;
  overscroll-behavior: contain;
  padding: 0;
}
.guest-preview .page-head { display: none; }
.guest-preview .cols { grid-template-columns: minmax(0, 1fr); }
.guest-preview .cols > * + * { margin-top: 14px; }

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.guest-preview .page { padding: 0; }
.guest-preview .page-head { margin-bottom: 10px; }

.avatar-box { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.avatar-lg {
  flex: 0 0 auto; width: 72px; height: 72px; padding: 0; border: 0;
  border-radius: var(--r-lg); overflow: hidden; cursor: pointer;
  background: rgba(99, 102, 241, .14);
  display: inline-flex; align-items: center; justify-content: center;
}
.avatar-lg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-empty { cursor: default; color: rgba(148, 163, 184, .9); }
.avatar-txt { flex: 1 1 140px; min-width: 0; }

.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }

.toast.flash { animation: toastPulse .32s ease; }
@keyframes toastPulse { 0% { transform: scale(1); } 45% { transform: scale(1.035); } 100% { transform: scale(1); } }
.legal p { margin: 0 0 8px; line-height: 1.9; }
.legal p:last-child { margin-bottom: 0; }

.adv { border: 0; }
.adv > summary {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: var(--r-md);
  cursor: pointer; user-select: none;
  font-size: 13px; font-weight: 600;
  background: rgba(99, 102, 241, .10);
  list-style: none;
}
.adv > summary::-webkit-details-marker { display: none; }
.adv > summary::before {
  content: ''; flex: 0 0 auto;
  width: 0; height: 0; margin-left: 2px;
  border-left: 5px solid currentColor;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform .15s ease;
}
.adv[open] > summary::before { transform: rotate(90deg); }
.adv > summary:hover { background: rgba(99, 102, 241, .18); }
.adv-hint { margin-left: auto; font-size: 11px; font-weight: 400; opacity: .7; }
.adv-body { padding: 12px 2px 0; }
