/* ===============
   Hao AI - 布局样式
   ===================== */

/* 主容器布局 */
.main-layout {
    display: flex;
    width: 100%;
    height: 100vh;
    background: var(--color-bg-main);
    overflow: hidden;
}

/* 侧边栏容器 */
.sidebar-container {
    flex-shrink: 0;
}

/* 主内容容器 */
.main-container {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

/* 内容包装器 */
.content-wrapper {
    padding: var(--space-2xl) var(--space-lg);
    max-width: 100%;
}

/* 栅格系统 */
.grid {
    display: grid;
    gap: var(--space-lg);
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.grid-auto {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

/* Flex 布局工具类 */
.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flex-col {
    display: flex;
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

/* 间距工具类 */
.p-xs { padding: var(--space-xs); }
.p-sm { padding: var(--space-sm); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.p-xl { padding: var(--space-xl); }
.p-2xl { padding: var(--space-2xl); }

.m-xs { margin: var(--space-xs); }
.m-sm { margin: var(--space-sm); }
.m-md { margin: var(--space-md); }
.m-lg { margin: var(--space-lg); }
.m-xl { margin: var(--space-xl); }
.m-2xl { margin: var(--space-2xl); }

.mt-xs { margin-top: var(--space-xs); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

.mb-xs { margin-bottom: var(--space-xs); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.mx-auto { margin-left: auto; margin-right: auto; }

/* 宽度 */
.w-full { width: 100%; }
.w-1\/2 { width: 50%; }
.w-1\/3 { width: 33.333%; }
.w-1\/4 { width: 25%; }

/* 高度 */
.h-full { height: 100%; }
.h-screen { height: 100vh; }

/* 隐藏/显示 */
.hidden {
    display: none;
}

.invisible {
    visibility: hidden;
}

.visible {
    visibility: visible;
}

.block {
    display: block;
}

.inline-block {
    display: inline-block;
}

/* 溢出处理 */
.overflow-hidden {
    overflow: hidden;
}

.overflow-auto {
    overflow: auto;
}

.overflow-y-auto {
    overflow-y: auto;
    overflow-x: hidden;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 对齐 */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }

.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }

/* 响应式 */
@media (max-width: 1024px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
    
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .content-wrapper {
        padding: var(--space-lg) var(--space-md);
    }
}

@media (max-width: 768px) {
    .main-layout {
        flex-direction: column;
    }

    .grid-auto {
        grid-template-columns: 1fr;
    }

    .content-wrapper {
        padding: var(--space-md);
    }
}

@media (max-width: 480px) {
    .content-wrapper {
        padding: var(--space-sm);
    }

    .gap-lg { gap: var(--space-md); }
    .gap-md { gap: var(--space-sm); }
}
