/* ============================================================
   客户端首页（对齐 TruckersHub Client 的信息架构）
   中栏：横幅 / 四格数据 / 功能入口 / 最近行程
   右栏：服务状态 / 在线司机 / 本月之星
   ============================================================ */

.hm {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 312px;
  gap: 22px;
  align-items: start;
}

.hm-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* -------------------------------------------------- 顶部横幅 */

.hm-banner-slot:empty {
  display: none;
}

.hm-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 10px 18px;
  border: 1px solid rgba(0, 60, 91, 0.32);
  border-radius: 12px;
  background: linear-gradient(100deg, rgba(0, 60, 91, 0.22) 0%, rgba(0, 42, 64, 0.1) 48%, rgba(0, 60, 91, 0.05) 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all 0.16s ease;
}

.hm-banner:hover {
  border-color: rgba(0, 60, 91, 0.6);
  background: linear-gradient(100deg, rgba(0, 60, 91, 0.32) 0%, rgba(0, 42, 64, 0.16) 48%, rgba(0, 60, 91, 0.08) 100%);
}

.hm-banner-tag {
  flex: 0 0 auto;
  padding: 3px 9px;
  border-radius: 6px;
  background: #003c5b;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hm-banner-text {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #fff;
}

.hm-banner-cta {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  opacity: 0.9;
}

/* -------------------------------------------------- 四格数据 */

.hm-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.hm-stat {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(160deg, var(--panel) 0%, var(--panel-2) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.hm-stat-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  color: #fff;
  background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.28), rgba(0, 60, 91, 0.55) 62%, rgba(0, 42, 64, 0.42) 100%);
  box-shadow: 0 10px 22px rgba(0, 60, 91, 0.28);
}

.hm-stat-body {
  min-width: 0;
}

.hm-stat-value {
  font-size: 27px;
  font-weight: 800;
  line-height: 1.1;
  color: #fff;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.hm-stat-unit {
  display: inline-block;
  margin-left: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0;
}

.hm-stat-label {
  margin-top: 3px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  opacity: 0.86;
}

.hm-stat-foot {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--dim);
}

/* -------------------------------------------------- 分区标题 */

.hm-sec-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.hm-sec-head h2 {
  font-size: 15.5px;
  font-weight: 700;
  color: #fff;
}

.hm-sec-more {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--amber);
  cursor: pointer;
}

.hm-sec-more:hover {
  color: var(--cyan);
}

/* -------------------------------------------------- 功能入口 */

.hm-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.hm-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel);
  text-align: left;
  cursor: pointer;
  transition: all 0.16s ease;
}

.hm-tile:hover {
  border-color: var(--brand-line);
  background: var(--panel-2);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 12, 20, 0.5);
}

.hm-tile-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: var(--amber);
  background: var(--brand-soft);
}

.hm-tile-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hm-tile-text strong {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.hm-tile-text span {
  font-size: 11.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hm-tile-arrow,
.hm-tile-badge {
  margin-left: auto;
  flex: 0 0 auto;
  color: var(--dim);
}

.hm-tile-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--amber);
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

/* -------------------------------------------------- 最近行程 */

.hm-posts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.hm-post {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  text-align: left;
  cursor: pointer;
  transition: all 0.16s ease;
}

.hm-post:hover {
  border-color: var(--brand-line);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(0, 12, 20, 0.55);
}

.hm-post-cover {
  position: relative;
  width: 100%;
  height: auto;
  aspect-ratio: 1920 / 350;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: linear-gradient(145deg, #0c2a3a 0%, #00304a 52%, #004966 100%);
}

.hm-post-cover.has-art {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #07131b;
}

.hm-post-cover.empty {
  display: grid;
  place-items: center;
  color: var(--dim);
  background: linear-gradient(150deg, #0c1922, #1b2c39);
}

.hm-post-body {
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1 1 auto;
  padding: 15px 17px 13px;
}

.hm-post-title {
  margin-bottom: 2px;
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.32;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.hm-post-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.hm-post-line svg {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  color: var(--dim);
}

.hm-post-line span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hm-post-line.is-host {
  color: #ffffff;
  font-weight: 600;
}

.hm-post-line.is-host svg {
  color: var(--dim);
}

.hm-post-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.hm-post-foot .hm-post-line {
  flex: 1 1 auto;
  font-size: 12.5px;
}

.hm-post-counts {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
}

.hm-post-count {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 24px;
  padding: 0 7px 0 5px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.16);
  color: #c8efff;
  font-size: 11.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.hm-post-count svg {
  width: 13px;
  height: 13px;
}

.hm-post-count.is-unsure {
  background: rgba(255, 166, 43, 0.17);
  color: #ffd79e;
}

.hm-post-count.is-vtc {
  background: rgba(56, 189, 248, 0.16);
  color: #c8efff;
}

.hm-post-empty {
  grid-column: 1 / -1;
}

.hm-post-empty .hm-post-title {
  color: var(--text);
  -webkit-line-clamp: 1;
}

.hm-post-muted {
  color: var(--dim);
  font-size: 12.5px;
}

/* -------------------------------------------------- 右栏 */

.hm-rail {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 82px;
}

.hm-rail-card {
  padding: 14px 16px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(170deg, var(--panel) 0%, var(--panel-2) 100%);
}

.hm-rail-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.hm-rail-head h3 {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
}

.hm-rail-pill {
  margin-left: auto;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(47, 224, 168, 0.14);
  border: 1px solid rgba(47, 224, 168, 0.32);
  color: var(--green);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hm-rail-count {
  margin-left: auto;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--amber);
  font-size: 11.5px;
  font-weight: 700;
}

.hm-rows {
  display: flex;
  flex-direction: column;
}

.hm-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.045);
}

.hm-row:first-child {
  border-top: 0;
  padding-top: 2px;
}

.hm-row-label {
  flex: 1 1 auto;
  font-size: 12px;
  color: var(--muted);
}

.hm-row-value {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.hm-row-value.bad {
  color: var(--red);
}

.hm-row-value.ok {
  color: var(--green);
}

.hm-signal {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}

.hm-signal i {
  display: block;
  width: 3px;
  height: 6px;
  border-radius: 1px;
  background: var(--line-2);
}

.hm-signal i:nth-child(2) {
  height: 8px;
}

.hm-signal i:nth-child(3) {
  height: 10px;
}

.hm-signal i:nth-child(4) {
  height: 12px;
}

.hm-signal i.on {
  background: var(--amber);
}

.hm-people {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 -6px;
}

.hm-person {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 6px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.hm-person:hover {
  background: rgba(0, 60, 91, 0.08);
}

.hm-person-who {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.hm-person-who strong {
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hm-person-who span {
  font-size: 10.5px;
  color: var(--dim);
}

.hm-empty {
  padding: 14px 0 6px;
  font-size: 12px;
  color: var(--dim);
  text-align: center;
}

.hm-star {
  display: flex;
  align-items: center;
  gap: 14px;
}

.hm-star-art {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(150deg, #003c5b, #002539);
  box-shadow: 0 12px 26px rgba(0, 60, 91, 0.3);
}

.hm-star-who {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hm-star-who strong {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.hm-star-who span {
  font-size: 11.5px;
  color: var(--muted);
}

.hm-star-income {
  color: var(--amber) !important;
  font-weight: 700;
}

/* -------------------------------------------------- 响应式 */

@media (max-width: 1280px) {
  .hm {
    grid-template-columns: minmax(0, 1fr) 280px;
  }
  .hm-tiles,
  .hm-posts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1080px) {
  .hm {
    grid-template-columns: minmax(0, 1fr);
  }
  .hm-rail {
    position: static;
  }
}

@media (max-width: 720px) {
  .hm-stats,
  .hm-tiles,
  .hm-posts {
    grid-template-columns: minmax(0, 1fr);
  }
}
