// ---- Layout Variables ----
@header-height: 56px;
@sider-width: 220px;
@sider-collapsed-width: 64px;
@content-padding: 16px;
@border-radius-base: 6px;

// ---- Color Palette ----
@primary-color: #1677ff;
@bg-layout: #f0f2f5;
@bg-content: #ffffff;
@text-primary: rgba(0, 0, 0, 0.88);
@text-secondary: rgba(0, 0, 0, 0.65);
@text-tertiary: rgba(0, 0, 0, 0.45);
@border-color: #f0f0f0;

// ---- Global Resets ----
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body,
#app {
  height: 100%;
  width: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
    'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

// ---- Layout Styles ----
.app-layout {
  height: 100vh;
  overflow: hidden;

  .app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: @header-height;
    padding: 0 24px;
    background: #001529;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    z-index: 10;
    flex-shrink: 0;

    .header-left {
      display: flex;
      align-items: center;
      gap: 24px;

      .logo {
        display: flex;
        align-items: center;
        gap: 10px;
        color: #fff;
        font-size: 18px;
        font-weight: 600;
        white-space: nowrap;
        cursor: pointer;

        .logo-icon {
          font-size: 24px;
          color: @primary-color;
        }
      }
    }

    .header-center {
      flex: 1;
      max-width: 480px;
      margin: 0 48px;
    }

    .header-right {
      display: flex;
      align-items: center;
      gap: 16px;
      color: rgba(255, 255, 255, 0.85);

      .user-info {
        display: flex;
        align-items: center;
        gap: 8px;
        cursor: pointer;

        .user-name {
          font-size: 14px;
        }
      }
    }
  }

  // Body: sider + content column
  .app-body {
    flex: 1;
    overflow: hidden;
  }

  .app-sider {
    background: #fff;
    border-right: 1px solid @border-color;
    overflow-y: auto;
    overflow-x: hidden;

    .sider-menu {
      border-right: none;
    }
  }

  // Content column (tabs + page)
  .app-content-layout {
    display: flex;
    flex-direction: column;
    background: @bg-layout;
    overflow: hidden;
  }

  // ── Tab bar ──
  .app-tabs {
    background: #fff;
    flex-shrink: 0;

    .ant-tabs {
      margin-bottom: 0;

      .ant-tabs-nav {
        margin: 0;
        //padding: 0 12px;

        &::before {
          border-bottom-color: @border-color;
        }
      }

      // Hide the empty pane content area
      .ant-tabs-content-holder {
        display: none;
      }

      // Tighten tab card appearance
      .ant-tabs-tab {
        padding: 6px 12px !important;
        font-size: 13px;
        transition: all 0.2s;
      }

      .ant-tabs-tab-active {
        font-weight: 500;
      }
    }
  }

  // ── Page content ──
  .app-content {
    flex: 1;
    margin: @content-padding;
    overflow: auto;
    min-height: 0;
  }
}

// ---- Utility Classes ----
.page-container {
  padding: 24px;
  background: @bg-content;
  border-radius: @border-radius-base;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.text-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

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

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

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 3px;

  &:hover {
    background: rgba(0, 0, 0, 0.25);
  }
}

// ---- Highlight Styles ----
.highlight-text {
  em {
    font-style: normal;
    color: #ff4d4f;
    font-weight: 600;
  }
}
