/* ===============================================
   Global Styles — 风屿智航运营部
   =============================================== */

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

html {
  -webkit-font-smoothing: antialiased;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-page);
  color: var(--text-3);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  height: 100%;
  overflow: hidden;
}

.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ===============================================
   Typography Utilities — 统一排版（新页面 / 组件优先复用，勿自建字体层级）
   =============================================== */
.t-display  { font-size: var(--fs-display);  font-weight: var(--fw-bold);     line-height: var(--lh-display); }
.t-h1       { font-size: var(--fs-h1);       font-weight: var(--fw-bold);     line-height: var(--lh-h1); }
.t-h2       { font-size: var(--fs-h2);       font-weight: var(--fw-semibold); line-height: var(--lh-h2); }
.t-body     { font-size: var(--fs-body);     font-weight: var(--fw-regular);  line-height: var(--lh-body); }
.t-caption  { font-size: var(--fs-caption);  font-weight: var(--fw-regular);  line-height: var(--lh-caption); }
.t-label    { font-size: var(--fs-label);    font-weight: var(--fw-regular);  line-height: var(--lh-label); }
.t-micro    { font-size: var(--fs-micro);    font-weight: var(--fw-regular);  line-height: var(--lh-micro); }

.fw-regular   { font-weight: var(--fw-regular); }
.fw-medium    { font-weight: var(--fw-medium); }
.fw-semibold  { font-weight: var(--fw-semibold); }
.fw-bold      { font-weight: var(--fw-bold); }

.font-mono  { font-family: var(--font-mono); }
.num        { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* 标题标签默认遵循规范 */
h1 { font-size: var(--fs-h1); font-weight: var(--fw-bold); line-height: var(--lh-h1); }
h2 { font-size: var(--fs-h2); font-weight: var(--fw-semibold); line-height: var(--lh-h2); }

/* ---- Layout: Main ---- */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  overflow: hidden;
}

.content {
  flex: 1;
  padding: var(--content-py) var(--content-px);
  overflow-y: auto;
  overflow-x: hidden;
  animation: pageSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes pageSlideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .content {
    animation: none;
  }
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-4);
}

/* ---- Text Alignment Helpers ---- */
.text-right {
  text-align: right;
}

.text-left {
  text-align: left;
}

.mt-module {
  margin-top: var(--module-gap);
}

.mt-filter {
  margin-top: var(--filter-gap);
}

.mt-card-gap {
  margin-top: var(--card-gap);
}

/* ---- Sparkline Height Utilities ---- */
.h-8  { height: 8px; }
.h-12 { height: 12px; }
.h-16 { height: 16px; }
.h-20 { height: 20px; }
.h-24 { height: 24px; }
.h-28 { height: 28px; }

/* ---- Responsive ---- */
@media (max-width: 1280px) {
  .grid-summary {
    grid-template-columns: repeat(3, 1fr);
  }
  .grid-overview {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 1024px) {
  .sidebar {
    width: 64px;
  }
  .sidebar .logo-text,
  .sidebar .menu-item > span,
  .sidebar .menu-item .count,
  .sidebar .menu-section-title,
  .sidebar .user-info {
    display: none;
  }
  .sidebar .logo {
    justify-content: center;
    padding: var(--logo-pad) 8px;
  }
  .sidebar .menu-item {
    justify-content: center;
    padding: 0;
  }
  .sidebar .user-area {
    justify-content: center;
    padding: var(--user-area-pad) 8px;
  }
  .grid-summary {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .grid-summary {
    grid-template-columns: 1fr;
  }
  .grid-overview {
    grid-template-columns: 1fr;
  }
  .content {
    padding: 16px;
  }
  .header {
    padding: 0 16px;
  }
  .welcome-section {
    flex-direction: column;
    gap: 12px;
  }
}