/* ============================================================
   iPod iMod · 改装学院
   与站点既有设计语言保持一致（同一套 token / 圆角 / 缓动）
   ============================================================ */

.imod {
  background: var(--bg);
  padding: 72px 0 88px;
}

/* 分类主题色 */
.imod {
  --im-storage: #0071e3;
  --im-battery: #1e9e5a;
  --im-os: #7a4fe0;
  --im-hw: #e07612;
  --im-trade: #0f8f96;
}

/* ---------- 概览统计 ---------- */
.imod-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0 0;
}

.imod-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 980px;
  background: var(--bg-alt);
  font-size: 14px;
  color: var(--text-muted);
  white-space: nowrap;
}

.imod-stat b {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

/* ---------- 分类筛选 ---------- */
.imod-tabs {
  display: flex;
  gap: 8px;
  margin: 26px 0 20px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}

.imod-tabs::-webkit-scrollbar {
  display: none;
}

.imod-tab {
  flex: none;
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  padding: 8px 17px;
  border-radius: 980px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease),
    color 0.25s var(--ease), transform 0.2s var(--ease);
}

.imod-tab:hover {
  border-color: rgba(0, 113, 227, 0.4);
}

.imod-tab:active {
  transform: scale(0.97);
}

.imod-tab.is-on {
  background: var(--text);
  border-color: var(--text);
  color: #fff;
}

.imod-tab i {
  font-style: normal;
  opacity: 0.55;
  margin-left: 5px;
  font-size: 12px;
}

/* ---------- 主题卡片 ---------- */
.imod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(288px, 100%), 1fr));
  gap: 16px;
}

.imod-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.imod-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.1);
}

.imod-card.is-off {
  display: none;
}

/* 封面：实拍图 或 渐变色 + 图标 */
.imod-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-alt);
}

.imod-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s var(--ease);
}

.imod-card:hover .imod-cover img {
  transform: scale(1.045);
}

.imod-cover.imod-cover--illu {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--ic-a) 0%, var(--ic-b) 100%);
}

.imod-cover.imod-cover--illu::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 82% 12%, rgba(255, 255, 255, 0.32) 0%, transparent 60%);
}

.imod-cover svg {
  width: 64px;
  height: 64px;
  color: #fff;
  opacity: 0.95;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.18));
}

.imod-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  padding: 4px 11px;
  border-radius: 980px;
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: saturate(160%) blur(8px);
  -webkit-backdrop-filter: saturate(160%) blur(8px);
}

.imod-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 18px 20px 20px;
}

.imod-body h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.imod-body h3 span {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0;
}

.imod-body p {
  margin: 9px 0 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-muted);
}

.imod-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.imod-tag {
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--bg-alt);
  color: var(--text-muted);
}

.imod-tag.is-key {
  background: rgba(0, 113, 227, 0.1);
  color: var(--blue);
}

.imod-tag.is-cost {
  background: rgba(30, 158, 90, 0.11);
  color: #157347;
}

.imod-tag.is-warn {
  background: rgba(224, 118, 18, 0.13);
  color: #a5560a;
}

.imod-link {
  margin-top: auto;
  padding-top: 14px;
  font-size: 13px;
  color: var(--blue);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.imod-link:hover {
  text-decoration: none;
}

.imod-link::after {
  content: '↗';
  font-size: 12px;
  transition: transform 0.25s var(--ease);
}

.imod-link:hover::after {
  transform: translate(2px, -2px);
}

/* ---------- 机型适配表 ---------- */
.imod-sub {
  margin: 64px 0 0;
  padding-top: 8px;
}

.imod-sub h3 {
  margin: 0;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.012em;
}

.imod-sub > p {
  margin: 8px 0 0;
  font-size: 15px;
  color: var(--text-muted);
}

.imod-table-wrap {
  margin-top: 20px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  -webkit-overflow-scrolling: touch;
}

.imod-table {
  width: 100%;
  min-width: 660px;
  border-collapse: collapse;
  font-size: 14px;
}

.imod-table th,
.imod-table td {
  padding: 13px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  white-space: nowrap;
}

.imod-table thead th {
  position: sticky;
  top: 0;
  background: var(--bg-alt);
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  z-index: 1;
}

.imod-table tbody tr:last-child td {
  border-bottom: 0;
}

.imod-table tbody tr:hover td {
  background: rgba(0, 113, 227, 0.035);
}

.imod-table td:first-child {
  font-weight: 500;
}

.imod-table td .yes {
  color: #1e9e5a;
}

.imod-table td .part {
  color: #e07612;
}

.imod-table td .no {
  color: #b0b0b6;
}

.imod-note {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ---------- 实拍图条 ---------- */
.imod-strip {
  display: flex;
  gap: 12px;
  margin-top: 18px;
  overflow-x: auto;
  padding-bottom: 6px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.imod-strip::-webkit-scrollbar {
  display: none;
}

.imod-strip a {
  flex: none;
  width: 210px;
  scroll-snap-align: start;
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-alt);
  position: relative;
}

.imod-strip img {
  width: 100%;
  height: 148px;
  object-fit: cover;
  display: block;
  transition: transform 0.5s var(--ease);
}

.imod-strip a:hover img {
  transform: scale(1.06);
}

.imod-strip em {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 12px 9px;
  font-style: normal;
  font-size: 12px;
  color: #fff;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.62) 100%);
}

/* ---------- 视频 ---------- */
.imod-videos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(268px, 100%), 1fr));
  gap: 16px;
  margin-top: 20px;
}

.imod-video {
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.imod-video:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.1);
}

.imod-player {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #101014;
  cursor: pointer;
  overflow: hidden;
}

.imod-player img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s var(--ease), opacity 0.3s var(--ease);
}

.imod-player:hover img {
  transform: scale(1.05);
}

.imod-player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.imod-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.14);
  transition: background 0.3s var(--ease);
}

.imod-player:hover .imod-play {
  background: rgba(0, 0, 0, 0.03);
}

.imod-play i {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
  transition: transform 0.3s var(--ease);
}

.imod-player:hover .imod-play i {
  transform: scale(1.1);
}

.imod-play svg {
  width: 20px;
  height: 20px;
  margin-left: 3px;
  color: #101014;
}

.imod-dur {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 11px;
  color: #fff;
  background: rgba(0, 0, 0, 0.62);
  font-variant-numeric: tabular-nums;
}

.imod-vbody {
  padding: 13px 15px 15px;
}

.imod-vbody b {
  display: block;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.imod-vbody span {
  display: block;
  margin-top: 7px;
  font-size: 12px;
  color: var(--text-muted);
}

.imod-vbody span em {
  font-style: normal;
  color: var(--text);
  opacity: 0.75;
}

/* ---------- 安全提示 ---------- */
.imod-safety {
  display: flex;
  gap: 16px;
  margin-top: 20px;
  padding: 22px 24px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fff7ec 0%, #ffefdc 100%);
  border: 1px solid rgba(224, 118, 18, 0.22);
}

.imod-safety > svg {
  flex: none;
  width: 26px;
  height: 26px;
  color: #c2630a;
}

.imod-safety h4 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
  color: #8a460a;
}

.imod-safety ul {
  margin: 0;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.75;
  color: #6f4a1f;
}

.imod-safety li strong {
  color: #8a460a;
  font-weight: 600;
}

.imod-source {
  margin: 46px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
}

.imod-source a {
  color: var(--blue);
}

.imod-empty {
  margin: 26px 0 0;
  font-size: 15px;
  color: var(--text-muted);
}

/* ---------- 入场动画（由 imod.js 驱动，无 JS 时不影响显示） ---------- */
@keyframes imod-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.imod.is-anim .imod-card:not(.is-in),
.imod.is-anim .imod-video:not(.is-in) {
  opacity: 0;
}

.imod .imod-card.is-in,
.imod .imod-video.is-in {
  animation: imod-in 0.6s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 45ms);
}

.imod .imod-video.is-in {
  animation-delay: 0ms;
}

/* 后台内容替换静态内容后重渲染：直接显示，不再播放入场动画 */
.imod.no-anim .imod-card,
.imod.no-anim .imod-video {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
}

/* ---------- 响应式 ---------- */
@media (max-width: 734px) {
  .imod {
    padding: 52px 0 64px;
  }
  .imod .section-head h2 {
    font-size: 30px;
  }
  .imod-sub {
    margin-top: 48px;
  }
  .imod-sub h3 {
    font-size: 21px;
  }
  .imod-safety {
    flex-direction: column;
    gap: 10px;
    padding: 18px 18px 20px;
  }
  .imod-strip a {
    width: 168px;
  }
  .imod-strip img {
    height: 120px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .imod-card,
  .imod-video,
  .imod-cover img,
  .imod-strip img {
    transition: none;
  }
  .imod-card:hover,
  .imod-video:hover {
    transform: none;
  }
}
