/* =========================================================
   App Detail page — 73:27 two-column layout
   ========================================================= */

/* ---------- Layout ---------- */
.det-page {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 24px;
  padding-bottom: 48px;
  padding-left: 16px;
  padding-right: 16px;
}

.det-main {
  min-width: 0;
}

.det-sidebar {
  min-width: 0;
}

/* ---------- Breadcrumb ---------- */
.det-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  padding-bottom: 12px;
}
.det-breadcrumb__link {
  color: var(--text-secondary);
  transition: color .2s;
}
.det-breadcrumb__link:hover {
  color: var(--primary);
}
.det-breadcrumb__sep {
  color: var(--card-border);
}
.det-breadcrumb__current {
  color: var(--text-primary);
  font-weight: 500;
}

/* ---------- 1. App Header ---------- */
.det-app-header {
  display: flex;
  gap: 16px;
  align-items: center;
  padding-top: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--card-border);
}
.det-app-header__icon {
  width: 90px;
  height: 90px;
  border-radius: 10px;
  flex-shrink: 0;
  object-fit: cover;
  background: #f4f6f8;
}
.det-app-header__meta {
  flex: 1;
  min-width: 0;
}
.det-app-header__name {
  font-size: 24px;
  line-height: 1.25;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--text-primary);
}
.det-app-header__sub {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-secondary);
}
.det-app-header__rating-stars {
  display: inline-flex;
  align-items: center;
  gap: 1px;
}
.det-star {
  color: #fbbf24;
  fill: currentColor;
}
.det-star--empty {
  color: #e5e7eb;
}
.det-app-header__rating-num {
  font-weight: 600;
  color: var(--text-primary);
}
.det-app-header__sep {
  color: var(--card-border);
}
.det-app-header__cat {
  color: var(--primary);
}
.det-app-header__cat:hover {
  text-decoration: underline;
}
.det-app-header__dev {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-secondary);
}
.det-app-header__by {
  margin-right: 4px;
}
.det-app-header__dev-link {
  color: var(--primary);
}
.det-app-header__dev-link:hover {
  text-decoration: underline;
}

/* ---------- 3. Screenshots ---------- */
.det-screenshots-wrap {
  padding-top: 24px;
  padding-bottom: 8px;
}
.det-screenshots {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
}
.det-screenshots::-webkit-scrollbar {
  height: 6px;
}
.det-screenshots::-webkit-scrollbar-thumb {
  background: var(--card-border);
  border-radius: 3px;
}
.det-screenshots__img {
  aspect-ratio: 9 / 16;
  height: 320px;
  flex-shrink: 0;
  border-radius: 12px;
  background: #f4f6f8;
  object-fit: cover;
}

/* ---------- 4. Download buttons (§5.2.1) ---------- */
.det-download {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 16px;
  padding-bottom: 16px;
}
.det-dl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 160px;
  height: 44px;
  padding-left: 18px;
  padding-right: 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  background: var(--primary);
  border: 1px solid var(--primary);
  transition: background .2s, border-color .2s, opacity .2s;
  cursor: pointer;
}
.det-dl-btn:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}
.det-dl-btn--gp {
  background: #ffffff;
  color: var(--primary);
}
.det-dl-btn--gp:hover {
  background: var(--primary-soft-bg);
  color: var(--primary);
}
.det-dl-btn--ios {
  background: #ffffff;
  color: var(--primary);
}
.det-dl-btn--ios:hover {
  background: var(--primary-soft-bg);
  color: var(--primary);
}
.det-dl-btn--disabled {
  opacity: .45;
  pointer-events: none;
  cursor: not-allowed;
}
.det-dl-btn__icon {
  flex-shrink: 0;
}

/* ---------- Anchor tabs ---------- */
.det-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--card-border);
  margin-top: 24px;
  margin-bottom: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.det-tabs::-webkit-scrollbar {
  display: none;
}
.det-tabs__item {
  flex-shrink: 0;
  padding-top: 10px;
  padding-bottom: 10px;
  padding-left: 14px;
  padding-right: 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
}
.det-tabs__item:hover {
  color: var(--primary);
}
.det-tabs__item.is-active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ---------- Section header ---------- */
.det-section {
  padding-top: 24px;
  padding-bottom: 8px;
}
.det-section-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
}
.det-section-hd__title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}
.det-section-hd__more {
  font-size: 13px;
  color: var(--primary);
  font-weight: 500;
}
.det-section-hd__more:hover {
  text-decoration: underline;
}

/* ---------- Overview ---------- */
.det-overview {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-primary);
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.det-overview p {
  margin-bottom: 12px;
}
.det-overview h2,
.det-overview h3,
.det-overview h4 {
  font-size: 16px;
  font-weight: 700;
  margin-top: 16px;
  margin-bottom: 8px;
  color: var(--text-primary);
}
.det-overview ul,
.det-overview ol {
  padding-left: 20px;
  margin-bottom: 12px;
}
.det-overview li {
  margin-bottom: 4px;
}
.det-overview a {
  color: var(--primary);
}
.det-overview a:hover {
  text-decoration: underline;
}
.det-overview img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.det-link {
  color: var(--primary);
}
.det-link:hover {
  text-decoration: underline;
}

/* ---------- Pros & Cons ---------- */
.det-proscons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.det-proscons__col {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 16px;
}
.det-proscons__col--pros {
  border-left: 3px solid #10b981;
}
.det-proscons__col--cons {
  border-left: 3px solid #ef4444;
}
.det-proscons__title {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--text-primary);
}
.det-proscons__placeholder {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

/* ---------- Good to Know ---------- */
.det-good-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.det-good-list__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 12px;
  padding-right: 12px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  font-size: 13px;
}
.det-good-list__icon {
  color: var(--primary);
  flex-shrink: 0;
}
.det-good-list__key {
  flex: 0 0 110px;          /* fixed left column so values align across rows */
  color: var(--text-secondary);
  text-transform: capitalize;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.det-good-list__val {
  flex: 1;
  min-width: 0;
  text-align: right;
  color: var(--text-primary);
  font-weight: 500;
  white-space: nowrap;      /* keep the date / value on a single line */
  overflow: hidden;
  text-overflow: ellipsis;
}
.det-good-list__link {
  color: var(--primary);
}
.det-good-list__link:hover {
  text-decoration: underline;
}

/* ---------- App Information table ---------- */
.det-info-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  overflow: hidden;
  font-size: 13px;
}
.det-info-table th,
.det-info-table td {
  padding-top: 10px;
  padding-bottom: 10px;
  padding-left: 14px;
  padding-right: 14px;
  text-align: left;
  border-bottom: 1px solid var(--card-border);
  vertical-align: middle;
}
.det-info-table tr:last-child th,
.det-info-table tr:last-child td {
  border-bottom: none;
}
.det-info-table th {
  font-weight: 500;
  color: var(--text-secondary);
  width: 35%;
  background: #fafbfc;
}
.det-info-table td {
  color: var(--text-primary);
  word-break: break-word;
}

/* ---------- Similar Apps grid ---------- */
.det-similar {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.det-similar__card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  transition: border-color .2s, box-shadow .2s;
}
.det-similar__card:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(30, 119, 255, 0.08);
}
.det-similar__icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  flex-shrink: 0;
  object-fit: cover;
  background: #f4f6f8;
}
.det-similar__body {
  min-width: 0;
  flex: 1;
}
.det-similar__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.det-similar__rating {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.det-similar__rating svg {
  color: #fbbf24;
}

/* ---------- Related Articles ---------- */
.det-articles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.det-articles__card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  overflow: hidden;
  padding-bottom: 10px;
  transition: border-color .2s, box-shadow .2s;
}
.det-articles__card:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(30, 119, 255, 0.08);
}
.det-articles__img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #f4f6f8;
  display: block;
}
.det-articles__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  padding-top: 10px;
  padding-bottom: 0;        /* 不要在 line-clamp 元素上留 bottom padding，否则被截断的下一行会渗入 padding 区域露出半行 */
  padding-left: 12px;
  padding-right: 12px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* =========================================================
   RIGHT SIDEBAR
   ========================================================= */

.det-side-get {
  margin-bottom: 16px;
}
.det-side-get__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 44px;
  background: var(--primary-soft-bg);
  color: var(--primary);
  border-radius: 6px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
  transition: background .2s, color .2s;
}
.det-side-get__btn:hover {
  background: var(--primary);
  color: #ffffff;
}

.det-side-block {
  margin-bottom: 24px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 14px;
}
.det-side-block__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--card-border);
}

.det-side-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.det-side-list li + li {
  margin-top: 10px;
}
.det-side-list__item {
  display: flex;
  align-items: center;
  gap: 10px;
  transition: opacity .2s;
}
.det-side-list__item:hover {
  opacity: .9;
}
.det-side-list__item:hover .det-side-list__name {
  color: var(--primary);
}
.det-side-list__icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  flex-shrink: 0;
  object-fit: cover;
  background: #f4f6f8;
}
.det-side-list__body {
  min-width: 0;
  flex: 1;
}
.det-side-list__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color .2s;
}
.det-side-list__meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.det-side-list__meta svg {
  color: #fbbf24;
  flex-shrink: 0;
}
.det-side-list__cat {
  margin-left: 6px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =========================================================
   MOBILE (≤1023px)
   ========================================================= */
@media (max-width: 1023px) {
  .det-page {
    grid-template-columns: 1fr;
    gap: 0;
    padding-top: 16px;
    padding-bottom: 32px;
    padding-left: 12px;
    padding-right: 12px;
  }

  .det-sidebar {
    display: none;
  }

  /* download buttons: full width stacked */
  .det-download {
    flex-direction: column;
    gap: 10px;
  }
  .det-dl-btn {
    width: 100%;
    flex: 0 0 auto;
    min-width: 0;
  }

  .det-app-header {
    padding-top: 16px;
    padding-bottom: 16px;
  }
  .det-app-header__name {
    font-size: 20px;
  }
  .det-app-header__icon {
    width: 72px;
    height: 72px;
  }

  /* screenshots: keep 9/16 aspect, smaller height */
  .det-screenshots__img {
    height: 260px;
  }

  /* pros & cons stack */
  .det-proscons {
    grid-template-columns: 1fr;
  }

  /* good to know single column */
  .det-good-list {
    grid-template-columns: 1fr;
  }

  /* similar wider cards */
  .det-similar {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  /* related articles: single column on phones */
  .det-articles {
    grid-template-columns: 1fr;
  }

  .det-section {
    padding-top: 20px;
  }
}

@media (max-width: 600px) {
  .det-app-header {
    gap: 12px;
  }
  .det-app-header__name {
    font-size: 18px;
  }
  .det-info-table th {
    width: 40%;
  }
  .det-screenshots__img {
    height: 220px;
  }
}
