/* tpl_7 mobile - primary: #88C6E5 */

:root{
    --p:#88C6E5;            /* primary */
    --p2:#4EA6D4;           /* darker primary for buttons */
    --bg:#F4FAFE;           /* page background */
    --card:#FFFFFF;         /* card background */
    --ink:#1F2A33;          /* text */
    --muted:#6C7A86;        /* muted text */
    --line:#D9E7F0;         /* borders */

    --soft:#F1F9FD;         /* soft fill */
    --soft2:#E6F4FC;        /* soft highlight */

    --r:12px;
    --shadow: 0 2px 12px rgba(31,42,51,.06);
    --wrap: 720px;

    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);

    /* reader */
    --fz: 18px;
    --lh: 2.0;
}

*{box-sizing:border-box;-webkit-tap-highlight-color:transparent;}
html,body{height:100%;}
body{
    margin:0;
    background: var(--bg);
    color: var(--ink);
    font: 14px/1.65 -apple-system,BlinkMacSystemFont,"Segoe UI",
    "PingFang SC","Hiragino Sans GB","Microsoft YaHei",Arial,sans-serif;
}
a{color:inherit;text-decoration:none;}
img{display:block;max-width:100%;}
ul{list-style:none;margin:0;padding:0;}

.wrap{
    width: min(var(--wrap), calc(100% - 24px));
    margin: 0 auto;
    padding: 12px 0 calc(16px + var(--safe-bottom));
}

.ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;min-width:0;}
.clamp-2,.clamp-3,.clamp-6{
    display:-webkit-box;
    -webkit-box-orient:vertical;
    overflow:hidden;
}
.clamp-2{-webkit-line-clamp:2;}
.clamp-3{-webkit-line-clamp:3;}
.clamp-6{-webkit-line-clamp:6;}
.muted{color:var(--muted);}
.small{font-size:12px;}

/* ===== header ===== */
.m-header{
    position: sticky;
    top: 0;
    z-index: 90;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
    padding-top: var(--safe-top);
}
.m-topbar{
    width: min(var(--wrap), calc(100% - 24px));
    margin: 0 auto;
    padding: 10px 0 8px;
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap: 12px;
}
.m-brand{min-width:0;display:flex;align-items:baseline;gap:10px;}
.m-brand__name{
    color: #0F4D6A;
    font-weight: 1000;
    font-size: 18px;
    letter-spacing:.2px;
}
.m-brand__tag{
    color: var(--muted);
    font-size: 12px;
    padding: 2px 8px;
    background: var(--soft2);
    border: 1px solid var(--line);
    border-radius: 999px;
}

.m-actions{display:flex;gap:10px;flex:0 0 auto;}
.pill{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background:#fff;
    font-weight: 900;
    color:#0F4D6A;
}
.pill--primary{
    background: var(--p2);
    border-color: var(--p2);
    color:#fff;
}

/* search */
.m-search{
    width: min(var(--wrap), calc(100% - 24px));
    margin: 0 auto;
    padding: 0 0 10px;
}
.m-search__form{display:flex;gap:10px;}
.m-search__input{
    flex:1;min-width:0;
    border: 1px solid var(--line);
    background:#fff;
    border-radius: 999px;
    padding: 10px 12px;
    outline:none;
    font-size: 14px;
}
.m-search__input:focus{
    border-color: rgba(78,166,212,.65);
    box-shadow: 0 0 0 3px rgba(136,198,229,.22);
}
.m-search__btn{
    border:0;
    border-radius: 999px;
    padding: 10px 14px;
    background: var(--p2);
    color:#fff;
    font-weight: 1000;
}

/* nav */
.m-nav{
    background: linear-gradient(180deg, rgba(136,198,229,.40), rgba(136,198,229,.18));
    border-top: 1px solid rgba(136,198,229,.25);
    border-bottom: 1px solid rgba(136,198,229,.25);
}
.m-nav__inner{
    width: min(var(--wrap), calc(100% - 24px));
    margin: 0 auto;
    padding: 10px 0;
}
.m-nav__list{
    display:flex;
    gap: 10px;
    overflow:auto;
    white-space:nowrap;
}
.m-nav__item{flex:0 0 auto;min-width:0;}
.m-nav__link{
    display:inline-flex;
    align-items:center;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,.78);
    border: 1px solid rgba(136,198,229,.35);
    color:#0F4D6A;
    font-weight: 900;
    max-width: 220px;
}
.m-nav__link:active{background:#fff;}

/* ===== boxes/sections ===== */
.box{
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r);
    box-shadow: var(--shadow);
    padding: 12px;
}
.box + .box{margin-top:12px;}

.box__hd{
    display:flex;
    align-items:flex-end;
    justify-content:space-between;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 10px;
}
.box__title{
    margin:0;
    font-size: 16px;
    font-weight: 1000;
    padding-left: 10px;
    border-left: 4px solid var(--p2);
}
.box__sub{color:var(--muted);font-size:12px;min-width:0;}

/* ===== lists ===== */
.vlist{display:flex;flex-direction:column;gap:10px;}
.vlist__item{min-width:0;}

.card{
    display:flex;
    gap: 12px;
    padding: 12px;
    background: linear-gradient(180deg, var(--soft), #fff);
    border: 1px solid var(--line);
    border-radius: var(--r);
    min-width:0;
}
.card__cover{
    width: 76px;
    height: 102px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid rgba(217,231,240,.9);
    background:#fff;
    flex:0 0 auto;
}
.card__body{min-width:0;flex:1;display:flex;flex-direction:column;gap:6px;}
.card__title{font-weight:1000;}
.card__meta{display:flex;flex-wrap:wrap;gap:8px;color:var(--muted);font-size:12px;min-width:0;}
.card__intro{color:#33424d;}
.card__foot{
    margin-top:auto;
    display:flex;
    justify-content:space-between;
    gap:10px;
    color:var(--muted);
    font-size:12px;
    min-width:0;
}

.slist{display:flex;flex-direction:column;}
.slist__item{border-bottom: 1px dashed rgba(217,231,240,.95);}
.slist__item:last-child{border-bottom:0;}
.slist__link{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:10px;
    padding: 10px 2px;
    min-width:0;
}
.slist__t{font-weight:900;min-width:0;}
.slist__s{color:var(--muted);font-size:12px;max-width:46%;text-align:right;min-width:0;}

/* chips */
.chips{
    display:grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.chips__item{min-width:0;}
.chips__link{
    display:flex;
    align-items:center;
    justify-content:center;
    padding: 10px 10px;
    border-radius: 999px;
    border: 1px solid rgba(136,198,229,.45);
    background:#fff;
    color:#0F4D6A;
    font-weight:1000;
}

/* buttons */
.btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding: 10px 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background:#fff;
    font-weight: 1000;
    color:#0F4D6A;
}
.btn--primary{
    background: var(--p2);
    border-color: var(--p2);
    color:#fff;
}

/* ===== book page ===== */
.book{
    display:flex;
    gap: 12px;
    min-width:0;
}
.book__cover{
    width: 112px;
    height: 150px;
    border-radius: var(--r);
    object-fit: cover;
    border: 1px solid var(--line);
    background:#fff;
    flex: 0 0 auto;
}
.book__info{min-width:0;flex:1;display:flex;flex-direction:column;gap:6px;}
.book__title{margin:0;font-size:18px;font-weight:1000;}
.book__meta{color:var(--muted);font-size:12px;}

.book__btns{
    margin-top: 6px;
    display:grid;
    grid-template-columns: 1fr 1fr; /* 强制同排 */
    gap: 10px;
}
.book__btns li{min-width:0;}
.book__btns a{width:100%;}

.text{color:#33424d;line-height:1.85;word-break:break-word;overflow-wrap:anywhere;}

.chapters{
    display:grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.chapters__item{min-width:0;}
.chapters__link{
    display:block;
    padding: 10px 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background:#fff;
}

.more{margin-top:12px;}
.more__link{color:var(--p2);font-weight:1000;display:inline-flex;padding: 8px 2px;}

/* ===== directory ===== */
.dirtools{display:flex;gap:10px;flex-wrap:wrap;}
.dirtools__link{flex:1;}

.dirlist{
    display:grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.dirlist__item{min-width:0;}
.dirlist__link{
    display:block;
    padding: 10px 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background:#fff;
}

.pager{
    margin-top: 12px;
    display:flex;
    gap:10px;
    align-items:center;
    justify-content:space-between;
}
.pager__btn{
    flex:1;
    text-align:center;
    padding: 10px 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background:#fff;
    font-weight: 1000;
    color: var(--p2);
}
.pager__mid{flex:1;text-align:center;color:var(--muted);font-size:12px;}

/* ===== rank ===== */
.rklist{counter-reset: rk;display:flex;flex-direction:column;gap:10px;}
.rklist__item{min-width:0;}
.rkcard{
    display:flex;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background:#fff;
    min-width:0;
}
.rkno{
    width: 30px;
    height: 30px;
    border-radius: 10px;
    background: var(--soft2);
    border: 1px solid rgba(136,198,229,.45);
    flex:0 0 auto;
    position: relative;
}
.rkno::before{
    counter-increment: rk;
    content: counter(rk);
    position:absolute;
    inset:0;
    display:flex;
    align-items:center;
    justify-content:center;
    font-weight: 1000;
    color: #0F4D6A;
}
.rkno--top{
    background: rgba(136,198,229,.55);
    border-color: rgba(78,166,212,.55);
    box-shadow: 0 4px 14px rgba(78,166,212,.16);
}
.rkcard__cover{
    width: 76px;
    height: 102px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid var(--line);
    background:#fff;
    flex:0 0 auto;
}
.rkcard__body{min-width:0;flex:1;display:flex;flex-direction:column;gap:6px;}
.rkcard__title{font-weight:1000;}
.rkcard__meta{color:var(--muted);font-size:12px;display:flex;flex-wrap:wrap;gap:8px;min-width:0;}
.rkcard__intro{color:#33424d;}

/* ===== footer ===== */
.m-footer{
    margin-top: 12px;
    background: rgba(255,255,255,.88);
    border-top: 1px solid var(--line);
}
.m-footer__inner{
    width: min(var(--wrap), calc(100% - 24px));
    margin: 0 auto;
    padding: 14px 0 calc(14px + var(--safe-bottom));
}
.m-footer__links{display:flex;gap:10px;flex-wrap:wrap;}
.m-footer__links a{color:var(--p2);font-weight:1000;font-size:12px;}
.m-footer__meta{
    margin-top: 10px;
    color:var(--muted);
    font-size:12px;
    line-height:1.7;
}


/* ========== 沉浸式阅读页专属样式 ========== */

/* 1. 治愈系拿铁变量色盘 (与第三套的浓郁焦糖拉开轻量差异) */
:root {
    --rd-bg: #f9f6f0;            /* 燕麦白 (默认) */
    --rd-text: #3d3532;          /* 拿铁棕 (正文) */
    --rd-text-sub: #9e918c;
    --rd-menu-bg: rgba(255, 252, 248, 0.90); /* 浅乳酪毛玻璃 */
    --rd-menu-border: rgba(180, 150, 130, 0.12); /* 浅咖色柔和边框 */
    --rd-btn-bg: rgba(180, 150, 130, 0.06);
    --rd-btn-border: rgba(180, 150, 130, 0.15);
    --rd-accent: #c48b69;        /* 柔和拿铁棕强调色 */
}
body.theme-white {
    --rd-bg: #ffffff;
    --rd-text: #2f2f2f;
    --rd-menu-bg: rgba(250, 250, 250, 0.92);
}
body.theme-green {
    --rd-bg: #eaf1e6;            /* 浅青黛绿 */
    --rd-text: #2d3b2a;
    --rd-menu-bg: rgba(238, 246, 235, 0.9);
    --rd-menu-border: rgba(100, 130, 100, 0.15);
}
body.theme-sepia {
    --rd-bg: #f6ecdc;            /* 暖杏色 */
    --rd-text: #543f2e;
    --rd-menu-bg: rgba(248, 241, 230, 0.9);
    --rd-menu-border: rgba(150, 120, 90, 0.15);
}
body.theme-dark {
    --rd-bg: #1a1817;            /* 炭焙黑咖 */
    --rd-text: #827873;
    --rd-text-sub: #544d49;
    --rd-menu-bg: rgba(28, 26, 25, 0.94);
    --rd-menu-border: rgba(255, 255, 255, 0.05);
    --rd-btn-bg: rgba(255, 255, 255, 0.05);
}

/* 2. 覆盖背景 */
html.is-reader body {
    background-color: var(--rd-bg) !important;
    transition: background-color 0.35s ease;
    margin: 0; min-height: 100vh;
}
.read-container { background: transparent !important; min-height: 100vh; }

/* 3. 正文排版 (柔和优雅) */
.chapter-title {
    font-size: 24px; font-weight: 700; margin: 35px 0 15px;
    line-height: 1.4; color: var(--rd-text) !important;
    letter-spacing: 0.5px;
}
.chapter-meta {
    font-size: 13px; color: var(--rd-text-sub) !important;
    margin-bottom: 40px; display: flex; gap: 8px; align-items: center;
}
.read-meta__sep { opacity: 0.5; }

.read-content {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", sans-serif;
    font-size: 20px; line-height: 1.85;
    letter-spacing: 0.8px; color: var(--rd-text) !important;
    text-align: justify; text-justify: inter-ideograph;
    min-height: 60vh; white-space: pre-line;
    font-weight: 400;
}
.read-content p, .read-content div { text-indent: 2em; margin-top: 0; margin-bottom: 1.2em; }

/* 4. 悬浮岛设计：顶部胶囊 + 底部悬浮双岛面板 */
.reader-top-bar, .reader-bottom-bar {
    position: fixed !important; z-index: 1000;
    background: var(--rd-menu-bg) !important;
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--rd-menu-border);
    transition: transform 0.4s cubic-bezier(0.2, 0.9, 0.2, 1), opacity 0.3s;
    opacity: 0; pointer-events: none;
}
/* 顶部悬浮胶囊 */
.reader-top-bar {
    top: 14px; left: 14px; right: 14px; height: 52px;
    border-radius: 999px;
    display: flex; justify-content: space-between; align-items: center; padding: 0 18px;
    transform: translateY(-150%) scale(0.96);
    box-shadow: 0 8px 24px rgba(60, 45, 35, 0.05);
}
.reader-top-bar a {
    display: flex; align-items: center; gap: 6px;
    font-size: 15px; color: var(--rd-text); font-weight: 600; text-decoration: none;
}
.reader-top-bar a svg { width: 18px; height: 18px; opacity: 0.8; }

/* 底部悬浮岛面板 (比第三套更轻盈的 24px 圆角矩形，离底部有悬空感) */
.reader-bottom-bar {
    bottom: 16px; left: 14px; right: 14px;
    padding: 20px 18px;
    border-radius: 24px;
    transform: translateY(150%) scale(0.96);
    box-shadow: 0 12px 32px rgba(60, 45, 35, 0.08);
}
body.menu-active .reader-top-bar, body.menu-active .reader-bottom-bar {
    transform: translateY(0) scale(1);
    opacity: 1; pointer-events: auto;
}

/* 5. 底部页面导航 (自适应反转色) */
.m-page-nav a {
    flex: 1; text-align: center; margin: 0 4px; padding: 11px 0;
    border-radius: 999px; font-size: 14px; font-weight: 600;
    background: var(--rd-btn-bg) !important;
    border: 1px solid var(--rd-btn-border) !important;
    color: var(--rd-text) !important;
}
/* 让下一章按钮的样式和上一章、目录完全保持一致 */
.m-page-nav a.c-btn--primary {
    background: var(--rd-btn-bg) !important;
    color: var(--rd-text) !important;
    border: 1px solid var(--rd-btn-border) !important;
}

/* 6. 设置选项排版 (双层岛屿的间距优化) */
.setting-row { display: flex; align-items: center; margin-bottom: 16px; gap: 12px; }
.setting-row:last-child { margin-bottom: 0; }
.font-island-row { border-bottom: 1px solid var(--rd-menu-border); padding-bottom: 16px; }
.setting-row .label { font-weight: 600; color: var(--rd-text-sub); font-size: 13px; width: 35px; }
.setting-row button {
    padding: 6px 16px; background: var(--rd-btn-bg); border: 1px solid var(--rd-btn-border);
    border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--rd-text); outline: none;
}
.setting-row .val { min-width: 45px; text-align: center; font-weight: 600; font-size: 15px; color: var(--rd-text);}
.setting-row .btn-reset { border: none; text-decoration: none; color: var(--rd-text-sub); font-size: 12px; padding: 0; background: transparent;}

/* 7. 主题颜色球 */
.theme-colors { display: flex; gap: 12px; flex: 1; justify-content: space-between; align-items: center;}
.theme-btn {
    width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
    border: 2px solid transparent; box-shadow: 0 2px 5px rgba(0,0,0,0.04);
}
.theme-btn.active { box-shadow: 0 0 0 2px var(--rd-menu-bg), 0 0 0 4px var(--rd-text); transform: scale(1.05); }
.theme-default { background: #f9f6f0; border: 1px solid #e2d7cc; }
.theme-white { background: #ffffff; border: 1px solid #ddd; }
.theme-green { background: #eaf1e6; border: 1px solid #c7d8c0; }
.theme-sepia { background: #f6ecdc; border: 1px solid #e0ceb5; }
.theme-dark { background: #1a1817; border: 1px solid #444; }

/* 8. 新手引导遮罩 */
.reader-guide-mask {
    position: fixed !important; top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
    background: rgba(0, 0, 0, 0.6) !important; backdrop-filter: blur(2px);
    z-index: 99999 !important; display: none; justify-content: center; align-items: center;
}
.guide-box {
    background: transparent; padding: 35px 20px; border-radius: 24px;
    text-align: center; width: 75%; max-width: 280px;
    border: 1px dashed rgba(255, 255, 255, 0.35);
}
.guide-box p {
    margin-bottom: 25px; padding-bottom: 25px; font-size: 16px; font-weight: 600; color: #ffffff;
    line-height: 1.7; letter-spacing: 1px; border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}
.guide-box button {
    background: transparent; color: #ffffff; border: 1px solid rgba(255, 255, 255, 0.6);
    padding: 8px 0; width: 80%; border-radius: 999px; font-size: 14px; font-weight: 600;
}
/* mengxishu.net */