:root {
  --lm-bg: #f5f7f5;
  --lm-ink: #101615;
  --lm-muted: #66736f;
  --lm-surface: #ffffff;
  --lm-line: #dfe6e2;
  --lm-line-strong: #cbd6d1;
  --lm-green: #45d7a8;
  --lm-green-deep: #10372f;
  --lm-green-soft: #eaf8f2;
  --lm-focus: rgba(69, 215, 168, 0.72);
  --lm-danger: #b42318;
  --lm-warning: #9a6700;
  --lm-radius-sm: 8px;
  --lm-radius-md: 12px;
  --lm-shadow: 0 8px 24px rgba(16, 55, 47, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

.lm-system-shell {
  min-height: 100vh;
  background: var(--lm-bg);
  color: var(--lm-ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.lm-container {
  width: min(calc(100% - 48px), 1440px);
  margin: 0 auto;
}

.lm-header {
  position: sticky;
  z-index: 50;
  top: 0;
  border-bottom: 1px solid var(--lm-line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(1.1) blur(16px);
}

.lm-header-bar {
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.lm-brand-link {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  color: var(--lm-ink);
  text-decoration: none;
}

.lm-brand-logo {
  display: block;
  width: auto;
  height: 25px;
  max-width: 142px;
}

.lm-brand-text {
  display: none;
  min-height: 25px;
  align-items: center;
  color: var(--lm-green-deep);
  font-size: 20px;
  font-weight: 800;
}

.lm-shell-title {
  padding-left: 18px;
  border-left: 1px solid var(--lm-line);
  color: var(--lm-muted);
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
}

.lm-header-meta {
  min-width: 0;
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  color: var(--lm-muted);
  font-size: 14px;
  font-weight: 600;
}

.lm-header-meta a,
.lm-header-meta button,
.lm-header-meta summary {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: var(--lm-radius-sm);
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: 1;
  padding: 0 12px;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}

.lm-header-meta a:hover,
.lm-header-meta button:hover,
.lm-header-meta summary:hover {
  background: #f1f5f3;
  color: var(--lm-ink);
}

.lm-header-meta .active {
  background: var(--lm-green-soft);
  color: var(--lm-green-deep);
}

.lm-nav-menu {
  position: relative;
  flex: 0 0 auto;
}

.lm-nav-menu summary {
  list-style: none;
  gap: 7px;
}

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

.lm-nav-menu summary::after {
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  content: "";
  transform: translateY(-2px) rotate(45deg);
  transition: transform 160ms ease;
}

.lm-nav-menu[open] summary::after {
  transform: translateY(2px) rotate(225deg);
}

.lm-nav-popover {
  position: absolute;
  z-index: 70;
  top: calc(100% + 8px);
  right: 0;
  width: 236px;
  padding: 8px;
  border: 1px solid var(--lm-line-strong);
  border-radius: var(--lm-radius-md);
  background: var(--lm-surface);
  box-shadow: var(--lm-shadow);
}

.lm-nav-category-popover {
  right: auto;
  left: 0;
  width: 132px;
}

.lm-nav-menu-label {
  display: block;
  padding: 8px 10px 6px;
  color: var(--lm-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.lm-header-meta .lm-nav-menu-item {
  width: 100%;
  justify-content: flex-start;
  padding: 0 10px;
}

.lm-account-menu {
  margin-left: 8px;
  padding-left: 8px;
  border-left: 1px solid var(--lm-line);
}

.lm-account-menu summary {
  max-width: 176px;
  color: var(--lm-ink);
}

.lm-account-summary-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lm-account-summary-mobile {
  display: none;
}

.lm-account-identity {
  display: grid;
  gap: 4px;
  margin: 2px 2px 8px;
  padding: 9px 8px 12px;
  border-bottom: 1px solid var(--lm-line);
}

.lm-account-identity span {
  color: var(--lm-muted);
  font-size: 12px;
  font-weight: 500;
}

.lm-account-identity strong {
  overflow: hidden;
  color: var(--lm-ink);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
  text-overflow: ellipsis;
}

.lm-header-meta .lm-account-logout {
  color: var(--lm-danger);
}

.lm-shell-user {
  max-width: 190px;
  overflow: hidden;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding-left: 14px;
  border-left: 1px solid var(--lm-line);
  color: var(--lm-ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lm-shell-content {
  padding: 32px 0 64px;
}

.lm-system-shell :focus-visible {
  outline: 3px solid var(--lm-focus);
  outline-offset: 2px;
}

@media (max-width: 1040px) {
  .lm-container {
    width: min(calc(100% - 32px), 1440px);
  }

  .lm-header-bar {
    min-height: 60px;
    flex-wrap: wrap;
    padding: 10px 0;
  }

  .lm-header-meta {
    width: 100%;
    order: 3;
    overflow: visible;
    justify-content: flex-start;
    padding-bottom: 2px;
  }

  .lm-account-menu {
    margin-left: auto;
  }
}

@media (max-width: 640px) {
  .lm-container {
    width: min(calc(100% - 24px), 1440px);
  }

  .lm-shell-title {
    padding-left: 12px;
  }

  .lm-header-bar {
    position: relative;
  }

  .lm-header-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    overflow: visible;
    padding-bottom: 0;
  }

  .lm-header-meta > a,
  .lm-header-meta > button,
  .lm-header-meta summary {
    width: 100%;
    min-width: 0;
    padding: 0 4px;
    font-size: 13px;
  }

  .lm-nav-menu {
    min-width: 0;
  }

  .lm-account-menu {
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
  }

  .lm-account-summary-name {
    display: none;
  }

  .lm-account-summary-mobile {
    display: inline;
  }

  .lm-nav-popover {
    top: calc(100% + 12px);
    width: min(272px, calc(100vw - 24px));
  }

  .lm-nav-business .lm-nav-category-popover {
    top: calc(100% + 60px);
    right: 0;
    left: auto;
  }

  .lm-nav-tools .lm-nav-category-popover {
    right: auto;
    left: 0;
  }

  .lm-account-popover {
    right: 0;
    left: auto;
  }
}
