html {
  background: var(--surface-app);
  scroll-behavior: smooth;
}

body.app-body {
  min-width: 320px;
  background:
    radial-gradient(circle at 80% 0, rgba(31, 99, 233, .055), transparent 34rem),
    var(--surface-app);
  color: var(--text);
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 10px;
  left: 10px;
  padding: 9px 13px;
  border-radius: var(--radius-sm);
  background: var(--brand-600);
  color: #fff;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.sidebar {
  z-index: 80;
  width: var(--sidebar-width);
  padding: 18px 13px 14px;
  background:
    radial-gradient(circle at 0 0, rgba(47, 118, 246, .2), transparent 18rem),
    linear-gradient(180deg, var(--nav-900), var(--nav-950));
  border-right: 1px solid rgba(255, 255, 255, .06);
  box-shadow: 12px 0 30px rgba(4, 17, 31, .14);
}

.brand {
  min-height: 64px;
  gap: 11px;
  padding: 4px 5px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .09);
}

.brand-mark {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 12px;
  background: linear-gradient(145deg, var(--brand-500), var(--cyan-500));
  box-shadow: 0 10px 24px rgba(0, 105, 225, .3);
  font-size: 18px;
}

.brand-copy {
  min-width: 0;
}

.brand-copy strong {
  font-size: 16px;
  letter-spacing: .04em;
}

.brand-copy span {
  color: #9eb0c6;
  font-size: 11px;
  white-space: nowrap;
}

.icon-button.sidebar-close {
  display: none;
  margin-left: auto;
  color: #dce7f3;
}

.side-nav {
  display: block;
  padding: 5px 0 0;
}

.nav-group {
  margin-top: 15px;
}

.nav-group-label {
  margin: 0 10px 7px;
  color: #7187a1;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
}

.sidebar .nav-link {
  min-height: 42px;
  margin: 3px 0;
  padding: 8px 10px;
  gap: 10px;
  border-radius: 9px;
  color: #cbd8e8;
  font-size: 14px;
  font-weight: 600;
}

.sidebar .nav-link::before {
  display: none;
}

.sidebar .nav-link:hover {
  background: rgba(255, 255, 255, .07);
  color: #fff;
  transform: none;
}

.sidebar .nav-link.active {
  background: linear-gradient(90deg, rgba(47, 118, 246, .28), rgba(10, 167, 182, .12));
  border-color: rgba(116, 165, 255, .22);
  color: #fff;
  box-shadow: inset 3px 0 0 #5f99ff;
}

.nav-glyph {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 7px;
  background: rgba(255, 255, 255, .05);
  color: #acc6e6;
  font-size: 11px;
  font-weight: 800;
}

.nav-link.active .nav-glyph {
  border-color: rgba(145, 192, 255, .4);
  background: rgba(47, 118, 246, .24);
  color: #fff;
}

.nav-badge {
  min-width: 22px;
  margin-left: auto;
  padding: 2px 6px;
  border-radius: 999px;
  background: #ffb342;
  color: #452600;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.sidebar-foot {
  position: static;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  margin-top: 16px;
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 9px;
  background: rgba(255, 255, 255, .035);
  color: #91a4ba;
  font-size: 11px;
}

.system-state-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 4px rgba(52, 211, 153, .12);
}

.main {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  padding: 0 var(--page-gutter) 48px;
}

.topbar {
  position: sticky;
  z-index: 45;
  top: 0;
  min-height: 96px;
  margin: 0 calc(var(--page-gutter) * -1) 22px;
  padding: 18px var(--page-gutter) 15px;
  align-items: center;
  border-bottom: 1px solid rgba(214, 222, 233, .9);
  background: rgba(247, 249, 252, .92);
  box-shadow: 0 5px 20px rgba(19, 38, 65, .03);
  backdrop-filter: blur(15px);
}

.icon-button.menu-toggle {
  display: none;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 20px;
  cursor: pointer;
}

.icon-button:hover {
  border-color: var(--border);
  background: var(--surface-raised);
}

.page-heading {
  flex: 1;
  min-width: 0;
}

.breadcrumbs {
  display: flex;
  gap: 6px;
  margin-bottom: 5px;
  color: var(--text-subtle);
  font-size: 11px;
}

.breadcrumbs span:last-child {
  color: var(--brand-700);
  font-weight: 700;
}

.topbar h1 {
  color: var(--text-strong);
  font-size: clamp(21px, 1.8vw, 27px);
  letter-spacing: -.02em;
}

.topbar p {
  margin-top: 5px;
  color: var(--text-muted);
}

.userbar {
  gap: 11px;
}

.todo-shortcut {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 7px 8px 7px 12px;
  border: 1px solid #cbdcff;
  border-radius: 999px;
  background: var(--brand-50);
  color: var(--brand-700);
  font-size: 12px;
  font-weight: 700;
}

.todo-shortcut:hover {
  text-decoration: none;
  border-color: #9fbfff;
}

.todo-shortcut strong {
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--brand-600);
  color: #fff;
  font-size: 11px;
}

.user-menu {
  position: relative;
}

.user-menu summary {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  padding: 5px 9px 5px 6px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, .82);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  list-style: none;
}

.user-menu summary::-webkit-details-marker {
  display: none;
}

.user-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(145deg, var(--brand-600), var(--cyan-600));
  color: #fff;
  font-weight: 800;
}

.user-meta {
  display: grid;
  min-width: 108px;
}

.user-meta strong {
  color: var(--text-strong);
  font-size: 13px;
}

.user-meta small {
  max-width: 150px;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 10px;
  text-overflow: ellipsis;
}

.user-chevron {
  color: var(--text-subtle);
}

.user-menu-popover {
  position: absolute;
  z-index: 70;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  min-width: 190px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-md);
}

.user-menu-popover a,
.menu-role {
  padding: 9px 10px;
  border-radius: 7px;
}

.menu-role {
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-muted);
  font-size: 11px;
}

.user-menu-popover a:hover {
  background: var(--brand-50);
  text-decoration: none;
}

.page-content {
  max-width: 1760px;
  margin: 0 auto;
}

.sidebar-backdrop {
  display: none;
}

.mobile-quicknav {
  display: none;
}

.login-main {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 20%, rgba(47, 118, 246, .18), transparent 27rem),
    radial-gradient(circle at 88% 82%, rgba(10, 167, 182, .13), transparent 25rem),
    linear-gradient(145deg, #eaf1fa, #f8fafc 56%, #eef4fb);
}

.login-main::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background-image:
    linear-gradient(rgba(20, 79, 196, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 79, 196, .04) 1px, transparent 1px);
  background-size: 36px 36px;
  content: "";
  mask-image: linear-gradient(135deg, #000, transparent 75%);
}
