/* RTL (Right-to-Left) Layout Support - 右到左布局支持 */
html[dir="rtl"], html[dir="rtl"] body, html[dir="rtl"] #app {
  direction: rtl;
}

/* 全局RTL样式 */
html[dir="rtl"] * {
  direction: rtl;
}

/* Flex布局方向调整 */
html[dir="rtl"] .flex-row,
html[dir="rtl"] [class*="flex-row"],
html[dir="rtl"] .row {
  flex-direction: row-reverse !important;
}

/* 文本对齐 */
html[dir="rtl"] .text-left,
html[dir="rtl"] [class*="text-left"] {
  text-align: right !important;
}

html[dir="rtl"] .text-right,
html[dir="rtl"] [class*="text-right"] {
  text-align: left !important;
}

html[dir="rtl"] .text-center {
  text-align: center !important;
}

/* 左右边距和内边距交换 */
html[dir="rtl"] [style*="padding-left"],
html[dir="rtl"] [style*="margin-left"] {
  direction: rtl;
}

/* 图标镜像处理 - 箭头和方向图标 */
html[dir="rtl"] .icon-right,
html[dir="rtl"] .icon-right1,
html[dir="rtl"] .icon-next,
html[dir="rtl"] .icon-goforward,
html[dir="rtl"] .arrow-right,
html[dir="rtl"] [class*="arrow-right"] {
  transform: scaleX(-1);
}

html[dir="rtl"] .icon-left,
html[dir="rtl"] .icon-left1,
html[dir="rtl"] .icon-prev,
html[dir="rtl"] .icon-goback,
html[dir="rtl"] .arrow-left,
html[dir="rtl"] [class*="arrow-left"] {
  transform: scaleX(-1);
}

/* 浮动方向 */
html[dir="rtl"] .float-left,
html[dir="rtl"] [class*="float-left"] {
  float: right !important;
}

html[dir="rtl"] .float-right,
html[dir="rtl"] [class*="float-right"] {
  float: left !important;
}

/* 定位调整 */
html[dir="rtl"] [style*="left:"] {
  direction: rtl;
}

html[dir="rtl"] [style*="right:"] {
  direction: rtl;
}

/* 资源组件 - 更多按钮位置调整 */
html[dir="rtl"] .index-resource .newest-tags {
  flex-direction: row-reverse;
  justify-content: space-between;
}

html[dir="rtl"] .index-resource .newest-tags .vip-more {
  position: absolute !important;
  left: 30rpx !important;
  right: auto !important;
  padding-left: 30rpx !important;
  padding-right: 0 !important;
}

html[dir="rtl"] .index-resource .newest-tags .vip-more::after {
  left: 0 !important;
  right: auto !important;
}

/* 分类组件 - 更多按钮位置调整 */
html[dir="rtl"] .sort-bar .title {
  flex-direction: row-reverse;
  justify-content: space-between;
}

html[dir="rtl"] .sort-bar .title .more {
  order: -1;
}

html[dir="rtl"] .sort-bar .title .more .icon-right {
  transform: scaleX(-1);
}

/* 资源列表居中显示 - 小程序和H5通用 */
.index-resource .img-grids {
  padding: 0 30rpx;
}

.index-resource .img-grids .newest-list {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
}

.index-resource .img-grids .newest-list .newest-item.column2 {
  width: 46% !important;
  padding: 0 10rpx 20rpx 10rpx !important;
}

.index-resource .img-grids .newest-list .newest-item.column3 {
  width: 30% !important;
  padding: 0 10rpx 20rpx 10rpx !important;
}

.index-resource .img-slides {
  padding: 0 30rpx;
}

.index-resource .img-slides .swiper-list .newest-item.column2 {
  width: 45% !important;
  padding: 0 10rpx 20rpx 10rpx !important;
}

.index-resource .img-slides .swiper-list .newest-item.column3 {
  width: 30% !important;
  padding: 0 10rpx 20rpx 10rpx !important;
}

