/**
 * IMT 下载中心 — 三个下载页共用样式
 * 页面骨架 / 列表 / 卡片；banner 与悬浮客服在 imt-ui.css
 */

/* ============ 页面骨架：内容不足时 footer 也贴底 ============ */
body.page-template-download-addmark,
body.page-template-download-ezcad2,
body.page-template-download-manual {
  box-sizing: border-box;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.imt-dl-page {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--neutral-50);
}

.imt-dl-body {
  flex: 1 1 auto;
  padding: 26px 0 44px;
}

/* 内容页 banner 右上角的软件图标 */
.imt-dl-brand {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  padding: 10px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 16px 40px -16px rgba(0, 0, 0, 0.55);
  line-height: 0;
}

.imt-dl-brand img {
  display: block;
  width: 57px;
  height: 56px;
  image-rendering: -webkit-optimize-contrast;
}

@media (max-width: 900px) {
  .imt-dl-brand {
    position: static;
    transform: none;
    display: inline-block;
    margin-top: 16px;
    padding: 8px;
    border-radius: 12px;
    box-shadow: 0 10px 24px -14px rgba(0, 0, 0, 0.6);
  }

  .imt-dl-brand img {
    width: 44px;
    height: 43px;
  }
}

/* ============ 区块标题 ============ */
.imt-dl-section-title {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 14px;
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--neutral-900);
}

.imt-dl-section-title small {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--neutral-300);
}

.imt-dl-count {
  margin-left: auto;
  font-size: 12px;
  font-weight: 500;
  color: var(--neutral-300);
}

/* 中英双语的英文部分统一用小一号灰字 */
.imt-dl-btn em,
.imt-dl-list-head em,
.imt-dl-foot-note strong em,
.imt-dl-empty strong em {
  font-style: normal;
  font-weight: 500;
  opacity: 0.72;
}

.imt-dl-btn em {
  font-size: 11px;
  letter-spacing: 0.02em;
}

/* ============ 平台卡片（ADD Mark） ============ */
.imt-dl-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.imt-dl-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 26px 20px 22px;
  background: #fff;
  border: 1px solid var(--neutral-200);
  border-radius: 18px;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.28s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.28s ease;
}

.imt-dl-card:hover {
  transform: translateY(-5px);
  border-color: var(--color-brand-300);
  box-shadow: 0 18px 40px -12px rgba(15, 23, 42, 0.18);
}

.imt-dl-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  margin-bottom: 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(59, 130, 246, 0.1));
  color: var(--color-brand-500);
}

.imt-dl-icon svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.imt-dl-card h3 {
  margin: 0 0 5px;
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--neutral-900);
}

.imt-dl-card .sub {
  margin: 0 0 3px;
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--neutral-500);
}

.imt-dl-card .size {
  margin: 0 0 18px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.02em;
  color: var(--neutral-300);
}

/* ============ 下载按钮 ============ */
.imt-dl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: auto;
  padding: 10px 20px;
  border-radius: 999px;
  background: linear-gradient(var(--gradient-brand));
  color: #fff !important;
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none !important;
  white-space: nowrap;
  box-shadow: 0 6px 18px -6px rgba(124, 58, 237, 0.55);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.imt-dl-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 10px 24px -8px rgba(124, 58, 237, 0.72);
}

.imt-dl-btn:active {
  transform: translateY(0);
}

.imt-dl-btn svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.imt-dl-btn.ghost {
  background: #fff;
  color: var(--color-brand-500) !important;
  border: 1px solid var(--color-brand-300);
  box-shadow: none;
}

.imt-dl-btn.ghost:hover {
  background: rgba(124, 58, 237, 0.06);
  filter: none;
}

/* ============ 版本列表（EzCad2） ============ */
.imt-dl-list {
  background: #fff;
  border: 1px solid var(--neutral-200);
  border-radius: 18px;
  overflow: hidden;
}

.imt-dl-list-head,
.imt-dl-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px 112px 128px;
  gap: 14px;
  align-items: center;
  padding: 11px 24px;
}

.imt-dl-list-head {
  background: var(--neutral-50);
  border-bottom: 1px solid var(--neutral-200);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--neutral-500);
}

.imt-dl-list-head em {
  display: block;
  margin-top: 1px;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--neutral-300);
}

/* 版本号 / 日期 / 下载三列居中，表头与数据行共用同一套 grid，天然对齐 */
.imt-dl-list-head > span:nth-child(2),
.imt-dl-list-head > span:nth-child(3),
.imt-dl-list-head > span:nth-child(4) {
  text-align: center;
}

.imt-dl-row > .imt-dl-meta,
.imt-dl-row > .imt-dl-btn {
  justify-self: center;
}

.imt-dl-row {
  border-bottom: 1px solid var(--neutral-100);
  transition: background 0.2s ease;
}

.imt-dl-row:last-child {
  border-bottom: none;
}

.imt-dl-row:hover {
  background: rgba(124, 58, 237, 0.025);
}

.imt-dl-row-main {
  min-width: 0;
}

.imt-dl-row-main .name {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--neutral-900);
  line-height: 1.4;
  word-break: break-word;
}

.imt-dl-row-main .note {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--neutral-500);
  line-height: 1.5;
}

.imt-dl-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.09);
  color: var(--color-brand-500);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  vertical-align: middle;
}

.imt-dl-meta {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--neutral-500);
  white-space: nowrap;
}

.imt-dl-row .imt-dl-btn {
  padding: 9px 18px;
  font-size: 13px;
}

/* ============ 手册列表 ============ */
.imt-dl-manuals {
  display: grid;
  gap: 14px;
}

.imt-dl-manual {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 24px;
  background: #fff;
  border: 1px solid var(--neutral-200);
  border-radius: 18px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.imt-dl-manual:hover {
  border-color: var(--color-brand-300);
  box-shadow: 0 14px 34px -14px rgba(15, 23, 42, 0.16);
}

.imt-dl-manual-info {
  min-width: 0;
}

.imt-dl-manual-info .model {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--neutral-900);
  letter-spacing: -0.01em;
}

.imt-dl-manual-info .model .badge {
  padding: 3px 10px;
  border-radius: 999px;
  background: linear-gradient(var(--gradient-brand));
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.imt-dl-manual-info .desc {
  margin-top: 5px;
  font-size: 13px;
  color: var(--neutral-500);
}

.imt-dl-manual-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

/* 抓不到文件时的占位 */
.imt-dl-missing {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--neutral-100);
  color: var(--neutral-300);
  font-size: 13px;
  font-weight: 500;
}

/* ============ 空状态 ============ */
.imt-dl-empty {
  padding: 52px 24px;
  text-align: center;
  background: #fff;
  border: 1px dashed var(--neutral-200);
  border-radius: 18px;
  color: var(--neutral-500);
  font-size: var(--text-sm);
  line-height: 1.8;
}

.imt-dl-empty strong {
  display: block;
  margin-bottom: 8px;
  font-size: var(--text-base);
  color: var(--neutral-700);
}

/* ============ 底部提示（中英双语） ============ */
.imt-dl-foot-note {
  margin-top: 18px;
  padding: 14px 18px;
  border-left: 3px solid var(--color-brand-300);
  border-radius: 0 12px 12px 0;
  background: rgba(124, 58, 237, 0.045);
  font-size: 13px;
  line-height: 1.75;
  color: var(--neutral-500);
}

.imt-dl-foot-note strong {
  display: block;
  margin-bottom: 6px;
  color: var(--neutral-700);
  font-size: 13px;
}

.imt-dl-foot-note .en {
  display: block;
  margin-top: 6px;
  color: var(--neutral-300);
  font-size: 12px;
  line-height: 1.7;
}

.imt-dl-foot-note a {
  color: var(--color-brand-500);
  text-decoration: none;
  border-bottom: 1px solid rgba(124, 58, 237, 0.3);
}

/* ============ 响应式 ============ */
@media (max-width: 1100px) {
  .imt-dl-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .imt-dl-list-head,
  .imt-dl-row {
    grid-template-columns: minmax(0, 1fr) 110px 100px;
  }

  .imt-dl-list-head .col-ver,
  .imt-dl-row .col-ver {
    display: none;
  }
}

@media (max-width: 780px) {
  .imt-dl-body {
    padding: 26px 0 40px;
  }

  /* 列表在窄屏改成卡片堆叠，避免表格被压扁 */
  .imt-dl-list-head {
    display: none;
  }

  .imt-dl-list {
    background: transparent;
    border: none;
    border-radius: 0;
    display: grid;
    gap: 12px;
    overflow: visible;
  }

  .imt-dl-row {
    display: block;
    padding: 18px;
    background: #fff;
    border: 1px solid var(--neutral-200);
    border-radius: 16px;
  }

  .imt-dl-row .imt-dl-meta {
    display: inline-block;
    margin: 10px 14px 0 0;
  }

  .imt-dl-row .imt-dl-btn {
    display: flex;
    width: 100%;
    margin-top: 14px;
    padding: 12px 20px;
    font-size: var(--text-sm);
  }

  .imt-dl-manual {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 18px;
  }

  .imt-dl-manual-actions {
    flex-direction: column;
  }

  .imt-dl-manual-actions .imt-dl-btn,
  .imt-dl-manual-actions .imt-dl-missing {
    width: 100%;
    padding: 12px 18px;
  }

  .imt-dl-count {
    margin-left: 0;
    width: 100%;
  }
}

@media (max-width: 520px) {
  .imt-dl-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .imt-dl-card {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    text-align: left;
    padding: 18px;
    gap: 0 14px;
  }

  .imt-dl-icon {
    width: 46px;
    height: 46px;
    margin-bottom: 0;
    flex-shrink: 0;
  }

  .imt-dl-icon svg {
    width: 24px;
    height: 24px;
  }

  .imt-dl-card h3 {
    font-size: var(--text-base);
    margin-bottom: 2px;
  }

  .imt-dl-card .sub {
    font-size: var(--text-xs);
  }

  .imt-dl-card .size {
    display: none;
  }

  .imt-dl-card .imt-dl-btn {
    width: 100%;
    margin-top: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .imt-dl-card,
  .imt-dl-btn,
  .imt-dl-row,
  .imt-dl-manual {
    transition: none !important;
  }

  .imt-dl-card:hover {
    transform: none;
  }
}
