/* ============================================================
   古代文学小说库 —— 前台样式
   宣纸底 / 宋体 / 朱红点缀；封面取靛蓝布面线装书，左侧书签即书名
   ============================================================ */
.gx-wrap {
    --paper: #fbf6ec;
    --paper2: #f4ead8;
    --ink: #2f2a26;
    --ink2: #6b625a;
    --blue: #2c4c6e;
    --blue2: #3a5f86;
    --blue3: #223c58;
    --red: #b23a32;
    --gold: #c8a878;
    --line: #e6dbc9;
    max-width: 1180px;
    margin: 0 auto;
    padding: 6px 0 30px;
    color: var(--ink);
    font-family: "Songti SC", "SimSun", "Noto Serif SC", Georgia, serif;
    box-sizing: border-box;
}

.gx-wrap *,
.gx-wrap *::before,
.gx-wrap *::after {
    box-sizing: border-box;
}

.gx-wrap a {
    color: inherit;
    text-decoration: none;
}

/* ---------------- 头部 ---------------- */
.gx-hero {
    padding: 4px 0 16px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 18px;
}

.gx-hero .page-title {
    margin: 0 0 8px;
    font-size: 27px;
    font-weight: 600;
    letter-spacing: 3px;
    color: var(--ink);
}

.gx-hero .page-sub {
    margin: 0;
    font-size: 13px;
    color: var(--ink2);
    line-height: 1.8;
}

.gx-hero .page-sub b {
    color: var(--red);
    font-weight: 600;
}

/* ---------------- 搜索 ---------------- */
.gx-search {
    display: flex;
    gap: 10px;
    align-items: stretch;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.gx-search-box {
    position: relative;
    flex: 1;
    min-width: 240px;
}

.gx-search-ico {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    opacity: .55;
}

.gx-search-box input {
    width: 100%;
    height: 44px;
    padding: 0 34px 0 38px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fffdf8;
    font-size: 14px;
    font-family: inherit;
    color: var(--ink);
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.gx-search-box input:focus {
    border-color: var(--blue2);
    box-shadow: 0 0 0 3px rgba(44, 76, 110, .08);
}

.gx-search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    line-height: 18px;
    text-align: center;
    border-radius: 50%;
    color: #9a938c;
    font-size: 15px;
}

.gx-search-clear:hover {
    background: #f0e9dc;
    color: var(--red);
}

.gx-search-btn,
.gx-random-btn {
    height: 44px;
    padding: 0 24px;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.gx-search-btn {
    border: 1px solid var(--blue);
    background: linear-gradient(135deg, var(--blue2), var(--blue));
    color: #f7f3ea;
    letter-spacing: 2px;
    box-shadow: 0 4px 12px rgba(44, 76, 110, .22);
}

.gx-search-btn:hover {
    background: linear-gradient(135deg, #446b95, #31547a);
}

.gx-random-btn {
    border: 1px solid var(--line);
    background: #fffdf8;
    color: var(--ink2);
}

.gx-random-btn:hover {
    border-color: var(--gold);
    color: var(--red);
}

/* ---------------- 统计 ---------------- */
.gx-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 18px;
}

.gx-stat {
    background: linear-gradient(180deg, #fffdf8, #f8f1e4);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 13px 8px;
    text-align: center;
}

.gx-stat b {
    display: block;
    font-size: 23px;
    font-weight: 400;
    color: var(--blue);
    letter-spacing: 1px;
}

.gx-stat span {
    font-size: 12px;
    color: #9a938c;
}

/* ---------------- 拼音索引 ---------------- */
.gx-letter {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 12px;
    align-items: center;
}

.gx-letter a,
.gx-letter span {
    min-width: 32px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 0 7px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fffdf8;
    font-size: 13px;
    color: var(--ink2);
    font-family: "Times New Roman", serif;
}

.gx-letter a i {
    font-size: 9px;
    color: #b3a897;
    font-style: normal;
}

.gx-letter a:hover {
    border-color: var(--blue2);
    color: var(--blue);
}

.gx-letter a.active {
    background: linear-gradient(135deg, var(--blue2), var(--blue));
    border-color: var(--blue);
    color: #f7f3ea;
}

.gx-letter a.active i {
    color: rgba(255, 255, 255, .65);
}

.gx-lf-all {
    padding: 0 12px !important;
    font-family: inherit !important;
    letter-spacing: 1px;
}

.gx-lf-empty {
    color: #d6cdbe !important;
    background: #faf6ee !important;
}

/* ---------------- 题材 ---------------- */
.gx-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: center;
    margin-bottom: 16px;
    padding: 10px 12px;
    background: #fffdf8;
    border: 1px solid var(--line);
    border-radius: 10px;
}

.gx-cats-lab {
    font-size: 12.5px;
    color: #a4977f;
    margin-right: 2px;
    letter-spacing: 1px;
}

.gx-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 11px;
    border-radius: 15px;
    font-size: 12.5px;
    color: #6f6558;
    border: 1px solid transparent;
    transition: all .18s;
}

.gx-chip i {
    font-style: normal;
    font-size: 10px;
    color: #b3a897;
}

.gx-chip:hover {
    background: #f6efe2;
    color: var(--blue);
}

.gx-chip.is-cur {
    background: rgba(44, 76, 110, .09);
    border-color: rgba(44, 76, 110, .22);
    color: var(--blue);
    font-weight: 600;
}

/* ---------------- 结果头 ---------------- */
.gx-res-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    margin: 4px 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--line);
    font-size: 13px;
    color: #8a8177;
}

.gx-res-head b {
    color: var(--red);
    font-weight: 600;
}

.gx-res-page {
    font-size: 12px;
    color: #a8a093;
}

/* ============================================================
   线装书封面：靛蓝布面 + 左侧题签（书名）+ 右缘订线
   ============================================================ */
.gx-book {
    position: relative;
    flex: 0 0 auto;
}

.gx-book-link {
    display: block;
    position: relative;
    width: 100%;
    height: 100%;
}

/* 书身：靛蓝布面 */
.gx-bk {
    display: block;
    position: relative;
    width: 100%;
    height: 100%;
    background-color: #19375c;
    background-image:
        repeating-linear-gradient(90deg, rgba(255, 255, 255, .022) 0 1px, transparent 1px 4px),
        repeating-linear-gradient(0deg, rgba(0, 0, 0, .028) 0 1px, transparent 1px 4px),
        radial-gradient(125% 95% at 30% 4%, rgba(255, 255, 255, .05), rgba(255, 255, 255, 0) 56%),
        linear-gradient(168deg, #1c3d61 0%, #18365a 46%, #142b47 100%);
    border-radius: 1px 3px 3px 1px;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, .10) inset,
        0 5px 12px rgba(28, 32, 40, .28);
    overflow: hidden;
}

/* 右缘装订：一根纵线 + 四道横线 */
.gx-bk-stitch {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 15%;
    background-image:
        repeating-linear-gradient(180deg,
            transparent 0 11.5%,
            rgba(222, 217, 200, .82) 11.5% 11.95%,
            transparent 11.95% 24%);
    pointer-events: none;
}

/* 纵向装订线：置于装订带中部，横线穿过它延伸到书口 */
.gx-bk-stitch::before {
    content: "";
    position: absolute;
    left: 42%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(180deg,
            rgba(226, 221, 204, .55),
            rgba(234, 230, 214, .92) 8%,
            rgba(234, 230, 214, .92) 92%,
            rgba(226, 221, 204, .55));
    box-shadow: 0 0 .6px rgba(0, 0, 0, .2);
}

/* 左侧题签 */
.gx-bk-label {
    position: absolute;
    left: 6.2%;
    top: 5%;
    width: 34%;
    height: 66%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 7% 8%;
    background: linear-gradient(176deg, #f1f1e5 0%, #e9eadc 62%, #e2e3d3 100%);
    border: 1px solid rgba(255, 255, 255, .28);
    box-shadow:
        0 0 0 1px rgba(18, 24, 30, .22),
        0 1px 4px rgba(0, 0, 0, .26);
    overflow: hidden;
}

.gx-bk-label::before {
    content: "";
    position: absolute;
    inset: 5% 7%;
    border: 1px solid rgba(46, 45, 38, .8);
    pointer-events: none;
}

.gx-bk-name {
    writing-mode: vertical-rl;
    text-orientation: upright;
    font-size: 11.5px;
    line-height: 1.06;
    letter-spacing: .5px;
    font-weight: 500;
    color: #26241d;
    font-family: "KaiTi", "STKaiti", "Kaiti SC", "楷体", "Songti SC", "SimSun", serif;
    letter-spacing: 1px;
    max-height: 100%;
    max-width: 100%;
    overflow: hidden;
}

/* 尺寸 */
/* 尺寸：按古籍线装书常见比例 1 : 1.5 */
.gx-book-sm {
    width: 96px;
    height: 144px;
}

.gx-book-md {
    width: 104px;
    height: 156px;
}

.gx-book-lg {
    width: 146px;
    height: 219px;
}

.gx-book-lg .gx-bk-label {
    width: 30%;
    padding: 6% 7%;
}

.gx-book-lg .gx-bk-name {
    font-size: 16px;
    letter-spacing: 2px;
}

.gx-book-lg .gx-bk-stitch::before {
    width: 2px;
}

/* ============================================================
   卡片
   ============================================================ */
.gx-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
    gap: 14px;
}

.gx-grid-sm {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.gx-card {
    display: flex;
    gap: 12px;
    padding: 14px 14px 12px;
    background: linear-gradient(180deg, #fffdf8, #faf4e8);
    border: 1px solid var(--line);
    border-radius: 12px;
    transition: box-shadow .22s, transform .22s, border-color .22s;
}

.gx-card:hover {
    border-color: #dccdb4;
    box-shadow: 0 8px 20px rgba(90, 68, 40, .1);
    transform: translateY(-2px);
}

.gx-card-body {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.gx-name {
    margin: 0 0 5px;
    font-size: 15.5px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: .5px;
}

.gx-name a {
    color: var(--ink);
}

.gx-name a:hover {
    color: var(--red);
}

.gx-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-bottom: 6px;
    font-size: 11.5px;
    color: #96897a;
}

.gx-author {
    color: #7a6a56;
}

.gx-cat {
    padding: 1px 7px;
    border-radius: 9px;
    background: rgba(44, 76, 110, .08);
    color: #40587a;
    font-size: 10.5px;
}

.gx-rate {
    color: #b4671f;
}

.gx-intro {
    margin: 0 0 8px;
    font-size: 12.5px;
    line-height: 1.75;
    color: #7d7367;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gx-card-foot {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11.5px;
    color: #a89b88;
    padding-top: 6px;
    border-top: 1px dashed #ece2d1;
}

.gx-open {
    color: var(--blue);
    letter-spacing: 1px;
}

.gx-open i {
    font-style: normal;
    transition: margin-left .2s;
}

.gx-card:hover .gx-open i {
    margin-left: 3px;
}

/* ---------------- 分页 ---------------- */
.gx-pager {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    align-items: center;
    margin: 24px 0 6px;
    font-size: 13px;
}

.gx-pg {
    min-width: 34px;
    height: 32px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fffdf8;
    color: var(--ink2);
}

.gx-pg:hover {
    border-color: var(--blue2);
    color: var(--blue);
}

.gx-pg.is-cur {
    background: linear-gradient(135deg, var(--blue2), var(--blue));
    border-color: var(--blue);
    color: #f7f3ea;
}

.gx-pg.is-off {
    color: #cfc6b8;
    background: #faf6ee;
}

.gx-pg-dot {
    color: #b3a897;
    padding: 0 2px;
}

.gx-pg-info {
    margin-left: 8px;
    color: #a89b88;
    font-size: 12px;
}

/* ---------------- 空态 / 说明 ---------------- */
.gx-miss {
    padding: 46px 20px;
    text-align: center;
    font-size: 13.5px;
    line-height: 2;
    color: #a29a90;
    background: #fffdf8;
    border: 1px dashed #e3d9c8;
    border-radius: 12px;
}

.gx-miss a {
    color: var(--red);
}

.gx-dim {
    color: #a8a093;
}

.gx-block {
    margin-top: 24px;
}

.gx-sec-title {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 2px;
    color: var(--ink);
    padding-left: 10px;
    border-left: 3px solid var(--red);
}

.gx-sec-title span {
    font-size: 11.5px;
    font-weight: 400;
    color: #a89b88;
    letter-spacing: 0;
    margin-left: 4px;
}

.gx-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.gx-chip-lg {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 13px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fffdf8;
    font-size: 12.5px;
    color: #6f6558;
}

.gx-chip-lg i {
    font-style: normal;
    font-size: 10px;
    color: #b3a897;
}

.gx-chip-lg:hover {
    border-color: var(--blue2);
    color: var(--blue);
}

.gx-about {
    margin-top: 26px;
    padding: 16px 18px;
    background: #fffdf8;
    border: 1px solid var(--line);
    border-radius: 12px;
    font-size: 12.5px;
    line-height: 1.95;
    color: #7d7367;
}

.gx-about h4 {
    margin: 0 0 8px;
    font-size: 13.5px;
    color: var(--ink);
    letter-spacing: 1px;
}

.gx-about p {
    margin: 0 0 6px;
}

.gx-warn {
    color: #a8907a;
    font-size: 12px;
}

.gx-hit {
    background: rgba(178, 58, 50, .13);
    color: inherit;
    padding: 0 1px;
    border-radius: 2px;
}

/* ============================================================
   详情页
   ============================================================ */
.gx-crumb {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12.5px;
    color: #9a938c;
    margin-bottom: 14px;
}

.gx-crumb a {
    color: #7d7367;
}

.gx-crumb a:hover {
    color: var(--red);
}

.gx-crumb-cat {
    padding: 2px 10px;
    border-radius: 10px;
    background: rgba(44, 76, 110, .07);
    color: #40587a;
}

.gx-detail-hero {
    display: flex;
    gap: 26px;
    padding: 20px;
    background: linear-gradient(180deg, #fffdf8, #f8f1e4);
    border: 1px solid var(--line);
    border-radius: 14px;
}

.gx-hero-book {
    padding-top: 4px;
}

.gx-hero-info {
    flex: 1;
    min-width: 0;
}

.gx-detail-name {
    margin: 2px 0 10px;
    font-size: 25px;
    font-weight: 600;
    letter-spacing: 3px;
    color: var(--ink);
}

.gx-detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
    font-size: 12px;
}

.gx-tag {
    padding: 3px 10px;
    border-radius: 11px;
    background: rgba(44, 76, 110, .08);
    color: #40587a;
    font-size: 11.5px;
}

.gx-tag-author {
    background: rgba(178, 58, 50, .08);
    color: var(--red);
}

.gx-tag.is-plain {
    background: #f1e9db;
    color: #8a7f6e;
}

.gx-detail-intro {
    margin: 0 0 16px;
    font-size: 13.5px;
    line-height: 2;
    color: #5f584f;
    text-align: justify;
}

.gx-detail-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.gx-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    padding: 0 22px;
    border-radius: 9px;
    font-size: 13.5px;
    letter-spacing: 2px;
    font-family: inherit;
    cursor: pointer;
}

.gx-btn-main,
.gx-btn-main:link,
.gx-btn-main:visited {
    /* 宿主主题对 a 有更强选择器的颜色覆盖，这里必须压住 */
    background: linear-gradient(135deg, #3a5f86, #2c4c6e) !important;
    color: #fbf6ea !important;
    text-decoration: none !important;
    border: 1px solid rgba(255, 255, 255, .14);
    box-shadow: 0 5px 14px rgba(44, 76, 110, .26);
}

.gx-btn-main:hover,
.gx-btn-main:focus {
    background: linear-gradient(135deg, #476f9a, #33577d) !important;
    color: #ffffff !important;
}

.gx-btn-main .gx-ico {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
    opacity: .95;
}

.gx-btn-ghost {
    border: 1px solid var(--line);
    background: #fff;
    color: #6f6558;
}

.gx-btn-ghost:hover {
    border-color: var(--gold);
    color: var(--red);
}

.gx-btn.is-off {
    background: #f2ece0;
    color: #a8a093;
    cursor: default;
}

/* 回目 */
.gx-toc {
    margin-top: 22px;
    padding: 18px 20px;
    background: #fffdf8;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.gx-toc-list {
    margin: 0;
    padding: 0;
    list-style: none;
    columns: 3;
    column-gap: 18px;
}

.gx-toc-list li {
    break-inside: avoid;
    margin-bottom: 2px;
}

.gx-toc-list a {
    display: flex;
    gap: 7px;
    align-items: baseline;
    padding: 6px 6px;
    border-radius: 6px;
    font-size: 12.5px;
    color: #5f584f;
    line-height: 1.55;
}

.gx-toc-list a:hover {
    background: #f6efe2;
    color: var(--blue);
}

.gx-toc-list li.is-cur a {
    background: rgba(44, 76, 110, .09);
    color: var(--blue);
    font-weight: 600;
}

.gx-toc-no {
    flex: 0 0 auto;
    min-width: 18px;
    font-size: 10.5px;
    color: #b3a897;
    font-family: "Times New Roman", serif;
}

.gx-toc-txt {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================================
   阅读器：双页跨页 + 翻页
   ============================================================ */
.gx-read {
    --leaf-pad: 30px;
}

.gx-read-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #fffdf8;
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-bottom: 14px;
    font-size: 12.5px;
}

.gx-read-back {
    color: var(--blue);
    white-space: nowrap;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gx-read-ctitle {
    flex: 1;
    min-width: 0;
    color: #6f6558;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: .5px;
}

.gx-read-tools {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.gx-tool {
    height: 27px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    font-size: 11.5px;
    font-family: inherit;
    color: #7a6f60;
    cursor: pointer;
}

.gx-tool:hover {
    border-color: var(--blue2);
    color: var(--blue);
}

/* 书体 */
.gx-stage {
    perspective: 2400px;
    padding: 6px 0 0;
}

.gx-spread {
    position: relative;
    display: grid;
    /* minmax(0,…) 必不可少：竖排正文的 min-content 宽度等于整页文字宽度，
       用 1fr 会把格撑成大小不一，文字溢出纸面 */
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    /* 限宽：单页约 1:1.35，接近真实古籍书页，避免摊成方块 */
    max-width: 720px;
    margin: 0 auto;
    background: #efe4cf;
    border-radius: 8px;
    box-shadow:
        0 18px 40px rgba(60, 46, 28, .22),
        0 2px 0 #fff inset;
    transform-style: preserve-3d;
}

/* 书脊凹槽 */
.gx-spread::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 26px;
    transform: translateX(-50%);
    background: linear-gradient(90deg,
        rgba(120, 96, 62, 0) 0%,
        rgba(120, 96, 62, .16) 42%,
        rgba(70, 54, 32, .26) 50%,
        rgba(120, 96, 62, .16) 58%,
        rgba(120, 96, 62, 0) 100%);
    pointer-events: none;
    z-index: 3;
}

.gx-leaf {
    position: relative;
    min-width: 0;
    min-height: 560px;
    overflow: hidden;
    background:
        radial-gradient(120% 90% at 50% 0%, #fffdf6 0%, #fbf5e8 55%, #f6eedd 100%);
}

.gx-leaf-l {
    border-radius: 8px 0 0 8px;
    box-shadow: inset -14px 0 24px -18px rgba(90, 68, 40, .38);
}

.gx-leaf-r {
    border-radius: 0 8px 8px 0;
    box-shadow: inset 14px 0 24px -18px rgba(90, 68, 40, .38);
    transform-origin: left center;
    backface-visibility: hidden;
    transition: transform .62s cubic-bezier(.42, .05, .3, 1);
}

.gx-leaf-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
    min-height: 460px;
    padding: 20px var(--leaf-pad) 14px;
}

.gx-leaf-head {
    flex: 0 0 auto;
    font-size: 10.5px;
    color: #b3a795;
    letter-spacing: 1px;
    border-bottom: 1px solid #ece0cb;
    padding-bottom: 7px;
    margin-bottom: 12px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.gx-leaf-body {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    font-size: 16px;
    line-height: 2.05;
    color: #3a342d;
    letter-spacing: .6px;
    text-align: justify;
    overflow: auto;
    padding-right: 6px;
}

.gx-leaf-body p {
    margin: 0 0 .55em;
    text-indent: 2em;
}

.gx-leaf-foot {
    flex: 0 0 auto;
    text-align: center;
    font-size: 10.5px;
    color: #b9ad99;
    padding-top: 8px;
    font-family: "Times New Roman", serif;
}

.gx-leaf-end {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
}

.gx-end-mark {
    font-size: 15px;
    letter-spacing: 6px;
    color: #b09c7c;
    text-indent: 0 !important;
}

.gx-end-tip {
    font-size: 12px;
    color: #a89b88;
    text-indent: 0 !important;
}

.gx-end-actions {
    text-indent: 0 !important;
}

/* 竖排 */
.gx-read.is-vm .gx-leaf-body {
    writing-mode: vertical-rl;
    text-orientation: upright;
    line-height: 1.72;
    letter-spacing: 1px;
    height: 560px;
    overflow: auto;
    padding: 0 12px;
    scrollbar-width: none;
    /* 长串英文/数字也要能断开，否则一列撑破纸面 */
    word-break: break-all;
    overflow-wrap: anywhere;
}

.gx-read.is-vm .gx-leaf-body::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.gx-read.is-vm .gx-leaf-body p {
    /* 竖排里段落若为块级，会各自独占一列，短句留白、列数虚增；
       改成行内连排，整页字形连续流动，段落用两个全角空格起首 */
    display: inline;
    margin: 0;
    text-indent: 0;
}

.gx-read.is-vm .gx-leaf-body p + p::before {
    content: "\3000\3000";
}

.gx-read.is-vm .gx-leaf-end p,
.gx-read.is-vm .gx-leaf-body.gx-dim p {
    display: block;
}

.gx-read.is-vm .gx-leaf-inner {
    min-height: 560px;
}

.gx-read.is-vm .gx-end-mark,
.gx-read.is-vm .gx-end-tip {
    writing-mode: horizontal-tb;
}

.gx-read.is-vm .gx-leaf-end {
    writing-mode: horizontal-tb;
}

/* 朗读进行中 */
.gx-tool.gx-tts.is-on {
    background: var(--red);
    border-color: var(--red);
    color: #fff;
}

.gx-tool.gx-tts.is-on:hover {
    color: #fff;
}

/* 翻页时 3D 阴影 */
.gx-flip-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(60, 46, 28, .18), rgba(60, 46, 28, 0) 40%);
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s;
}

.gx-leaf-r.is-flipping .gx-flip-shade {
    opacity: 1;
}

/* 控制条 */
.gx-read-ctrl {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 16px;
}

.gx-turn {
    height: 40px;
    padding: 0 20px;
    border-radius: 9px;
    border: 1px solid var(--line);
    background: #fffdf8;
    font-size: 13px;
    font-family: inherit;
    color: #6f6558;
    cursor: pointer;
    letter-spacing: 1px;
}

.gx-turn:hover:not(:disabled) {
    border-color: var(--blue2);
    color: var(--blue);
}

.gx-turn:disabled {
    color: #cfc6b8;
    cursor: default;
}

.gx-read-page {
    font-size: 12px;
    color: #a89b88;
    text-align: center;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 回目抽屉 */
.gx-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(420px, 88vw);
    background: #fbf6ec;
    border-left: 1px solid var(--line);
    box-shadow: -10px 0 30px rgba(60, 46, 28, .18);
    z-index: 9990;
    display: flex;
    flex-direction: column;
    padding: 14px 16px 10px;
}

.gx-drawer[hidden] {
    display: none;
}

.gx-drawer-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13.5px;
    color: var(--ink);
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 10px;
}

.gx-drawer .gx-toc-list {
    columns: 2;
    overflow: auto;
    flex: 1;
}

.gx-note {
    margin-top: 14px;
    padding: 10px 14px;
    font-size: 12px;
    line-height: 1.85;
    color: #8a7f6e;
    background: #faf3e4;
    border-left: 3px solid var(--gold);
    border-radius: 0 8px 8px 0;
}

.gx-note a {
    color: var(--red);
}

/* ---------------- 悬浮入口 ---------------- */
#gxFloatBtn {
    position: fixed;
    right: 22px;
    bottom: 254px;
    z-index: 900;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    width: 54px;
    padding: 9px 0 7px;
    background: linear-gradient(180deg, #3a5f86, #26425f);
    color: #f4eee1;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(38, 66, 95, .3);
    text-decoration: none;
    transition: transform .2s, box-shadow .2s;
}

#gxFloatBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(38, 66, 95, .38);
}

.gx-float-ico {
    font-size: 17px;
    font-family: "Songti SC", "SimSun", serif;
    line-height: 1;
}

.gx-float-txt {
    font-size: 10px;
    letter-spacing: .5px;
    opacity: .92;
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 900px) {
    .gx-toc-list {
        columns: 2;
    }

    .gx-detail-hero {
        gap: 16px;
        padding: 14px;
    }

    .gx-detail-name {
        font-size: 21px;
    }
}

@media (max-width: 720px) {
    .gx-wrap {
        padding: 4px 0 20px;
        max-width: 100%;
    }

    .gx-hero .page-title {
        font-size: 21px;
    }

    .gx-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .gx-grid,
    .gx-grid-sm {
        grid-template-columns: 1fr;
    }

    .gx-toc-list {
        columns: 1;
    }

    /* 手机双页阅读：与电脑端同为跨页翻书，只收窄页宽、压低页高 */
    .gx-read {
        --leaf-pad: 8px;
    }

    .gx-spread {
        max-width: 100%;
        border-radius: 6px;
        box-shadow:
            0 10px 24px rgba(60, 46, 28, .2),
            0 2px 0 #fff inset;
    }

    .gx-leaf,
    .gx-leaf-inner {
        min-height: 0;
    }

    .gx-read.is-vm .gx-leaf-inner {
        min-height: 0;
    }

    .gx-leaf-inner {
        padding: 11px var(--leaf-pad) 7px;
    }

    .gx-leaf-head {
        font-size: 9px;
        letter-spacing: 0;
        padding-bottom: 5px;
        margin-bottom: 7px;
    }

    .gx-leaf-foot {
        font-size: 9px;
        padding-top: 4px;
    }

    .gx-read.is-vm .gx-leaf-body {
        height: clamp(360px, 56vh, 460px);
        padding: 0 3px;
        letter-spacing: 0;
        line-height: 1.62;
    }

    /* 横排：页高与竖排对齐，字随页宽回流 */
    .gx-read.is-hm .gx-leaf-body {
        height: clamp(360px, 56vh, 460px);
        font-size: 15px;
        line-height: 1.85;
        padding-right: 3px;
    }

    /* 页脊与书页圆角在窄屏收一点，免得挤掉正文宽度 */
    .gx-leaf-l {
        border-radius: 6px 0 0 6px;
    }

    .gx-leaf-r {
        border-radius: 0 6px 6px 0;
    }

    .gx-read-bar {
        flex-wrap: wrap;
        gap: 8px;
        padding: 8px 10px;
        margin-bottom: 10px;
    }

    .gx-read-back {
        max-width: 96px;
        font-size: 12px;
    }

    .gx-read-tools {
        gap: 4px;
    }

    .gx-tool {
        height: 24px;
        padding: 0 7px;
        font-size: 11px;
    }

    .gx-read-ctitle {
        order: 3;
        flex-basis: 100%;
        font-size: 11.5px;
    }

    .gx-turn {
        padding: 0 12px;
        font-size: 12px;
    }

    .gx-read-page {
        font-size: 11px;
    }

    #gxFloatBtn {
        bottom: 196px;
    }

    /* 详情页：封面与信息上下排列，避免简介被挤成一字宽的细条 */
    .gx-detail-hero {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        padding: 14px;
    }

    .gx-hero-book {
        align-self: center;
        padding-top: 0;
    }

    .gx-hero-book .gx-book-lg {
        width: 124px;
        height: 186px;
    }

    .gx-hero-info {
        width: 100%;
    }

    /* 单列回目允许换行，不再省略截断 */
    .gx-toc-txt {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }

    /* 字母索引与题材筛选收紧，减少纵向占用 */
    .gx-letter {
        gap: 4px;
    }

    .gx-letter a,
    .gx-letter span {
        min-width: 26px;
        height: 26px;
        padding: 0 5px;
        font-size: 12px;
        border-radius: 5px;
    }

    .gx-letter a i {
        font-size: 8.5px;
    }

    .gx-lf-all {
        padding: 0 9px !important;
    }

    /* 列表卡片：封面略收，给文字留足宽度 */
    .gx-card {
        gap: 10px;
        padding: 12px 12px 10px;
    }

    .gx-card .gx-book-sm {
        width: 76px;
        height: 114px;
    }

    /* 手机卡片简介收到两行，避免卡片过高 */
    .gx-intro {
        -webkit-line-clamp: 2;
        font-size: 12px;
        line-height: 1.65;
    }
}
