/* 需求 57：选题页改版（① 市场 → ② 周期 → ③ 形态 → ④ 选项 → 本次摘要 + 开始练习 → ⑤ 其他练法）和这一批的小修。
   新文件，不往 style.css / pages.css 里加；颜色一律用 style.css 的变量（网站目前只有深色一套，以后加浅色也跟着变）。 */

/* 第 8 条：复盘页标题右边那一排按钮（分享 / 查看全图 / 再来一题 / 回到选题）。英文 375px 下一行放不下，超出卡片 27px：允许折行、靠右 */
#view-review .review-box > .row.between > div { flex-wrap: wrap; justify-content: flex-end; min-width: 0; }

/* ---------------------------------------------------------------- 选题页：每一步 */
.start-card .pick-step { margin-top: 14px; }
.start-card .pick-step:first-of-type { margin-top: 4px; }
.step-h { display: flex; align-items: center; justify-content: flex-start; gap: 8px; margin: 0 0 8px; font-size: 14px; font-weight: 600; color: var(--text); }
.step-n { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: var(--sh-on-fill, #fff); font-size: 12px; font-weight: 700; line-height: 1; }
.step-head { display: flex; align-items: baseline; justify-content: space-between; gap: 4px 12px; flex-wrap: wrap; }
.step-head .step-h { margin-bottom: 8px; }
.step-link { font-size: 13px; white-space: nowrap; }

/* ③ 形态：一排按钮，第一个「随机（所有形态）」，每个带可练题数 */
.shape-chips { display: flex; flex-wrap: wrap; gap: 6px 8px; }
.shape-chips .chip { display: inline-flex; align-items: baseline; gap: 6px; width: auto; max-width: 100%; margin: 0; padding: 6px 12px; min-height: 34px;
  border-radius: 17px; background: var(--panel2); color: var(--text); font-size: 13px; line-height: 1.3; text-align: left; }
.shape-chips .chip:hover:not(:disabled) { border-color: var(--accent); }
.shape-chips .chip.on { background: var(--accent); border-color: var(--accent); color: var(--sh-on-fill, #fff); }
.shape-chips .chip:disabled { opacity: .55; cursor: not-allowed; }
.shape-chips .sc-name { overflow-wrap: anywhere; }
.shape-chips .sc-n { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.shape-chips .chip.on .sc-n { color: var(--sh-on-fill-dim, rgba(255, 255, 255, .8)); }
.shape-chips .shape-more { background: transparent; color: var(--muted); border-style: dashed; }
.shape-chips .shape-multi { cursor: default; }
/* 日线的「按形态出题」下拉框由 ③ 的按钮代替（JS 仍读写它），只留所选形态的说明 */
#step-shape .setup-box { margin: 8px 0 0; padding: 6px 10px; }
#step-shape .setup-pick { display: none; }
#step-shape .setup-note { margin: 0; }

/* 「更多条件」：放在 ③ 下面，默认折叠；里面原来的卡片去掉外框，免得卡片套卡片 */
#step-shape .pick-more { margin-top: 10px; background: var(--panel2); }
#step-shape .pick-more > summary { padding: 8px 12px; }
#step-shape .pick-more-body > .card { background: var(--panel); margin: 0; }

/* ④ 选项 */
.start-card .opt-row { display: flex; align-items: center; gap: 8px 20px; flex-wrap: wrap; }
.start-card #step-opts .adv { margin-top: 8px; border-top: 0; padding-top: 0; }

/* 最后一行：本次摘要 + 全宽「开始练习」 */
.start-card .start-cta { margin: 16px 0 4px; padding-top: 14px; border-top: 1px solid var(--line); }
.start-card .start-cta .pick-summary { margin: 0 0 8px; }
.start-card .start-cta button.big.start-btn { display: block; width: 100%; min-width: 0; max-width: none; }
.start-card .start-row { margin: 8px 0 4px; }
.start-card .start-row .progress-box { margin-left: 0; }

/* ⑤ 其他练法：开始练习下面，次一级的卡片 */
.alt-box { background: transparent; border-style: dashed; }
.alt-box .alt-h { margin: 0 0 8px; font-size: 14px; font-weight: 600; color: var(--muted); }
.alt-box .alt-row { margin: 0; }
.alt-box .alt-card { flex: 1 1 190px; }

/* 「怎么练」：折叠块，收起时只剩一行标题 */
.howto > summary.howto-sum { display: flex; align-items: baseline; gap: 4px 10px; flex-wrap: wrap; cursor: pointer; list-style: none; user-select: none; }
.howto > summary.howto-sum::-webkit-details-marker { display: none; }
.howto > summary.howto-sum::before { content: "▸"; color: var(--muted); }
.howto[open] > summary.howto-sum::before { content: "▾"; }
.howto > summary.howto-sum h2 { margin: 0; font-size: 16px; }
.howto-hint { font-size: 12px; }
.howto[open] > summary.howto-sum .howto-hint { display: none; }
.howto[open] > summary.howto-sum { margin-bottom: 6px; }

/* 手机：「开始练习」连同本次摘要固定在屏幕底部，随时能点；选题页底部留出它的高度 */
@media (max-width: 639px) {
  .start-card .start-cta { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; margin: 0;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px)); background: var(--panel); border-top: 1px solid var(--line);
    box-shadow: 0 -6px 18px var(--sh-shadow, rgba(0, 0, 0, .35)); }
  .start-card .start-cta .pick-summary { margin: 0 0 6px; font-size: 12px; line-height: 1.35; }
  .start-card .start-cta button.big.start-btn { padding: 11px 16px; font-size: 17px; min-height: 46px; }
  #view-picker { padding-bottom: 118px; }
  .shape-chips .chip { min-height: 40px; }
  .alt-box .alt-card { flex: 1 1 100%; }
}

/* D17：「怎么练」挪到开始卡片最上面（标题下面、① 市场上面），是卡片里的一个小框；收起时只占一行 */
.start-card .howto { margin: 2px 0 6px; padding: 7px 12px; border: 1px solid var(--sh-sel-line, #2f4f86); border-radius: 6px; }
.start-card .howto > summary.howto-sum h2 { font-size: 14px; font-weight: 600; }
.start-card .howto .steps { margin-top: 4px; font-size: 13px; }
