/* 书林智友 · 首页、书架、书籍主页 */

/* 首页 */
.home { min-height: 100vh; background: linear-gradient(180deg, rgba(246, 238, 223, .15), rgba(246, 238, 223, .9) 62%, var(--paper)), var(--bg) center top / cover no-repeat; display: flex; align-items: flex-end; }
.home-inner { width: 100%; max-width: 1080px; margin: 0 auto; padding: 32px 18px calc(28px + env(safe-area-inset-bottom)); }
.brand { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.brand-seal { width: 58px; height: 58px; font-size: 20px; line-height: 1.05; transform: rotate(-4deg); }
.brand h1 { font-size: clamp(38px, 7vw, 60px); letter-spacing: .12em; line-height: 1.1; text-shadow: 0 2px 12px rgba(255, 250, 240, .9); }
.brand p { color: var(--ink-2); font-size: 15px; }
.home-lead { font-size: clamp(17px, 2.4vw, 21px); color: var(--ink-2); margin: 6px 0 26px; }
.modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 16px; }
.mode { display: flex; align-items: center; gap: 14px; text-align: left; padding: 12px; border-radius: 22px; background: rgba(255, 250, 240, .86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid rgba(255, 255, 255, .7); box-shadow: var(--shadow); transition: transform .3s var(--ease), box-shadow .3s; }
.mode:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.mode img { width: 96px; height: 96px; border-radius: 16px; object-fit: cover; flex-shrink: 0; }
.mode-text { flex: 1; min-width: 0; }
.mode-text h2 { font-size: 23px; margin: 4px 0 2px; }
.mode-text p { font-size: 13px; color: var(--ink-3); }
.mode-text .chip { font-size: 11px; padding: 2px 8px; }
.mode-arrow { transform: rotate(180deg); color: var(--cinnabar); }
.home-foot { text-align: center; font-size: 12px; color: var(--ink-3); margin-top: 22px; }

/* 书架 */
.shelf { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 12px; padding: 4px 2px 18px; position: relative; }
.shelf::after { content: ""; position: absolute; left: -6px; right: -6px; bottom: 6px; height: 14px; border-radius: 4px; background: linear-gradient(180deg, #b58a5c, #8d6640); box-shadow: 0 6px 12px rgba(74, 52, 30, .3); z-index: -1; }
.book { text-align: center; }
.book-cover { position: relative; aspect-ratio: 2 / 3; border-radius: 6px 12px 12px 6px; overflow: hidden; box-shadow: -4px 0 0 rgba(0, 0, 0, .12) inset, 0 10px 22px rgba(74, 52, 30, .28); transition: transform .35s var(--ease); }
.book-cover::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 8px; background: linear-gradient(90deg, rgba(0, 0, 0, .25), transparent); z-index: 1; }
.book:hover .book-cover { transform: translateY(-6px) rotate(-1deg); }
.book-cover img { width: 100%; height: 100%; object-fit: cover; }
.book-name { position: absolute; top: 10px; right: 8px; writing-mode: vertical-rl; background: #fffaf0; padding: 8px 5px; font-size: 15px; letter-spacing: .1em; border: 1.5px solid var(--cinnabar); border-radius: 3px; box-shadow: 0 2px 6px rgba(0, 0, 0, .15); }
.book-badge { position: absolute; left: 8px; bottom: 8px; background: rgba(184, 67, 47, .92); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 999px; }
.book small { display: block; font-size: 12px; color: var(--ink-3); margin-top: 8px; line-height: 1.3; }

/* 书籍主页 */
.book-hero { position: relative; height: 46vh; min-height: 280px; max-height: 460px; background: var(--bg) center / cover; display: flex; align-items: flex-end; }
.book-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .05) 30%, rgba(246, 238, 223, .2) 60%, var(--paper)); }
.book-hero-text { position: relative; z-index: 1; width: 100%; max-width: 560px; margin: 0 auto; padding: 0 20px 6px; }
.book-hero-text h1 { font-size: 46px; letter-spacing: .1em; line-height: 1.15; margin-top: 8px; text-shadow: 0 2px 14px rgba(255, 250, 240, .95); }
.book-hero-text p { font-size: 18px; color: var(--ink-2); }
.book-body { margin-top: -4px; }
.intro p { text-indent: 2em; color: var(--ink-2); }
.cast { display: flex; gap: 12px; overflow-x: auto; padding: 4px 4px 10px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.cast::-webkit-scrollbar { display: none; }
.cast-item { flex: 0 0 132px; scroll-snap-align: start; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 16px 8px 14px; border-radius: var(--r); background: linear-gradient(180deg, #fffaf0, #f7ecd8); border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform .3s var(--ease); }
.cast-item:hover { transform: translateY(-4px); }
.cast-item b { font-size: 19px; margin-top: 6px; }
.cast-item small { color: var(--ink-3); font-size: 12px; }
.cast-item .chip { margin-top: 4px; font-size: 12px; padding: 2px 10px; }
.tasks { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.task { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 16px; border-radius: var(--r); color: #fff; text-align: left; box-shadow: var(--shadow); transition: transform .25s var(--ease); position: relative; overflow: hidden; }
.task::after { content: ""; position: absolute; right: -24px; bottom: -24px; width: 90px; height: 90px; border-radius: 50%; background: rgba(255, 255, 255, .14); }
.task:hover { transform: translateY(-3px); }
.task .ic { width: 28px; height: 28px; margin-bottom: 6px; }
.task b { font-family: var(--serif); font-size: 19px; }
.task small { font-size: 12px; opacity: .88; }
.t-red { background: linear-gradient(135deg, #cf6a52, #a83b28); }
.t-gold { background: linear-gradient(135deg, #d8ad52, #b0832a); }
.t-jade { background: linear-gradient(135deg, #79a487, #4d7a5d); }
.t-blue { background: linear-gradient(135deg, #7d93b8, #4f6690); }
.tips { margin-top: 18px; }
.tips h4 { display: flex; align-items: center; gap: 6px; font-size: 17px; margin-bottom: 6px; color: var(--gold); }
.tips ul { padding-left: 1.2em; color: var(--ink-2); font-size: 15px; }
.tips li { margin: 4px 0; }

@media (min-width: 720px) {
    .shelf { grid-template-columns: repeat(4, 1fr); }
}
