/* tpl_5 mobile style.css - warm neutral (match your pc palette) */

:root{
    --g:#8a5a2b;
    --g2:#b37a3c;

    --bg:#f4f1ea;
    --card:#fffdf8;
    --ink:#2a2420;
    --muted:#76665b;

    --line:#e6dccf;
    --r:10px;
    --shadow: 0 2px 10px rgba(42,36,32,.06);

    --wrap: 720px;

    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);

    --fz: 18px;       /* reader default font size (will be overridden by JS) */
    --lh: 2.0;        /* reader default line height */
}

*{ 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; padding:0; margin: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; }
.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; }

.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: 900;
    padding-left: 10px;
    border-left: 4px solid var(--g);
}
.box__sub{ color: var(--muted); font-size:12px; min-width:0; }

/* header */
.m-header{
    position: sticky;
    top: 0;
    z-index: 90;
    background: rgba(255,253,248,.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;
    align-items:center;
    justify-content:space-between;
    gap: 12px;
}
.m-brand{ min-width:0; display:flex; align-items:baseline; gap:8px; }
.m-brand__name{
    font-weight: 1000;
    color: var(--g);
    font-size: 18px;
    letter-spacing: .2px;
}
.m-brand__sub{
    color: var(--muted);
    font-size: 12px;
    min-width:0;
}

.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 #d8cabb;
    border-radius: 999px;
    padding: 10px 12px;
    outline:none;
    background:#fff;
}
.m-search__input:focus{
    border-color: rgba(138,90,43,.55);
    box-shadow: 0 0 0 3px rgba(138,90,43,.10);
}
.m-search__btn{
    border:0;
    border-radius: 999px;
    padding: 10px 14px;
    background: var(--g);
    color:#fff;
    font-weight: 900;
    cursor:pointer;
}

.m-nav{
    background: var(--g2);
    color:#fff;
}
.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; }
.m-nav__link{
    display:inline-flex;
    align-items:center;
    gap:6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,.14);
    font-weight: 900;
    max-width: 220px;
}
.m-nav__link:active{ background: rgba(255,255,255,.22); }

/* footer */
.m-footer{
    margin-top: 12px;
    background: var(--card);
    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(--g);
    font-weight: 900;
    font-size: 12px;
}
.m-footer__meta{
    margin-top: 10px;
    color: var(--muted);
    font-size:12px;
    line-height:1.7;
}

/* 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: 900;
    color: var(--g);
}
.btn--primary{
    background: var(--g);
    border-color: var(--g);
    color:#fff;
}

/* novel card list (ul-li-a) */
.vlist{ display:flex; flex-direction:column; gap:10px; }
.vlist__item{ min-width:0; }
.vcard{
    display:flex;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background:#fff;
    min-width:0;
}
.vcard__cover{
    width: 74px;
    height: 98px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #efe6db;
    background:#fff;
    flex:0 0 auto;
}
.vcard__body{ min-width:0; flex:1; display:flex; flex-direction:column; gap:6px; }
.vcard__title{ font-weight: 1000; }
.vcard__meta{ display:flex; flex-wrap:wrap; gap: 8px; color: var(--muted); font-size:12px; }
.vcard__intro{ color:#3a322c; }
.vcard__foot{
    margin-top:auto;
    display:flex;
    justify-content:space-between;
    gap:10px;
    color: var(--muted);
    font-size:12px;
    min-width:0;
}
.vcard__foot span{ min-width:0; }

/* compact list (title + right meta) */
.slist{ display:flex; flex-direction:column; }
.slist__item{ border-bottom: 1px dashed rgba(230,220,207,.9); }
.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: 500; min-width:0; }
.slist__s{ color: var(--muted); font-size:12px; max-width: 46%; text-align:right; min-width:0; }

/* chips grid */
.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: 1px solid var(--line);
    border-radius: 999px;
    background:#fff;
    font-weight: 1000;
    color: var(--g);
}

/* book page */
.book{
    display:flex;
    gap: 12px;
    min-width:0;
}
.book__cover{
    width: 108px;
    height: 144px;
    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:#3a322c; 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(--g); font-weight: 1000; display:inline-flex; padding: 8px 2px; }

/* directory tools + list */
.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(--g);
}
.pager__mid{
    flex:1;
    text-align:center;
    color: var(--muted);
    font-size:12px;
}

/* rank page */
.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:#f6efe6;
    border:1px solid #e6dccf;
    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: var(--g);
}
.rkcard__cover{
    width: 74px;
    height: 98px;
    border-radius: 8px;
    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; }
.rkcard__intro{ color:#3a322c; }

/* ========== 沉浸式阅读页专属样式 ========== */

/* 1. 全局主题变量 */
:root {
    --rd-bg: #f5f2ed;            /* 原木白 (默认) */
    --rd-text: #2c2926;          /* 黑茶色 (正文) */
    --rd-text-sub: #9e968f;
    --rd-menu-bg: #f5f2ed;       /* 放弃毛玻璃，使用纯实色背景，无缝沉浸 */
    --rd-menu-border: rgba(44, 41, 38, 0.08);
    --rd-btn-bg: transparent;
    --rd-btn-border: rgba(44, 41, 38, 0.2);
    --rd-accent: #8a5a2b;        /* 沿用 tpl_5 的主打琥珀色 */
}
body.theme-white {
    --rd-bg: #ffffff;
    --rd-text: #222222;
    --rd-menu-bg: #ffffff;
    --rd-menu-border: rgba(0, 0, 0, 0.08);
    --rd-btn-border: rgba(0, 0, 0, 0.15);
}
body.theme-green {
    --rd-bg: #e5ece0;
    --rd-text: #2a3a24;
    --rd-menu-bg: #e5ece0;
    --rd-menu-border: rgba(42, 58, 36, 0.1);
    --rd-btn-border: rgba(42, 58, 36, 0.25);
}
body.theme-sepia {
    --rd-bg: #f3e9d8;
    --rd-text: #523f2b;
    --rd-menu-bg: #f3e9d8;
    --rd-menu-border: rgba(82, 63, 43, 0.1);
    --rd-btn-border: rgba(82, 63, 43, 0.25);
}
body.theme-dark {
    --rd-bg: #1c1b1a;
    --rd-text: #736d68;
    --rd-text-sub: #4d4845;
    --rd-menu-bg: #1c1b1a;
    --rd-menu-border: rgba(255, 255, 255, 0.06);
    --rd-btn-border: rgba(255, 255, 255, 0.15);
}

/* 2. 覆盖默认背景 */
html.is-reader body {
    background: var(--rd-bg) !important;
    transition: background-color 0.2s ease; /* 极简风加快渐变速度，显得干脆利落 */
    margin: 0; min-height: 100vh;
}
.read-container { background: transparent !important; min-height: 100vh; }

/* 3. 杂志级左对齐排版 (差异化核心) */
.chapter-title {
    font-size: 28px; font-weight: 900; /* 超大字重 */
    margin: 30px 0 15px;
    line-height: 1.35; color: var(--rd-text) !important;
    letter-spacing: 0; text-align: left; /* 极简左对齐 */
}
.chapter-meta {
    font-size: 13px; color: var(--rd-text-sub) !important;
    margin-bottom: 50px;
    display: flex; gap: 8px; align-items: center; justify-content: flex-start;
}
.read-content {
    font-family: 'PingFang SC', 'Helvetica Neue', Helvetica, 'Microsoft YaHei', sans-serif;
    font-size: 20px; line-height: 1.8;
    letter-spacing: 1px; color: var(--rd-text) !important;
    text-align: justify; text-justify: inter-ideograph;
    min-height: 60vh; white-space: pre-line;
}
.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; left: 0; right: 0; z-index: 1000;
    background: var(--rd-menu-bg) !important;
    transition: transform 0.3s cubic-bezier(0.2, 0, 0, 1); /* 干脆利落的滑动曲线 */
    border-radius: 0; /* 绝对直角 */
}
/* 顶部细线分割 */
.reader-top-bar {
    top: 0; height: 50px;
    display: flex; justify-content: space-between; align-items: center; padding: 0 15px;
    transform: translateY(-100%);
    border-bottom: 1px solid var(--rd-menu-border);
}
.reader-top-bar a {
    display: flex; align-items: center; gap: 6px;
    font-size: 15px; color: var(--rd-text); font-weight: 600;
}
.reader-top-bar a svg { width: 18px; height: 18px; opacity: 1; stroke-width: 1.8; }

/* 底部极简直角面板 */
.reader-bottom-bar {
    bottom: 0; padding: 25px 20px calc(25px + env(safe-area-inset-bottom));
    transform: translateY(100%);
    border-top: 1px solid var(--rd-menu-border);
}
body.menu-active .reader-top-bar, body.menu-active .reader-bottom-bar { transform: translateY(0); }

/* 5. 底部翻页按钮 (极简硬朗直角) */
.m-page-nav { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
html.is-reader .m-page-nav__a {
    flex: 1; text-align: center; padding: 12px 0;
    border-radius: 2px; /* 极小圆角/近乎直角 */
    font-size: 15px; font-weight: 600;
    background: transparent !important;
    border: 1px solid var(--rd-menu-border) !important;
    color: var(--rd-text) !important;
}
html.is-reader .m-page-nav__a.c-btn--primary {
    background: var(--rd-text) !important;
    border-color: var(--rd-text) !important;
    color: var(--rd-bg) !important; /* 自适应背景反转色 */
}

/* 6. 设置选项排版 */
.setting-row { display: flex; align-items: center; margin-bottom: 25px; gap: 15px; }
.setting-row:last-child { margin-bottom: 0; }
.setting-row .label { font-weight: 900; 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: 2px; /* 极简直角按钮 */
    font-size: 14px; font-weight: 600; color: var(--rd-text); outline: none; transition: 0.1s;
}
.setting-row .val { min-width: 50px; text-align: center; font-weight: 600; font-size: 16px; color: var(--rd-text);}
.setting-row .btn-reset { border: none; background: transparent; color: var(--rd-text-sub); text-decoration: underline;}

/* 7. 主题颜色球 (墨水屏方形色块) */
.theme-colors { display: flex; gap: 15px; flex: 1; justify-content: space-between; align-items: center;}
.theme-btn {
    width: 32px; height: 32px; border-radius: 2px; /* 极简正方形色块 */
    cursor: pointer; border: 1px solid var(--rd-btn-border);
}
/* 选中状态：外沿加一圈强调色细边框 */
.theme-btn.active { box-shadow: 0 0 0 1.5px var(--rd-menu-bg), 0 0 0 3px var(--rd-text); border-color: transparent;}
.theme-default { background: #f5f2ed; }
.theme-white { background: #ffffff; }
.theme-green { background: #e5ece0; }
.theme-sepia { background: #f3e9d8; }
.theme-dark { background: #1c1b1a; border-color: #333; }

/* 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.8) !important;
    z-index: 99999 !important; display: none; justify-content: center; align-items: center;
}
.guide-box {
    background: transparent; padding: 40px 20px; border-radius: 0;
    text-align: center; width: 75%; max-width: 300px;
    border: 1px solid rgba(255, 255, 255, 0.8); /* 白色锐利实线 */
}
.guide-box p {
    margin-bottom: 30px; padding-bottom: 30px; font-size: 18px; font-weight: 900; color: #ffffff;
    line-height: 1.6; letter-spacing: 1px; border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}
.guide-box button {
    background: #ffffff; color: #000000; border: none;
    padding: 10px 0; width: 85%; border-radius: 2px; font-size: 16px; font-weight: 900; letter-spacing: 1px;
}
/* kanyuedu.net */