/* The original dialogue shell is retained; only the new selection controls live here. */
.sage-switch,.sage-history { min-height:44px;padding:9px 16px;border:1px solid rgba(246,239,222,.44);border-radius:999px;background:rgba(34,31,24,.68);color:#fbf5e6;font:inherit;font-size:13px;cursor:pointer;white-space:nowrap;backdrop-filter:blur(8px) }
.sage-switch:hover,.sage-history:hover { background:rgba(34,31,24,.82) }
.sage-switch:disabled { opacity:.55;cursor:wait }
.sage-switch:focus-visible,.sage-history:focus-visible,.sage-picker button:focus-visible,.sage-picker summary:focus-visible,.sage-picker a:focus-visible { outline:2px solid #ba8547;outline-offset:3px }
.sage-picker { position:fixed;inset:0;z-index:40;background:rgba(28,27,22,.4);display:flex;justify-content:center;align-items:center;padding:24px;box-sizing:border-box }
.sage-picker[hidden] { display:none }
.sage-picker-card { width:min(820px,100%);max-height:calc(100dvh - 48px);display:flex;flex-direction:column;background:#faf7ee;color:#2d352c;border:1px solid #d7d6c6;border-radius:20px;box-shadow:0 24px 80px #171c2840;overflow:hidden }
.sage-picker-head { flex:none;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 20px 10px }
.sage-picker-head p { margin:0 0 4px;font-size:11px;line-height:1.4;letter-spacing:.12em;color:#737a69 }
.sage-picker-head h2 { margin:0;font:600 22px/1.25 "Songti SC","STSong",serif }
.sage-picker-close { min-width:44px;min-height:44px;padding:8px 13px;border:1px solid #dedbcd;border-radius:999px;background:#fffdf7;color:#455b4c;cursor:pointer;font-size:13px }
.sage-tabs { flex:none;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;margin:0 20px 10px;padding:4px;background:#eeeee4;border-radius:11px }
.sage-tabs button { min-height:44px;border:0;border-radius:9px;background:transparent;color:#737969;font:600 14px "Songti SC","STSong",serif;cursor:pointer }
.sage-tabs button[aria-selected="true"] { background:#285340;color:#fffdf4;box-shadow:0 2px 6px #193a261a }
.sage-picker-body { min-height:0;padding:0 20px 16px;overflow:auto;overscroll-behavior:contain }
.sage-card-list { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;align-items:start }
.sage-person { min-width:0;border:1px solid #dfdfd0;border-radius:13px;background:#fffdf7;overflow:hidden }
.sage-person.is-selected { border-color:#7f9a82;box-shadow:inset 0 0 0 1px #7f9a8244 }
.sage-person-select { display:block;width:100%;padding:12px;border:0;background:transparent;text-align:left;color:inherit;cursor:pointer }
.sage-person-name { display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0 0 4px;font:600 19px/1.25 "Songti SC","STSong",serif }
.sage-person-name small { font:500 11px system-ui,sans-serif;color:#54735b }
.sage-person-motto { display:block;font-size:11px;line-height:1.4;color:#687b63 }
.sage-person-intro { display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;margin-top:6px;font-size:11px;line-height:1.6;color:#677061 }
.sage-person details { border-top:1px solid #eeeade;padding:0 12px }
.sage-person summary { min-height:36px;display:flex;align-items:center;cursor:pointer;color:#596d55;font-size:12px;list-style:none }
.sage-person summary::after { content:attr(data-expand-label);margin-left:auto;font:400 11px system-ui }
.sage-person details[open] summary::after { content:attr(data-collapse-label) }
.sage-source { margin:0 0 14px;font-size:12px;line-height:1.75 }
.sage-source a { color:#3d6350;text-underline-offset:3px }
.sage-source p { margin:4px 0 0;color:#7a7b6c }
.sage-reading-intro { margin:0 0 12px;color:#66705f;font-size:12px;line-height:1.75 }
.sage-picker-note { margin:10px 0 0;color:#747a68;font-size:11px;line-height:1.7 }
.sage-shared-note { display:flex;align-items:center;justify-content:space-between;gap:10px;margin:0 0 9px;color:rgba(251,245,230,.85);font-size:11px;line-height:1.6 }
.sage-shared-note span { text-shadow:0 1px 5px #201a17 }
.sage-welcome[hidden] { display:none }
.ym-bg { background-image:var(--sage-mobile-bg,url("assets/对话阳明精简版.jpg")) }
@media(min-width:601px) { .ym-bg { background-image:var(--sage-desktop-bg,url("assets/对话阳明pc.jpg")) } }
@media(max-width:600px) {
  .ym-top { display:grid;grid-template-columns:auto minmax(0,1fr);gap:8px 12px;align-items:center;padding-bottom:8px }
  .ym-title span#sageCurrentLabel { display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;letter-spacing:.05em }
  .ym-top-end { grid-column:1/-1;width:100%;justify-content:flex-end;gap:7px;margin:0 }
  .sage-switch,.sage-history { min-height:40px;padding:8px 14px;font-size:12px }
  .ym-audio { min-height:40px }
  .ym-inkquotes { top:calc(110px + env(safe-area-inset-top)) }
  .sage-picker { align-items:flex-end;padding:0 }
  .sage-picker-card { width:100%;max-height:calc(100dvh - 18px - env(safe-area-inset-top));border-radius:22px 22px 0 0;padding-bottom:env(safe-area-inset-bottom) }
  .sage-picker-head { padding:12px 16px 10px }
  .sage-picker-head h2 { font-size:20px }
  .sage-tabs { margin:0 16px 10px }
  .sage-picker-body { padding:0 16px 12px }
  .sage-card-list { grid-template-columns:1fr;gap:8px }
  .sage-person-select { padding:10px 12px }
  .sage-person-name { font-size:18px }
}
@media(max-width:600px) and (max-height:700px) { .sage-person-intro { -webkit-line-clamp:1;margin-top:4px }.sage-person-select { padding:9px 12px } }
@media(prefers-reduced-motion:reduce) { .ym-inkquotes-track { animation:none }.ym-log { scroll-behavior:auto } }

.ym-audio[hidden]{display:none!important}

/* New paper backgrounds need an ink-colored heading for readable contrast. */
.ym-title h1{color:#312d23;text-shadow:0 1px 0 #fff8}
.ym-title span#sageCurrentLabel{color:#474c36;text-shadow:0 1px 0 #fff7}
.sage-shared-note{padding:3px 8px;border-radius:6px;background:rgba(250,247,238,.86)}
.sage-shared-note span{color:#59624f;text-shadow:none}
