/*
 * detail.css —— 应用/游戏详情页：头部、截图、实测区块、权限、More Information、电脑两栏侧栏、截图查看器。
 * 依赖 main.css 里的配色变量，必须在它之后加载。
 */

/* ── 详情页头部 ─────────────────────────────────────────── */
.app-head { display: grid; grid-template-columns: 76px 1fr; gap: 14px; padding: 16px; background: var(--bg); }
.app-head .icon { width: 76px; height: 76px; border-radius: 18px; }
.app-head h1 { font-size: 21px; }
.app-head .sub { color: var(--text-2); font-size: 14px; margin: 4px 0 0; }
.facts { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 12px; margin: 4px 0 0; font-size: 14px; }
.facts div { display: flex; gap: 6px; min-width: 0; }
.facts dt { color: var(--text-3); flex: none; }
.facts dd { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.dl .btn { padding: 12px 22px; font-size: 16px; }
.dl .dl-note { font-size: 12.5px; color: var(--text-3); text-align: center; }

.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.badge { font-size: 12.5px; padding: 2px 10px; border-radius: 999px; background: var(--band); color: var(--text-2); }
.app-head .indep { margin: 10px 0 0; font-size: 13px; line-height: 1.5; color: var(--text-3); }
.app-head .indep a { color: var(--text-2); text-decoration: underline; text-underline-offset: 2px; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }

/* 截图横滑 */
.shots { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
.shots img { flex: none; height: 360px; width: auto; border-radius: 8px; border: 1px solid var(--line); scroll-snap-align: start; background: var(--band); }

/* 实测区块 */
.checks { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 0 0 12px; }
.check { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.check h3 { font-size: 14px; color: var(--text-2); font-weight: 600; margin-bottom: 4px; }
.check .val { font-size: 16px; font-weight: 600; }
.check .val.ok { color: var(--ok); }
.check .val.warn { color: var(--warn); }
.check p { margin: 4px 0 0; font-size: 13.5px; color: var(--text-2); }
.perm-group { margin: 0 0 12px; }
.perm-group h3 { font-size: 14.5px; margin-bottom: 2px; }
.perm-group .note { font-size: 13px; color: var(--text-3); margin: 0 0 6px; }
.perm-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.perm-list li { font-size: 12.5px; padding: 2px 8px; border-radius: 6px; background: var(--band); color: var(--text-2); }
.perm-list li b { font-weight: 600; color: var(--text); }
details.more-perms summary { cursor: pointer; color: var(--accent-strong); font-size: 14px; margin: 4px 0 8px; }

/* More Information 表 */
.info { margin: 0; display: grid; grid-template-columns: 1fr; font-size: 14px; }
.info div { display: grid; grid-template-columns: 130px 1fr; gap: 8px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.info div:last-child { border-bottom: 0; }
.info dt { color: var(--text-3); }
.info dd { margin: 0; min-width: 0; }
.hash { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; word-break: break-all; color: var(--text-2); }

/* 详情页头部：用途与前提（手机首屏就要看得到） */
.app-head .lede { margin: 8px 0 0; font-size: 15px; line-height: 1.55; color: var(--text); }
.app-head .needs { margin: 6px 0 0; font-size: 14px; color: var(--text-2); }
.app-head .needs span { font-weight: 700; color: var(--accent-strong); margin-right: 6px; }

/* ── 640px 起：平板 ── */
@media (min-width: 640px) {
  .facts { grid-template-columns: repeat(3, 1fr); }
  .checks { grid-template-columns: repeat(2, 1fr); }
  .app-head { grid-template-columns: 96px 1fr auto; align-items: start; padding: 20px; }
  .app-head .icon { width: 96px; height: 96px; border-radius: 22px; }
  .app-head h1 { font-size: 24px; }
  .dl { grid-column: auto; align-items: flex-end; }
  .facts { grid-column: 2 / -1; }
}
/* ── 996px 起：PC ── */
@media (min-width: 996px) {
  .app-head { padding: 24px; }
  .facts { grid-template-columns: repeat(4, 1fr); }
  .checks { grid-template-columns: repeat(4, 1fr); }
  .shots img { height: 420px; }
}

/* ── 详情页两栏（电脑）──────────────────────────────────── */
/* 侧栏 = 下载卡 + 同分类 + 所在专题 + 最新更新。手机上侧栏排在正文之后，下载卡隐藏（头部已有），
   其余列表照常显示 —— 入口在两种版式下都不少。
   不做 sticky：侧栏变长后，吸顶的卡片会盖住下面滚上来的列表 */
.side-card { display: none; }
.side-block { background: var(--bg); padding: 14px 16px 18px; border-top: 8px solid var(--band); }
.side-h { font-size: 17px; font-weight: 600; border-bottom: 1px solid var(--line); padding-bottom: 8px; margin: 0 0 8px; }
.minis { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; }
.mini a { display: flex; align-items: center; gap: 10px; padding: 7px 0; color: var(--text); }
.mini a:hover { text-decoration: none; }
.mini a:hover .mini-name { color: var(--accent-strong); text-decoration: underline; }
.mini .icon { width: 40px; height: 40px; border-radius: 10px; }
.mini .icon-letter { font-size: 17px; }
.mini-body { display: flex; flex-direction: column; min-width: 0; }
.mini-name { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-meta { font-size: 12.5px; color: var(--text-3); }
.side-links { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 14.5px; }
.side-links a, .side-more { text-decoration: underline; text-underline-offset: 2px; }
.side-more { display: inline-block; margin-top: 6px; font-size: 13.5px; }
@media (min-width: 640px) { .minis { grid-template-columns: 1fr 1fr; column-gap: 24px; } }
@media (min-width: 996px) {
  .detail { display: grid; grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
  .detail-main { min-width: 0; border-right: 8px solid var(--band); }
  /* 头部的下载按钮与事实栏挪到侧栏卡片里，免得同一屏出现两个下载按钮 */
  .detail-main .app-head { grid-template-columns: 96px 1fr; }
  .detail-main .app-head .dl, .detail-main .app-head .facts { display: none; }
  .detail-side { padding: 20px 20px 24px; }
  .side-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 12px; }
  .side-id { display: flex; align-items: center; gap: 10px; }
  .side-id .icon { width: 48px; height: 48px; border-radius: 12px; }
  .side-name { font-weight: 700; font-size: 16px; line-height: 1.3; }
  .side-card .btn { width: 100%; padding: 11px 16px; }
  .side-facts { margin: 0; font-size: 13.5px; display: grid; gap: 6px; }
  .side-facts div { display: grid; grid-template-columns: 76px 1fr; gap: 8px; }
  .side-facts dt { color: var(--text-3); }
  .side-facts dd { margin: 0; min-width: 0; }
  .side-link { font-size: 13.5px; text-decoration: underline; text-underline-offset: 2px; }
  .side-block { padding: 20px 0 0; border-top: 0; }
  .side-h { font-size: 15px; }
  .detail-side .minis { grid-template-columns: 1fr; }
  .detail-main .checks { grid-template-columns: repeat(2, 1fr); }
}

/* ── gallery.js：截图查看器 ── */
.shots img { cursor: zoom-in; }
.shots img:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
html.viewer-open { overflow: hidden; }
.viewer { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.92); display: flex; align-items: center; justify-content: center; }
.viewer[hidden] { display: none; }
.viewer-img { max-width: calc(100vw - 32px); max-height: calc(100vh - 88px); width: auto; height: auto; border-radius: 8px; }
.viewer button { position: absolute; border: 0; background: rgba(255,255,255,.14); color: #fff; cursor: pointer; border-radius: 50%; width: 44px; height: 44px; font-size: 28px; line-height: 44px; padding: 0; }
.viewer button:hover { background: rgba(255,255,255,.28); }
.viewer button[hidden] { display: none; }
.viewer-close { top: 12px; right: 12px; }
.viewer-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.viewer-next { right: 12px; top: 50%; transform: translateY(-50%); }
.viewer-count { position: absolute; bottom: 16px; left: 0; right: 0; text-align: center; color: #ddd; font-size: 14px; }
