/* ============================================================
   Redmine Home Layout - 全局基础样式
   适配 Redmine 5.0.X / 5.1.X，Rails 6.1 静态资源路由
   页面最大宽度 1600px
   ============================================================ */

/* ---------- 容器 ---------- */
.home-layout-wrapper {
  width: 100%;
  padding: 0;
  margin: 0;
}

.hl-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 24px;
  box-sizing: border-box;
}

/* ---------- 通用区块间距 ---------- */
.hl-block {
  margin-bottom: 24px;
}

/* ---------- 图片防护 ---------- */
.home-layout-wrapper img {
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  max-width: 100%;
  height: auto;
}

.home-layout-wrapper .hl-carousel-btn,
.home-layout-wrapper .hl-carousel-dot,
.home-layout-wrapper .hl-notice-close,
.home-layout-wrapper a,
.home-layout-wrapper button {
  pointer-events: auto;
}

.hl-fit-img {
  width: 100%;
  height: auto;
  display: block;
}

/* ---------- 轮播 Block 01 ---------- */
.hl-carousel-section {
  position: relative;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  overflow: hidden;
  background: #f0f0f0;
}
.hl-carousel-viewport {
  width: 100%;
  overflow: hidden;
  position: relative;
}
.hl-carousel-track {
  display: flex;
}
.hl-carousel-slide {
  width: 100%;
  flex-shrink: 0;
  opacity: 0;
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}
.hl-carousel-slide.active {
  opacity: 1;
  position: relative;
  pointer-events: auto;
}
.hl-carousel-img {
  width: 100%;
  aspect-ratio: 1600 / 500;
  object-fit: cover;
  display: block;
}

/* 轮播透明标题栏 */
.hl-carousel-overlay {
  position: absolute;
  top: 0; left: 0; right: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.55), rgba(0,0,0,0.05));
  padding: 16px 0 24px 0;
  pointer-events: none;
}
.hl-carousel-overlay-text {
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* 轮播按钮 */
.hl-carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.4);
  color: #fff;
  border: none;
  font-size: 36px;
  width: 48px;
  height: 48px;
  line-height: 48px;
  text-align: center;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.2s;
  z-index: 10;
}
.hl-carousel-btn:hover {
  background: rgba(0,0,0,0.7);
}
.hl-carousel-prev {
  left: 16px;
}
.hl-carousel-next {
  right: 16px;
}

/* 轮播指示器 */
.hl-carousel-dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}
.hl-carousel-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: background 0.2s;
}
.hl-carousel-dot.active {
  background: #fff;
}

/* ---------- 核心优势展示 合并模块 Block 02 ---------- */
.hl-core-advantage {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.hl-core-advantage-title {
  font-size: 18px;
  font-weight: 700;
  color: #333;
  margin: 0 0 16px 0;
  padding: 0;
  line-height: 1.3;
}

/* ---------- 左图右文 / 右图左文 Block 02/03 ---------- */
.hl-image-text {
  display: flex;
  align-items: center;
  gap: 40px;
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.hl-image-text .hl-image-text-img {
  flex: 0 0 50%;
  overflow: hidden;
}
/* 优势轮播 */
.hl-adv-carousel {
  position: relative;
  width: 100%;
}
.hl-adv-carousel-track {
  position: relative;
}
.hl-adv-carousel-slide {
  display: none;
}
.hl-adv-carousel-slide.active {
  display: block;
}
.hl-adv-carousel-slide img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  display: block;
}
.hl-adv-carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.35);
  color: #fff;
  border: none;
  font-size: 22px;
  width: 30px;
  height: 30px;
  line-height: 30px;
  text-align: center;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.2s;
  z-index: 5;
  padding: 0;
}
.hl-adv-carousel-btn:hover {
  background: rgba(0,0,0,0.65);
}
.hl-adv-prev { left: 8px; }
.hl-adv-next { right: 8px; }
.hl-adv-carousel-dots {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 5;
}
.hl-adv-carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: background 0.2s;
}
.hl-adv-carousel-dot.active {
  background: #fff;
}
.hl-image-text .hl-image-text-img img {
  width: 100%;
  height: 320px;
  object-fit: cover;
}
.hl-image-text .hl-image-text-body {
  flex: 1;
  padding: 32px;
}
.hl-image-text .hl-image-text-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #333;
}
.hl-image-text .hl-image-text-desc {
  font-size: 14px;
  line-height: 1.8;
  color: #666;
}

.hl-img-right {
  flex-direction: row-reverse;
}

/* ---------- 四列双行卡片 Block 03 ---------- */
.hl-block-03-title {
  grid-column: 1 / -1;
  font-size: 18px;
  font-weight: 700;
  color: #333;
  margin: 0 0 4px 0;
  padding: 0;
  line-height: 1.3;
}
.hl-grid-4-col {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.hl-grid-4-item {
  display: block;
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  transition: box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
}
.hl-grid-4-item:hover {
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.hl-grid-4-img img {
  width: 100%;
  height: 280px;
  object-fit: cover;
}
.hl-grid-4-body {
  padding: 12px;
}
.hl-grid-4-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  color: #333;
}
.hl-grid-4-desc {
  font-size: 12px;
  color: #999;
  line-height: 1.4;
  margin-bottom: 8px;
}
.hl-grid-4-link {
  display: inline-block;
  font-size: 12px;
  color: #2a67d9;
  text-decoration: none;
  font-weight: 600;
}
.hl-grid-4-link:hover {
  text-decoration: underline;
}

/* ---------- 横向滚动 Block 04 ---------- */
.hl-h-scroll-wrapper {
  width: 100%;
  overflow: hidden;
  background: #fff;
  padding: 16px 0;
}
.hl-h-scroll-title {
  font-size: 18px;
  font-weight: 700;
  color: #333;
  margin: 0 0 12px 0;
  padding: 0;
  line-height: 1.3;
  text-align: left;
}
.hl-h-scroll-track {
  display: flex;
  gap: 16px;
  animation: hl-scroll-left 30s linear infinite;
}
.hl-h-scroll-item {
  flex-shrink: 0;
  width: 200px;
  height: 140px;
  border-radius: 6px;
  overflow: hidden;
}
.hl-h-scroll-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
@keyframes hl-scroll-left {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ---------- 两栏 Block 05 ---------- */
.hl-two-col-wrapper {
  display: flex;
  gap: 24px;
  overflow: hidden;
}
.hl-two-col-left,
.hl-two-col-right {
  flex: 1;
  min-width: 0;
}
.hl-welcome-card,
.hl-news-card {
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  overflow: hidden;
}
.hl-welcome-img img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}
.hl-welcome-body {
  padding: 16px;
}
.hl-welcome-default {
  padding: 14px 20px 24px;
  min-height: 120px;
}
.hl-welcome-text {
  font-size: 13px;
  line-height: 1.7;
  color: #555;
  margin-bottom: 12px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.hl-welcome-user {
  font-size: 13px;
  color: #999;
  margin: 0;
}
.hl-welcome-title {
  font-size: 18px;
  font-weight: 700;
  color: #333;
  margin: 0 0 8px 0;
  padding: 0;
  line-height: 1.3;
}
.hl-news-title {
  font-size: 18px;
  font-weight: 700;
  padding: 14px 16px;
  border-bottom: 1px solid #e9ecef;
  margin: 0;
  color: #333;
  line-height: 1.3;
}
.hl-news-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.hl-news-item {
  border-bottom: 1px solid #f0f0f0;
}
.hl-news-item:last-child {
  border-bottom: none;
}
.hl-news-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  text-decoration: none;
  color: #333;
  transition: background 0.15s;
}
.hl-news-link:hover {
  background: #f8f9fa;
}
.hl-news-subject {
  flex: 1;
  margin-right: 12px;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hl-news-date {
  font-size: 12px;
  color: #999;
  white-space: nowrap;
}
.hl-news-empty,
.hl-forum-empty {
  padding: 32px 16px;
  text-align: center;
  color: #999;
}
.hl-news-empty img,
.hl-forum-empty img {
  width: 64px;
  height: 64px;
  opacity: 0.5;
  margin-bottom: 8px;
}
.hl-news-more {
  padding: 8px 16px;
  text-align: left;
  border-top: 1px solid #e9ecef;
}
.hl-news-more a {
  font-size: 13px;
  color: #2a67d9;
  text-decoration: none;
}

/* ---------- 通栏横幅 Block 06 ---------- */
.hl-banner-text {
  position: relative;
  padding: 48px 32px;
  background: #2a67d9;
  background-size: cover;
  background-position: center;
  color: #fff;
  text-align: center;
  border-radius: 6px;
}
.hl-banner-has-bg {
  background-color: #333;
}
.hl-banner-overlay {
  position: relative;
  z-index: 1;
}
.hl-banner-heading {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 12px;
}
.hl-banner-sub {
  font-size: 16px;
  opacity: 0.9;
  margin-bottom: 20px;
}
.hl-banner-cta {
  display: inline-block;
  padding: 10px 28px;
  background: rgba(255,255,255,0.2);
  color: #fff;
  border: 2px solid rgba(255,255,255,0.5);
  border-radius: 4px;
  text-decoration: none;
  font-size: 14px;
  transition: background 0.2s;
}
.hl-banner-cta:hover {
  background: rgba(255,255,255,0.35);
}

/* ---------- 三列卡片 Block 07 ---------- */
.hl-grid-3-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.hl-grid-3-section-title {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #333;
  text-align: left;
}
.hl-grid-3-item {
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.hl-grid-3-item:hover {
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.hl-grid-3-img img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}
.hl-grid-3-body {
  padding: 16px;
}
.hl-grid-3-body h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #333;
}
.hl-grid-3-body p {
  font-size: 13px;
  color: #666;
  line-height: 1.5;
}

/* ---------- 通知栏 Block 08 ---------- */
.global-notice-bar {
  background: #e8f4fd;
  border: 1px solid #b8daff;
  border-radius: 4px;
  padding: 10px 16px;
  margin-bottom: 16px;
  font-size: 14px;
  color: #333;
}

.hl-notice-bar {
  background: #fff;
  border: 1px solid #e9ecef;
  border-left: 4px solid #2a67d9;
  border-radius: 4px;
  padding: 0;
}
.hl-notice-inner {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  gap: 10px;
}
.hl-notice-icon img {
  width: 20px;
  height: 20px;
}
.hl-notice-text {
  flex: 1;
  font-size: 13px;
  color: #333;
}
.hl-notice-close {
  border: none;
  background: none;
  font-size: 20px;
  color: #999;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.hl-notice-close:hover {
  color: #333;
}

/* ---------- 混合模块 Block 09 ---------- */
.hl-mix-module {
  position: relative;
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.hl-mix-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
}
.hl-mix-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.85);
}
.hl-mix-content {
  position: relative;
  z-index: 1;
  padding: 0 0 16px 0;
  background: #fff;
}
.hl-mix-title {
  position: relative;
  z-index: 1;
  font-size: 18px;
  font-weight: 700;
  color: #333;
  margin: 0;
  padding: 16px 0 12px 0;
  line-height: 1.3;
  background: #fff;
}
.hl-mix-desc {
  font-size: 14px;
  color: #666;
  margin-bottom: 16px;
}
.hl-mix-projects {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.hl-mix-project-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  text-decoration: none;
  color: #333;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.hl-mix-project-item:hover {
  border-color: #2a67d9;
  box-shadow: 0 2px 8px rgba(42,103,217,0.15);
}
.hl-mix-project-name {
  display: block;
  font-size: 14px;
  font-weight: 600;
}
.hl-mix-project-date {
  font-size: 11px;
  color: #999;
  white-space: nowrap;
}
.hl-mix-project-desc {
  display: block;
  font-size: 12px;
  color: #999;
}

/* ---------- 系统数据统计 Block 10 ---------- */
.hl-stat-wrapper {
  margin: 0;
}
.hl-stat-section-title {
  font-size: 18px;
  font-weight: 700;
  color: #333;
  margin: 0 0 12px 0;
  padding: 0;
  line-height: 1.3;
}
.hl-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.hl-stat-cat {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}
.hl-stat-cat:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}
.hl-stat-cat-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
}
.hl-stat-cat-icon {
  width: 20px;
  height: 20px;
  filter: brightness(0) invert(1);
}
.hl-stat-cat-label {
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}
.hl-stat-cat-body {
  padding: 12px 16px 16px;
}
.hl-stat-cat-single {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px 24px;
}
.hl-stat-big-num {
  font-size: 42px;
  font-weight: 800;
  line-height: 1;
}
.hl-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
}
.hl-stat-row:last-child {
  border-bottom: none;
}
.hl-stat-row-label {
  font-size: 13px;
  color: #666;
}
.hl-stat-row-val {
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ---------- 内网导航 Block 11 ---------- */
.hl-block-11-title {
  grid-column: 1 / -1;
  font-size: 18px;
  font-weight: 700;
  color: #333;
  margin: 0 0 4px 0;
  padding: 0;
  line-height: 1.3;
}
.hl-nav-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}
.hl-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  padding: 20px 12px;
  text-decoration: none;
  color: #333;
  transition: box-shadow 0.2s, transform 0.2s;
}
.hl-nav-item:hover {
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  transform: translateY(-2px);
}
.hl-nav-icon img {
  width: 40px;
  height: 40px;
  margin-bottom: 8px;
}
.hl-nav-label {
  font-size: 13px;
  font-weight: 500;
}

/* ---------- 讨论区 Block 12 ---------- */
.hl-forum-double-col {
  display: flex;
  gap: 24px;
}
.hl-forum-col {
  flex: 1;
}
.hl-forum-card {
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  overflow: hidden;
}
.hl-forum-heading {
  font-size: 18px;
  font-weight: 700;
  padding: 14px 16px;
  border-bottom: 1px solid #e9ecef;
  margin: 0;
  color: #333;
}
.hl-forum-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.hl-forum-item {
  border-bottom: 1px solid #f0f0f0;
}
.hl-forum-item:last-child {
  border-bottom: none;
}
.hl-forum-link {
  display: block;
  padding: 12px 16px;
  text-decoration: none;
  color: #333;
  transition: background 0.15s;
}
.hl-forum-link:hover {
  background: #f8f9fa;
}
.hl-forum-subject {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hl-forum-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: #999;
}
.hl-forum-date {
  margin-left: auto;
}
.hl-forum-more {
  text-align: right;
  margin-top: 16px;
}
.hl-forum-more a {
  font-size: 13px;
  color: #2a67d9;
  text-decoration: none;
}

/* ============================================================
   响应式 - Redmine 兼容断点
   Redmine 5 原生断点参考：899px 以下为移动端
   插件微调：1200 / 900 / 600
   ============================================================ */

/* 平板横屏 (≤1200px) */
@media (max-width: 1200px) {
  .hl-container {
    padding: 0 16px;
  }
  .hl-core-advantage-title {
    font-size: 18px;
  }
  .hl-grid-4-col {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* 平板竖屏 (≤900px) — Redmine 原生移动断点 899px */
@media (max-width: 900px) {
  .hl-container {
    padding: 0 12px;
  }
  .hl-grid-4-col {
    grid-template-columns: repeat(2, 1fr);
  }
  .hl-grid-3-col {
    grid-template-columns: 1fr;
  }
  .hl-nav-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .hl-stat-grid {
    grid-template-columns: 1fr;
  }
  .hl-adv-carousel-slide img,
  .hl-image-text .hl-image-text-img img {
    height: 220px;
  }
}

/* 手机 (≤600px) */
@media (max-width: 600px) {
  .hl-container {
    padding: 0 8px;
  }
  .hl-grid-4-col {
    grid-template-columns: 1fr;
  }
  .hl-nav-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .hl-stat-grid {
    grid-template-columns: 1fr;
  }
  .hl-mix-projects {
    grid-template-columns: 1fr;
  }
  .hl-banner-heading {
    font-size: 18px;
  }
}
