@import url("assets/reading-fonts.css?v=1.2.0");

:root {
    color-scheme: light;
    --paper: #fffaf0;
    --page: #f2ece1;
    --ink: #3c3142;
    --muted: #6e596d;
    --line: #e2d5cb;
    --accent: #694774;
    --gold: #ebcc8b;
    font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--page); }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid #a97e31; outline-offset: 4px; }
img { display: block; width: auto; height: auto; max-width: 100%; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.msh-top {
    display: flex; justify-content: space-between; gap: 1rem; align-items: center;
    padding: 1rem max(1.25rem, calc((100vw - 1050px) / 2));
    background: #20182e; color: #fff3dc; font-size: .9rem;
}
.msh-brand { display: inline-flex; gap: .64rem; align-items: center; font: 1.3rem "MSH Song", "Songti SC", serif; }
.msh-brand img { width: 38px; height: 38px; object-fit: contain; }
.msh-brand small { display: block; margin-top: .2rem; font: .66rem system-ui, sans-serif; letter-spacing: .12em; }
.msh-top button { color: inherit; background: transparent; border: 0; min-height: 42px; padding: .4rem .25rem; }
.msh-hero { color: #fff5e3; background: radial-gradient(ellipse at 22% 24%, #563960, transparent 57%), #281d3a; }
.msh-hero-inner {
    display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.14fr);
    max-width: 1100px; margin: auto; padding: clamp(2rem, 6vw, 5rem) 1.5rem;
    gap: clamp(1.6rem, 6vw, 5rem); align-items: center;
}
.msh-hero figure { margin: 0; }
.msh-hero img { border-radius: .8rem; box-shadow: 0 18px 50px #130a1a88; }
.msh-intro h1 { margin: .4rem 0 .65rem; font-family: "Noto Serif SC", "Songti SC", serif; font-size: clamp(2.05rem, 4vw, 3.2rem); line-height: 1.28; }
.msh-kicker { color: var(--accent); font-size: .86rem; font-weight: 700; letter-spacing: .13em; }
.msh-hero .msh-kicker, .msh-english { color: var(--gold); }
.msh-english { font-size: .79rem; letter-spacing: .09em; line-height: 1.55; }
.msh-credit { color: #dbc8d9; font-size: .92rem; }
.msh-tagline { font-size: clamp(1rem, 1.9vw, 1.18rem); line-height: 1.85; margin: 1.6rem 0; }
.msh-price { display: flex; flex-wrap: wrap; gap: .8rem; align-items: baseline; }
.msh-price del { color: #dac5d6; }
.msh-price strong { color: #ffdc9b; font-size: 1.35rem; }
.msh-button {
    display: inline-flex; justify-content: center; align-items: center; min-height: 44px;
    border: 1px solid transparent; border-radius: .45rem; padding: .62rem 1rem;
    color: #fff8ee; background: #603d68; font-weight: 700;
}
.msh-hero .msh-button { color: #2e2034; background: #f0d196; }
.msh-subtle { display: inline-block; padding: .7rem .5rem; margin-left: .3rem; text-decoration: underline; text-underline-offset: .2em; }
.msh-sections { max-width: 975px; margin: 0 auto; padding: clamp(1.2rem, 4vw, 3rem) 1.15rem; display: grid; gap: 1.15rem; }
.msh-card { background: var(--paper); border: 1px solid var(--line); border-radius: .85rem; padding: clamp(1.3rem, 4vw, 2rem); }
.msh-renewal { background: #f3e8f0; border-color: #e0cedb; }
.msh-card h2 { margin: 0 0 .65rem; font-family: "Noto Serif SC", "Songti SC", serif; }
.msh-card p { margin: .5rem 0 .95rem; line-height: 1.85; text-indent: 0; }
.msh-card p:last-child { margin-bottom: 0; }
.msh-card p strong { color: #68465e; background: linear-gradient(transparent 66%, #e7cda26b 66%); }
.msh-card .msh-intro-accent { padding: .38rem 0 .38rem .85rem; border-left: 2px solid #ad835b; color: #68465e; }
.msh-list { margin: .3rem 0 0; padding-left: 1.6rem; }
.msh-list li { border-top: 1px solid var(--line); }
.msh-list a { display: flex; justify-content: space-between; align-items: baseline; gap: .7rem; padding: .92rem 0; }
.msh-list span { color: var(--muted); flex: none; font-size: .78rem; }
.msh-contact { margin-top: 1rem; }
.msh-contact summary { cursor: pointer; color: var(--accent); }
.msh-contact img { margin: .75rem 0 0; }
.msh-form-row { display: flex; gap: .55rem; align-items: center; margin-top: .45rem; }
.msh-form-row input { max-width: 100%; min-height: 44px; border: 1px solid #b6a1b1; border-radius: .45rem; padding: .5rem .65rem; }
.msh-footer { padding: 0 1.2rem 2rem; text-align: center; color: var(--muted); font-size: .82rem; }
.msh-reading { --page: #f1ecdf; --paper: #fffaf0; --ink: #3a3432; --muted: #635851; --accent: #71516b; }
.msh-reading[data-theme="1"] { --page: #ede4cf; --paper: #f7eed8; }
.msh-reading[data-theme="2"] { color-scheme: dark; --page: #211e26; --paper: #2b2530; --ink: #f4e8dd; --muted: #d3c3c6; --accent: #dfbbe5; --line: #54465b; }
.msh-reading .msh-top {
    position: relative;
    background: var(--paper); color: var(--ink); border-bottom: 1px solid var(--line);
}
.msh-reading .msh-top::before {
    position: fixed; z-index: 4; top: 0; left: 0;
    width: var(--msh-progress, 0); height: 2px; background: #b58a55; content: "";
}
.msh-reading-layout { display: grid; grid-template-columns: 220px minmax(0, 790px); align-items: start; gap: 1.6rem; max-width: 1060px; padding: 2rem 1.1rem 3rem; margin: auto; }
.msh-sidebar { position: sticky; top: 1rem; padding: 1.2rem; border: 1px solid var(--line); border-radius: .7rem; background: var(--paper); }
.msh-sidebar img { max-width: 112px; border-radius: .3rem; }
.msh-sidebar ol { margin: .5rem 0 0; padding-left: 1.2rem; font-size: .89rem; line-height: 1.6; }
.msh-sidebar li + li { margin-top: .6rem; }
.msh-sidebar [aria-current] { color: var(--accent); font-weight: bold; }
.msh-paper { min-width: 0; border: 1px solid var(--line); border-radius: .75rem; background: var(--paper); padding: clamp(1.15rem, 4vw, 3rem); }
.msh-paper h1 { margin: .4rem 0 1rem; font-family: "Noto Serif SC", "Songti SC", serif; font-size: clamp(1.6rem, 4.5vw, 2.4rem); }
.msh-tools, .msh-pager { display: flex; gap: .6rem; flex-wrap: wrap; }
.msh-tools button, .msh-selection button, .msh-dialog button {
    padding: .5rem .7rem; border: 1px solid var(--line); border-radius: .4rem;
    color: var(--ink); background: var(--paper); min-height: 40px;
}
.msh-tools { position: sticky; top: 0; z-index: 2; gap: .2rem .45rem; margin: 0 0 1.7rem; padding-block: .3rem; background: var(--paper); border-block: 1px solid var(--line); align-items: center; }
.msh-tools button { border-color: transparent; padding-inline: .25rem; font-size: .87rem; text-align: left; }
.msh-tools button[aria-pressed="true"] { font-weight: 700; color: var(--accent); }
#msh-progress { margin-left: auto; font-size: .8rem; color: var(--muted); min-width: 2.4rem; text-align: right; }
.msh-byline { font-size: .86rem; color: var(--muted); margin: .75rem 0 1.5rem; }
.msh-help { color: var(--muted); border-block: 1px solid var(--line); padding-block: .75rem; font-size: .84rem; line-height: 1.6; margin: .7rem 0 1.65rem; }
#msh-article {
    --msh-reading-font: "MSH Song", "Songti SC", "Noto Serif CJK SC", SimSun, serif;
    font-family: var(--msh-reading-font); font-size: 19px; line-height: 1.95; overflow-wrap: anywhere;
}
#msh-article :is(p, li, blockquote, h2, h3, h4, span, strong, em, a, mark, figcaption) { font-family: var(--msh-reading-font) !important; }
.msh-reading[data-font="hei"] #msh-article { --msh-reading-font: "MSH Hei", "PingFang SC", "Microsoft YaHei", sans-serif; }
.msh-reading[data-font="kai"] #msh-article { --msh-reading-font: "MSH Kai", "Kaiti SC", KaiTi, serif; }
.msh-reading[data-spacing="wide"] #msh-article { line-height: 2.23; }
.msh-focus .msh-reading-layout { display: block; max-width: 800px; }
.msh-focus .msh-sidebar, .msh-focus .msh-help { display: none; }
.msh-reading[data-size="1"] #msh-article { font-size: 22px; }
.msh-reading[data-size="2"] #msh-article { font-size: 25px; }
.msh-reading[data-size="3"] #msh-article { font-size: 17px; }
#msh-article p { text-indent: 0; margin: 0 0 1.25em; text-align: left; }
#msh-article h2 { margin: 1.55em 0 .6em; font-size: 1.16em; color: var(--accent); clear: both; }
#msh-article strong { color: var(--accent); }
#msh-article blockquote, .msh-dialog blockquote { margin: 1.3em 0; padding: .8em 1em; border-left: 3px solid #b38a52; background: color-mix(in srgb, var(--accent) 9%, var(--paper)); }
#msh-article blockquote p { margin: 0; }
#msh-article .msh-illustration { margin: 0 0 1.5rem; }
.msh-illustration img { margin: auto; max-height: 34rem; object-fit: contain; border-radius: .45rem; }
.msh-sign { color: var(--muted); font-size: .9em; }
.msh-pager { margin-top: 1.6rem; border-top: 1px solid var(--line); padding-top: 1rem; color: var(--accent); font-size: .9rem; justify-content: space-between; }
.msh-selection {
    position: fixed; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; max-width: calc(100vw - 16px);
    padding: .16rem .24rem; border-radius: .6rem; background: var(--paper); color: var(--ink);
    border: 1px solid var(--line); box-shadow: 0 5px 22px #271b3638;
}
.msh-selection button { min-height: 37px; padding: .25rem .6rem; border: 0; border-radius: 0; background: transparent; font-size: .8rem; white-space: nowrap; }
.msh-selection button + button { border-left: 1px solid var(--line); }
.msh-selection::after { content: ""; position: absolute; left: var(--msh-selection-arrow, 50%); width: 8px; height: 8px; background: var(--paper); transform: translateX(-50%) rotate(45deg); pointer-events: none; }
.msh-selection[data-side="below"]::after { top: -5px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.msh-selection[data-side="above"]::after { bottom: -5px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.msh-selection[data-side="edge"]::after { display: none; }
::highlight(msh-mark) { background: #f7d37a99; color: inherit; }
mark.msh-mark { background: #f7d37a99; color: inherit; }
.msh-dialog { width: min(calc(100% - 2rem), 540px); max-height: 86vh; border: 1px solid var(--line); border-radius: .7rem; color: var(--ink); background: var(--paper); padding: 1.2rem; }
.msh-dialog::backdrop { background: #20172899; }
.msh-dialog h2 { padding-right: 2rem; margin: 0 0 1rem; }
.msh-dialog .msh-close { position: absolute; right: .8rem; top: .75rem; min-width: 40px; }
.msh-dialog section { padding: .65rem 0; border-bottom: 1px solid var(--line); }
.msh-dialog p { white-space: pre-wrap; }
.msh-dialog button:not(.msh-close) { margin: .25rem .25rem .2rem 0; }
.msh-dialog img { max-height: 52vh; object-fit: contain; margin-bottom: .6rem; }
.msh-dialog textarea { display: block; width: 100%; margin: .5rem 0; border-radius: .35rem; padding: .6rem; }
.msh-settings-panel {
    position: absolute; top: calc(100% + .45rem); left: 0; z-index: 3;
    width: min(100%, 340px); padding: .65rem .9rem; background: var(--paper); color: var(--ink);
    border: 1px solid var(--line); border-radius: .65rem; box-shadow: 0 10px 28px #291f3940;
}
.msh-setting { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); align-items: center; gap: .4rem; padding: .43rem 0; font-size: .83rem; }
.msh-setting + .msh-setting { border-top: 1px solid var(--line); }
.msh-setting-options { display: flex; flex-wrap: wrap; gap: .25rem; }
.msh-setting-options button { min-height: 34px; padding: .2rem .45rem; border: 1px solid var(--line); text-align: center; font-size: .79rem; }
.msh-setting-options button[aria-pressed="true"] { color: var(--accent); background: var(--page); border-color: var(--accent); }
.msh-reader-name { display: inline-block; color: var(--accent); overflow-wrap: anywhere; font-size: .92rem; }
.msh-visibility { display: flex; align-items: center; gap: .45rem; padding: .6rem 0; font-size: .87rem; }
.msh-note-feedback { margin: .35rem 0; color: var(--accent); }
.msh-community-marker { display: block; padding: .42rem .68rem; margin: -.5rem 0 1.35rem; border-radius: .4rem; border: 1px solid var(--line); background: var(--page); color: var(--accent); font: 700 .76rem system-ui, sans-serif; }
#msh-article blockquote > .msh-community-marker { margin: .65rem 0 0; }
.msh-dialog-toc { padding-left: 1.4rem; line-height: 1.75; }
.msh-dialog-toc a { display: block; padding: .32rem; }
.msh-dialog-toc [aria-current] { color: var(--accent); font-weight: bold; }
.msh-dialog img[alt="书摘图片预览"] { width: 100%; max-height: none; border-radius: .5rem; }
.msh-excerpt-hint { color: var(--muted); margin: .85rem 0 .65rem; font-size: .85rem; }
.msh-toast { position: fixed; z-index: 3; left: 50%; bottom: 4.4rem; transform: translateX(-50%); width: max-content; max-width: 92vw; padding: .65rem .9rem; border-radius: .45rem; color: white; background: #292034; }
@media (max-width: 690px) {
    .msh-hero-inner { grid-template-columns: 1fr; padding: 1.65rem 1.25rem 2rem; }
    .msh-hero figure { max-width: min(100%, 325px); margin: 0 auto; }
    .msh-reading-layout { display: block; padding: .7rem .68rem 2rem; }
    .msh-sidebar { display: none; }
    .msh-top { padding: .78rem .9rem; }
}
@media (max-width: 380px) {
    .msh-form-row { align-items: stretch; flex-direction: column; }
    .msh-list a { flex-wrap: wrap; gap: .25rem; }
}
