/* vgogo 书房（登录后首页）— C 风格
 * 今天的信（完整问题 + 小幅参考照片）→ 这本书写到哪了 / 家人的来信 → 书脊书架。
 * 作用域 #view-memoir .st；颜色、字体全部来自 css/tokens.css。
 */
#view-memoir .st { color: var(--vg-ink); font-family: var(--vg-sans); font-size: 16px; line-height: 1.75; padding-bottom: 64px; }
#view-memoir .st :where(h1, h2, h3, p, ul, ol, figure) { margin: 0; }
#view-memoir .st :where(ul, ol) { padding: 0; list-style: none; }
#view-memoir .st button { font: inherit; }

/* 问候 */
.st-greet { padding-block: 24px 16px; }
.st-greet .hi { font: 400 24px/1.4 var(--vg-hand); color: var(--vg-seal); }
.st-greet h1 { margin-top: 4px; font: 700 24px/1.25 var(--vg-serif); text-wrap: balance; }

/* 今天的信：文字决定高度，照片只作参考，保持原始比例且不放大。 */
.st-feature { width: 100%; max-width: var(--vg-wrap); margin-inline: auto; padding-inline: var(--vg-gutter); }
.st-letter-card { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px 48px; padding: 24px; background: var(--vg-paper); border-radius: var(--vg-r-md); }
.st-letter-card.has-photo { grid-template-columns: minmax(0, 1fr) 240px; }
.st-letter-meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; padding-bottom: 24px; border-bottom: 1px solid var(--vg-line); font-size: var(--pub-size-caption, 14px); }
.st-letter-label { display: inline-flex; align-items: center; gap: 12px; color: var(--vg-seal); }
.st-letter-label i { font-size: 20px; }
.st-letter-book { margin-left: auto; color: var(--vg-ink2); overflow-wrap: anywhere; }
.st-letter-content { min-width: 0; align-self: center; }
#view-memoir .st-question { max-width: 22em; color: var(--vg-ink); font: 500 24px/1.65 var(--vg-serif); overflow-wrap: anywhere; white-space: pre-line; text-wrap: pretty; }
#view-memoir .st-letter-note { margin-top: 16px; font-size: var(--pub-size-body, 18px); color: var(--vg-ink2); }
.st-act { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding-top: 32px; }
.st-act .vg-btn i { font-size: 20px; }
.st-hint { font-size: var(--pub-size-caption, 14px); color: var(--vg-ink2); }
.st-reference { min-width: 0; align-self: center; }
#view-memoir .st-reference-open { display: grid; place-items: center; width: 100%; min-height: var(--vg-tap); padding: 12px; border: 0; border-radius: var(--vg-r-sm); background: var(--vg-bg); cursor: zoom-in; }
.st-reference-open img { display: block; width: auto; height: auto; max-width: 100%; max-height: 200px; object-fit: contain; }
#view-memoir .st-reference-open:hover { background: var(--vg-soft); }
#view-memoir .st-reference-open:focus-visible { outline: 3px solid var(--vg-info); outline-offset: 4px; }
.st-reference figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding-top: 12px; font-size: var(--pub-size-caption, 14px); color: var(--vg-ink2); }
.st-reference figcaption span { color: var(--vg-seal); }

/* 下方两栏 */
.st-cols { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 24px; padding-block: 32px 8px; }
.st-cols:has(.st-main:empty):has(.st-side:empty) { display: none; }
.st-sec + .st-sec { margin-top: 40px; }
.st-chs li { display: grid; grid-template-columns: 3.2rem minmax(0, 1fr) auto; gap: 8px 16px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--vg-line); }
.st-chs b { display: block; font: 700 18px/1.4 var(--vg-serif); overflow-wrap: anywhere; }
.st-chs .m { font-size: 14px; color: var(--vg-ink2); }
.st-chs .vg-no { font-size: 30px; }

.st-mail li { border-bottom: 1px solid var(--vg-line); }
.st-mail button { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 16px; width: 100%; padding: 16px 0; background: none; border: 0; color: inherit; text-align: left; cursor: pointer; }
.st-mail button:hover .who { text-decoration: underline; text-underline-offset: 4px; }
.st-mail .av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; font: 700 16px var(--vg-serif); }
.st-mail .tx { display: grid; gap: 8px; min-width: 0; }
.st-mail .who { font-size: 16px; line-height: 1.7; overflow-wrap: anywhere; }
.st-mail .who em { font-style: normal; font: 700 16px var(--vg-serif); }
.st-mail .q { padding: 12px 16px; background: var(--vg-paper); border: 1px solid var(--vg-line); font: 400 14px/1.9 var(--vg-serif); color: var(--vg-ink2); overflow-wrap: anywhere; }
.st-mail .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 12px; color: var(--vg-ink2); }

/* 书脊书架 */
.st-shelfsec { padding-block: 40px 0; }
.st-shelf { display: flex; align-items: flex-end; gap: 8px; padding: 32px 4px 0; border-bottom: 14px solid #2b1f14; overflow-x: auto; overflow-y: hidden; }
.st-bk {
  position: relative; flex: none; width: clamp(60px, 8vw, 92px); display: flex; flex-direction: column; align-items: center; padding: 16px 0 12px;
  border: 0; border-radius: 4px 6px 6px 4px; color: #fff; cursor: pointer;
  box-shadow: inset 6px 0 8px -4px rgba(0, 0, 0, .45), 0 8px 14px -8px rgba(0, 0, 0, .6); transition: translate .2s;
}
.st-bk:hover { translate: 0 -6px; }
.st-bk .lb { writing-mode: vertical-rl; text-orientation: upright; background: var(--vg-bg); color: var(--vg-ink); font: 700 12px/1.1 var(--vg-serif); letter-spacing: .16em; padding: 12px 8px; border-radius: 2px; white-space: nowrap; }
.st-bk small { margin-top: auto; padding-top: 12px; font-size: 12px; opacity: .88; }
.st-bk.g { background: #2f5545; height: 210px; }
.st-bk.b { background: #3a4f7c; height: 208px; }
.st-bk.r { background: #7a3640; height: 190px; }
.st-bk.cur { width: clamp(150px, 18vw, 208px); height: 248px; padding: 0; overflow: hidden; align-items: stretch; background: #23365a; translate: 0 -10px; text-align: left; }
.st-bk.cur:hover { translate: 0 -14px; }
.st-bk.cur img { width: 100%; height: 62%; object-fit: cover; }
.st-bk.cur .blank { height: 62%; display: grid; place-items: center; background: #2d4472; font: 700 24px var(--vg-serif); letter-spacing: .3em; padding-left: 8px; }
.st-bk.cur .in { display: block; padding: 12px 12px; }
.st-bk.cur .in b { display: block; font: 700 16px/1.35 var(--vg-serif); overflow-wrap: anywhere; }
.st-bk.cur .in small { display: block; padding: 2px 0 0; font-size: 12px; }
.st-bk .ribbon { position: absolute; top: 0; right: 12px; width: 12px; height: 30px; background: var(--vg-seal); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%); }
.st-bk.add { height: 176px; justify-content: center; gap: 8px; background: transparent; color: var(--vg-ink); border: 1.5px dashed var(--vg-line-strong); box-shadow: none; }
.st-bk.add .lb { background: transparent; font-weight: 600; }
.st-bk.add i { font-size: 20px; }
.st-cap { margin-top: 16px; font-size: 14px; color: var(--vg-ink2); }
.st-more { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 24px; padding-top: 16px; font-size: 14px; color: var(--vg-ink2); }
.st-more b { font: 700 16px var(--vg-serif); color: var(--vg-ink); }

/* 第一次来 */
.st-empty { position: relative; min-height: 440px; display: flex; align-items: center; background: var(--vg-night); color: #fff; overflow: hidden; }
.st-empty > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(.55); }
.st-empty .in { position: relative; padding-block: 64px; }
.st-empty .hi { font: 400 24px/1.4 var(--vg-hand); opacity: .92; margin-bottom: 8px; }
.st-empty h1 { font: 700 30px/1.25 var(--vg-serif); text-wrap: balance; }
.st-empty .lead { margin-top: 16px; max-width: 26em; color: #ece9e1; font-size: 16px; line-height: 1.9; }
.st-empty .vg-btn { margin-top: 24px; }
.st-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; padding-block: 40px 24px; }
.st-steps li { border-top: 2px solid var(--vg-ink); padding-top: 16px; }
.st-steps .vg-no { font-size: 36px; }
.st-steps h3 { margin-top: 8px; font: 700 20px/1.4 var(--vg-serif); }
.st-steps p { margin-top: 8px; color: var(--vg-ink2); font-size: 16px; line-height: 1.85; }

@media (max-width: 900px) {
  .st-cols, .st-steps { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .st-bk.cur { width: 128px; height: 230px; }
  .st-bk { width: 56px; }
}
@media (prefers-reduced-motion: reduce) { .st-bk { transition: none; } }

@media (max-width: 767px) {
  .st-letter-card.has-photo { grid-template-columns: minmax(0, 1fr); }
  .st-letter-card { gap: 24px; }
  .st-letter-book { margin-left: 0; }
  .st-reference { width: min(100%, 240px); }
  .st-reference-open img { max-height: 160px; }
  .st-act { align-items: flex-start; flex-direction: column; }
}

/* 手机默认书目列表、电脑默认书脊；两端均可切换。 */
.st-book-info { display:none; }
#view-memoir .st-shelfsec[data-layout="list"] .st-shelf { display:grid; grid-template-columns:minmax(0,1fr); gap:12px; padding:16px 0 0; border-bottom:0; overflow:visible; }
#view-memoir .st-shelfsec[data-layout="list"] .st-bk { display:grid; grid-template-columns:64px minmax(0,1fr); align-items:center; gap:16px; width:100%; height:auto; min-height:104px; padding:16px; color:var(--vg-ink); background:var(--vg-paper); border:1px solid var(--vg-line); border-radius:var(--vg-r-sm); box-shadow:none; translate:none; text-align:left; }
#view-memoir .st-shelfsec[data-layout="list"] .st-bk:hover { translate:none; border-color:var(--vg-line-strong); }
#view-memoir .st-shelfsec[data-layout="list"] .st-bk .lb { display:block; min-width:0; max-height:76px; overflow:hidden; writing-mode:horizontal-tb; text-orientation:mixed; white-space:normal; letter-spacing:0; padding:12px; background:var(--vg-soft); font:700 16px/1.6 var(--vg-serif); }
#view-memoir .st-shelfsec[data-layout="list"] .st-bk .st-book-role { display:none; }
#view-memoir .st-shelfsec[data-layout="list"] .st-book-info { display:block; min-width:0; }
#view-memoir .st-shelfsec[data-layout="list"] .st-book-info b { display:block; overflow-wrap:anywhere; font:700 18px/1.6 var(--vg-serif); }
#view-memoir .st-shelfsec[data-layout="list"] .st-bk small { display:block; padding-top:4px; color:var(--vg-ink2); font-size:14px; }
#view-memoir .st-shelfsec[data-layout="list"] .st-bk.cur :is(img,.blank) { width:64px; height:76px; object-fit:cover; }
#view-memoir .st-shelfsec[data-layout="list"] .st-bk.cur .in { padding:0; min-width:0; }
#view-memoir .st-shelfsec[data-layout="list"] .st-bk.cur .in b { font-size:18px; line-height:1.6; }
#view-memoir .st-shelfsec[data-layout="list"] .st-bk.add { min-height:72px; grid-template-columns:32px minmax(0,1fr); }
#view-memoir .st-shelfsec[data-layout="list"] .st-bk.add .lb { background:transparent; }
#view-memoir .st-shelfsec[data-layout="list"] .st-cap { display:none; }
.st-shelf-order { display:flex; flex-wrap:wrap; align-items:center; gap:12px; color:var(--vg-ink2); margin-block:16px; }
.st-shelf-order .mm-select { width:auto; max-width:100%; }
.st-shelf-book-details { min-height:3.5em; overflow-wrap:anywhere; }
@media(min-width:768px) { .st-bk > .st-book-info > [data-shelf-status] { display:none; } }

/* 流式字号改成两档字阶：小屏取下限，≥64rem 取上限 */
@media (min-width: 64rem) {
  .st-greet .hi { font-size: 30px; }
  .st-greet h1 { font-size: 48px; }
  #view-memoir .st-question { font-size: 36px; }
  .st-bk .lb { font-size: 16px; }
  .st-empty .hi { font-size: 30px; }
  .st-empty h1 { font-size: 48px; }
}

/* 流式留白改成两档间距：小屏取下限，≥64rem 取上限 */
@media (min-width: 64rem) {
  .st-greet { padding-block: 40px 16px; }
  .st-letter-card { padding: 48px; }
  .st-cols { gap: 80px; }
  .st-cols { padding-block: 64px 8px; }
  .st-shelf { gap: 16px; }
  .st-steps { gap: 48px; }
  .st-steps { padding-block: 64px 24px; }
}
