/* 项目介绍页（iMirror、bepasty）共用样式。加载在 site.css 之后，沿用同一套 HIG 语义色、
   字体样式和阅读宽度：项目页与文章页同宽、同一顶栏和页脚，只是内容换成介绍页的组件。 */
:root {
  --card: rgb(255 255 255 / .72);      /* 卡片：浅色下比纸白略亮 */
  --card-border: rgb(60 60 67 / .14);
  --shot-shadow: 0 1px 2px rgb(0 0 0 / .08), 0 12px 32px rgb(0 0 0 / .12);
}
@media (prefers-color-scheme: dark) {
  :root {
    --card: rgb(44 44 46 / .72);       /* tertiarySystemBackground */
    --card-border: rgb(84 84 88 / .55);
    --shot-shadow: 0 0 0 1px rgb(255 255 255 / .1), 0 12px 32px rgb(0 0 0 / .45);
  }
}

.product section { padding-block: 2.5rem; border-top: 1px solid var(--rule); }
.product section:first-of-type { border-top: 0; padding-top: .5rem; }
.product h2 { margin-top: 0; }
.section-lead { color: var(--muted); margin-top: -.25em; }

/* 开头：图标 + 名称（与文章标题同一 Large Title 字号），一句话说明，操作按钮 */
.hero { display: grid; gap: 2rem; }
.hero > * { min-width: 0; }
.hero-title { display: flex; align-items: center; gap: .9rem; }
.hero-title img { width: 64px; height: 64px; flex: none; }
.hero h1 { margin: 0; }
.hero .tagline { font-size: 1.25rem; font-weight: 600; line-height: 1.45; margin: 1rem 0 .4rem; }
.hero .summary { color: var(--muted); margin: 0 0 1.5rem; }
.hero-shot { display: flex; justify-content: center; }
.facts { display: flex; flex-wrap: wrap; gap: .4rem .5rem; padding: 0; margin: 1.25rem 0 0; list-style: none; font-size: .8125rem; color: var(--muted); }
.facts li { padding: .2rem .7rem; border-radius: 999px; background: var(--tint); }

/* 按钮：与工具页同一规范。主操作用填充样式（每页一两个），其余用着色样式；高度一致 44pt。 */
.actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 44px; padding: .5rem 1.1rem; border: 0; border-radius: 10px;
  font-size: 1.0625rem; font-weight: 600; line-height: 1.25;
  color: var(--accent-on-tint); background: var(--tint);
  text-decoration: none; touch-action: manipulation;
}
.button:hover { text-decoration: none; filter: brightness(.97); }
.button:active { background: var(--press); }
.button.primary { background: var(--fill-accent); color: var(--on-accent); }
.button.primary:active { background: var(--fill-accent); filter: brightness(.85); }
.button svg { width: 1.1em; height: 1.1em; flex: none; }
.button small { font-size: .8125rem; font-weight: 400; }
@media (prefers-reduced-motion: no-preference) { .button { transition: filter .15s ease, background-color .15s ease; } }
/* 紧凑宽度：按钮占满一行（HIG Buttons：主操作优先用通栏按钮），上下等高排列。 */
@media (max-width: 599px) {
  .actions { flex-direction: column; }
  .actions .button { width: 100%; }
}

.shot { display: block; max-width: 100%; height: auto; border-radius: 12px; box-shadow: var(--shot-shadow); }

/* 功能卡片：阅读宽度内两列，手机一列 */
.features { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); margin-top: 1.5rem; }
.feature { padding: 1.1rem 1.2rem 1rem; border-radius: 14px; background: var(--card); border: 1px solid var(--card-border); }
.feature h3 { display: flex; align-items: center; gap: .6rem; margin: 0 0 .35rem; font-size: 1.0625rem; }
.feature p { margin: 0; color: var(--muted); font-size: .9375rem; line-height: 1.65; }
.feature svg { width: 24px; height: 24px; flex: none; color: var(--accent); }

/* 截图：两列，手机一列 */
.gallery { display: grid; gap: 2rem 1.5rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); align-items: start; margin-top: 1.5rem; }
.gallery figure { margin: 0; display: grid; gap: .75rem; justify-items: center; }
.gallery figcaption { font-size: .9375rem; color: var(--muted); text-align: center; }
.gallery figcaption strong { display: block; color: var(--text); font-size: 1.0625rem; }

/* 步骤 */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: 1.1rem; }
.steps > li { counter-increment: step; display: grid; grid-template-columns: 2rem 1fr; gap: .15rem .9rem; }
.steps > li > * { min-width: 0; }
.steps > li::before {
  content: counter(step); grid-row: span 2; display: grid; place-items: center;
  width: 2rem; height: 2rem; border-radius: 50%; background: var(--fill-accent); color: var(--on-accent);
  font-weight: 700; font-size: .9375rem;
}
.steps strong { display: block; }
.steps p { margin: 0; color: var(--muted); }

/* 单栏阅读宽度下两栏太挤，分组改为上下排列 */
.two-col { display: grid; gap: 2rem; }
.two-col > * { min-width: 0; }
.two-col h3 { margin-top: 0; }
.two-col > div > .meta { margin-top: 0; }

.callout { margin-top: 1.5rem; padding: 1.1rem 1.25rem; border-radius: 14px; background: var(--card); border: 1px solid var(--card-border); }
ul.callout { padding-left: 2.4rem; }
.callout h3 { margin: 0 0 .4rem; font-size: 1.0625rem; }
.callout > p { margin: 0 0 .75rem; color: var(--muted); font-size: .9375rem; }
.callout ul { margin: 0; padding-left: 1.2em; color: var(--muted); font-size: .9375rem; }
.callout li + li { margin-top: .45rem; }

.command { display: flex; align-items: center; gap: .5rem; margin-top: .5rem; padding: .35rem .35rem .35rem .85rem; border-radius: 10px; background: var(--tint); }
.command code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; padding: 0; background: none; }
.command button { flex: none; min-height: 44px; padding: 0 .9rem; border: 0; border-radius: 8px; background: var(--bg); color: var(--accent); font-size: .9375rem; font-weight: 500; }
p code, li code { overflow-wrap: anywhere; }

/* 常见问题：可展开的分组，标题行命中区 44pt */
.faq { margin-top: 1.5rem; display: grid; gap: .75rem; }
.faq details { border-radius: 12px; background: var(--card); border: 1px solid var(--card-border); }
.faq summary {
  cursor: pointer; padding: .7rem 1.15rem; font-weight: 600; min-height: 44px;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  list-style: none; border-radius: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
/* 展开指示：行尾 chevron，收起朝右、展开朝下（HIG 展开控件），颜色用次要文字色。 */
.faq summary::after {
  content: ""; flex: none; width: .55em; height: .9em; background: var(--muted);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 20'%3E%3Cpath d='M2 2l8 8-8 8' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 20'%3E%3Cpath d='M2 2l8 8-8 8' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.faq details[open] > summary::after { transform: rotate(90deg); }
.faq summary:hover { background: var(--tint); }
@media (prefers-reduced-motion: no-preference) { .faq summary::after { transition: transform .2s ease; } }
.faq details > div { padding: 0 1.15rem 1rem; color: var(--muted); font-size: .9375rem; }
.faq details > div > :first-child { margin-top: 0; }
.faq details > div > :last-child { margin-bottom: 0; }
.faq ol, .faq ul { padding-left: 1.2em; }

.feedback .actions { margin-top: 1.5rem; }
.license { margin-top: 2rem; font-size: .8125rem; color: var(--muted); }

/* 演示视频（bepasty）：手机比例，与截图同样的圆角与阴影 */
.demo { display: grid; justify-items: center; gap: .75rem; margin: 0; }
.demo-frame { position: relative; width: min(100%, 300px); }
.demo video { display: block; width: 100%; height: auto; aspect-ratio: 390 / 844; border-radius: 22px; box-shadow: var(--shot-shadow); background: var(--tint); }
.demo-toggle {
  position: absolute; right: .6rem; bottom: .6rem;
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 50%;
  color: #fff; background: rgb(0 0 0 / .55); cursor: pointer;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.demo-toggle svg { width: 18px; height: 18px; }
.demo-toggle svg[hidden] { display: none; }
.demo-toggle:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-transparency: reduce) { .demo-toggle { background: rgb(0 0 0 / .85); } }
.demo figcaption { font-size: .9375rem; color: var(--muted); text-align: center; }
.gallery .shot.phone { width: min(100%, 260px); border-radius: 18px; }

/* 常规宽度（≥900px）：项目页用满外框。开头左文右图；功能卡片、截图多列；
   安装与使用两栏；成段文字（导语、常见问题、提示框）仍限制在阅读宽度内。 */
@media (min-width: 900px) {
  .hero { grid-template-columns: 1.1fr 1fr; align-items: center; gap: 3rem; }
  .section-lead, .faq, .feedback > p { max-width: var(--readable); }
  .gallery { grid-template-columns: repeat(3, 1fr); }
  .two-col { grid-template-columns: 1fr 1fr; gap: 3rem; }
}
