/*!
 * app-shell.css —— 独立页面（设置 / 计费）的常驻侧栏布局
 * 复用 monet.css 的 --md-* 设计令牌，视觉与首页一致。
 */

body {
  margin: 0;
}

.app-shell {
  min-height: 100vh;
}

.app-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 80;
  width: 288px;
  padding: 24px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--md-surface-container-low);
  border-right: 1px solid var(--md-outline-variant);
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 8px 18px;
  color: var(--md-on-surface);
  text-decoration: none;
}

.side-brand-mark {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: var(--md-primary-container);
  color: var(--md-on-primary-container);
}

.side-brand-mark svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.side-brand-text {
  min-width: 0;
}

.side-brand-title {
  display: block;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.side-brand-sub {
  display: block;
  margin-top: 2px;
  color: var(--md-on-surface-variant);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.side-label {
  padding: 10px 16px 5px;
  color: var(--md-on-surface-variant);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.side-nav-item {
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: var(--md-shape-full);
  background: transparent;
  color: var(--md-on-surface-variant);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease;
}

.side-nav-item:hover {
  background: color-mix(in srgb, var(--md-on-surface) 8%, transparent);
  color: var(--md-on-surface);
}

.side-nav-item.active {
  background: var(--md-secondary-container);
  color: var(--md-on-secondary-container);
  font-weight: 600;
}

.side-nav-icon {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.side-nav-icon svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.side-nav-label {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.side-divider {
  height: 1px;
  margin: 10px 12px;
  background: var(--md-outline-variant);
}

.side-spacer {
  flex: 1;
  min-height: 16px;
}

.side-footer {
  padding: 14px 16px 4px;
  border-top: 1px solid var(--md-outline-variant);
  color: var(--md-on-surface-variant);
  font-size: 11px;
  line-height: 1.7;
}

.app-main {
  min-height: 100vh;
  margin-left: 288px;
  padding: 40px 32px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.app-main .monet-main {
  margin: 0;
  padding: 0;
  flex: 1 0 auto;
}

.app-main .monet-footer {
  width: 100%;
  max-width: 760px;
  margin: 32px 0 0;
  padding: 0;
  text-align: left;
}

/* 右上角深色模式快捷开关 */
.theme-fab {
  position: fixed;
  top: 20px;
  right: 24px;
  z-index: 120;
  width: 44px;
  height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: var(--md-surface-container-high);
  color: var(--md-on-surface-variant);
  box-shadow: var(--md-elevation-1);
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.theme-fab:hover {
  background: var(--md-surface-container-highest);
  color: var(--md-on-surface);
}

.theme-fab:active {
  transform: scale(0.94);
}

.theme-fab svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.theme-fab .icon-sun {
  display: none;
}

body.monet-dark .theme-fab .icon-sun {
  display: block;
}

body.monet-dark .theme-fab .icon-moon {
  display: none;
}

@media (max-width: 920px) {
  .app-sidebar {
    width: 80px;
    padding: 12px 8px;
    align-items: center;
    overflow-x: hidden;
  }

  .side-brand {
    padding: 0 0 14px;
  }

  .side-brand-mark {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
    border-radius: 14px;
  }

  .side-brand-mark svg {
    width: 22px;
    height: 22px;
  }

  .side-brand-text,
  .side-label,
  .side-divider,
  .side-spacer,
  .side-footer {
    display: none;
  }

  .side-nav {
    width: 100%;
    align-items: center;
    gap: 4px;
  }

  .side-nav + .side-nav {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--md-outline-variant);
  }

  .side-nav-item {
    width: 64px;
    min-height: 58px;
    padding: 4px;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    border-radius: 16px;
    font-size: 10px;
    text-align: center;
  }

  .side-nav-icon {
    width: 22px;
    height: 22px;
    flex-basis: 22px;
  }

  .side-nav-icon svg {
    width: 20px;
    height: 20px;
  }

  .side-nav-label {
    display: block;
    max-width: 60px;
    font-size: 10px;
    line-height: 1.2;
  }

  .app-main {
    margin-left: 80px;
    padding: 64px 16px 40px;
  }

  .theme-fab {
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 600px) {
  .app-sidebar {
    width: 72px;
    padding: 10px 6px;
  }

  .side-nav-item {
    width: 58px;
    min-height: 54px;
  }

  .side-nav-label {
    font-size: 9px;
    max-width: 54px;
  }

  .app-main {
    margin-left: 72px;
    padding: 64px 12px 32px;
  }

  .app-main .monet-main {
    padding: 0;
  }

  .app-main .monet-footer {
    margin-top: 24px;
  }
}
