/* ============================================================
   星辉自学 · 前端用户端样式
   ============================================================ */

/* ====== 顶部导航 ====== */
.site-header {
    background: linear-gradient(135deg, var(--classic-blue) 0%, var(--classic-blue-light) 100%);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
    padding-top: env(safe-area-inset-top);
}
.nav-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 2px;
    flex-shrink: 0;
    white-space: nowrap;
}
.logo .seal { width: 30px; height: 30px; font-size: 12px; }
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0 8px;
    flex-shrink: 0;
}
.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: all .3s;
}
.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.nav-links { display: flex; gap: 4px; }
.nav-links a {
    color: rgba(255,255,255,.85);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    transition: all .2s;
}
.nav-links a:hover, .nav-links a.active {
    background: rgba(255,255,255,.15);
    color: #fff;
}
.nav-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.search-box { position: relative; }
.search-box input {
    width: 200px;
    padding: 8px 14px 8px 34px;
    border-radius: 20px;
    border: none;
    background: rgba(255,255,255,.15);
    color: #fff;
    font-size: 14px;
    transition: width .2s;
}
.search-box input::placeholder { color: rgba(255,255,255,.6); }
.search-box input:focus { width: 260px; background: rgba(255,255,255,.25); }
.search-box::before {
    content: '🔍';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
}
.user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 6px 6px;
    border-radius: 20px;
    background: rgba(255,255,255,.15);
    cursor: pointer;
    transition: background .2s;
    min-height: 36px;
}
.user-chip:hover { background: rgba(255,255,255,.25); }
.user-avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--gold);
    color: var(--ink-black);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}
.notif-icon {
    position: relative;
    cursor: pointer;
    font-size: 20px;
    padding: 6px 8px;
    min-height: 36px;
    display: flex;
    align-items: center;
}
.notif-icon .dot {
    position: absolute;
    top: 4px; right: 4px;
    width: 8px; height: 8px;
    background: var(--china-red);
    border-radius: 50%;
    border: 2px solid var(--classic-blue);
}

/* ====== Hero 区 ====== */
.hero {
    background: linear-gradient(135deg, var(--classic-blue) 0%, var(--classic-blue-light) 100%);
    color: #fff;
    padding: 60px 20px 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M50 0 L100 50 L50 100 L0 50 Z' fill='none' stroke='rgba(255,255,255,0.06)' stroke-width='1'/%3E%3C/svg%3E");
}
.hero-inner { position: relative; z-index: 1; max-width: 720px; margin: 0 auto; }
.hero-badge {
    display: inline-block;
    background: var(--china-red);
    color: #fff;
    padding: 6px 20px;
    border-radius: 20px;
    font-size: 13px;
    letter-spacing: 3px;
    border: 2px solid var(--gold);
    margin-bottom: 20px;
}
.hero h1 {
    font-family: var(--font-serif);
    font-size: 46px;
    font-weight: 900;
    letter-spacing: 6px;
    text-shadow: 2px 2px 6px rgba(0,0,0,.3);
    margin-bottom: 14px;
}
.hero .subtitle { font-size: 18px; opacity: .9; letter-spacing: 4px; }
.hero-divider {
    width: 120px; height: 3px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    margin: 22px auto;
}
.hero-stats {
    display: flex;
    justify-content: center;
    gap: 50px;
    margin-top: 36px;
}
.hero-stat .num {
    font-family: var(--font-serif);
    font-size: 36px;
    font-weight: 900;
    color: var(--gold);
}
.hero-stat .label { font-size: 13px; opacity: .8; margin-top: 4px; }

/* ====== 主容器 ====== */
.main-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px 60px;
}
.section-title {
    font-family: var(--font-serif);
    font-size: 24px;
    font-weight: 700;
    color: var(--classic-blue);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--china-red-light);
}
.section-title::before {
    content: '';
    width: 4px; height: 24px;
    background: var(--china-red);
    border-radius: 2px;
}

/* ====== 典籍卡片网格 ====== */
.classic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 22px;
}
.classic-card {
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    cursor: pointer;
    transition: all .25s;
    border-top: 3px solid var(--china-red);
    position: relative;
}
.classic-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.classic-cover {
    height: 130px;
    background: linear-gradient(135deg, var(--china-red-light), var(--classic-blue-pale));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
}
.classic-body { padding: 18px; }
.classic-body h3 {
    font-family: var(--font-serif);
    font-size: 20px;
    color: var(--classic-blue);
    margin-bottom: 6px;
}
.classic-body .meta { font-size: 13px; color: #888; margin-bottom: 10px; }
.classic-body .desc {
    font-size: 13px;
    color: var(--ink-soft);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 42px;
}
.classic-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed var(--paper-dark);
}
.classic-price { color: var(--china-red); font-weight: 700; font-size: 18px; }
.classic-price.free { color: var(--success); font-size: 15px; }

/* ====== 分类标签 ====== */
.cat-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.cat-tab {
    padding: 8px 20px;
    border-radius: 20px;
    background: #fff;
    border: 1px solid var(--paper-deep);
    cursor: pointer;
    font-size: 14px;
    transition: all .2s;
}
.cat-tab:hover { border-color: var(--classic-blue-light); color: var(--classic-blue); }
.cat-tab.active {
    background: var(--classic-blue);
    color: #fff;
    border-color: var(--classic-blue);
}

/* ====== 阅读页布局 ====== */
.reader-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    margin-top: 20px;
}
.reader-sidebar {
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    position: sticky;
    top: 84px;
}
.reader-sidebar h4 {
    padding: 16px 18px;
    background: var(--classic-blue);
    color: #fff;
    font-family: var(--font-serif);
    font-size: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.toc-list { padding: 8px 0; }
.toc-vol { font-weight: 600; color: var(--china-red); padding: 10px 18px 6px; font-size: 14px; }
.toc-chapter {
    padding: 8px 18px 8px 32px;
    cursor: pointer;
    font-size: 14px;
    color: var(--ink-soft);
    transition: all .15s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.toc-chapter:hover { background: var(--paper); color: var(--classic-blue); }
.toc-chapter.active { background: var(--classic-blue-pale); color: var(--classic-blue); font-weight: 600; border-left: 3px solid var(--china-red); }
.toc-chapter .progress-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--paper-deep);
}
.toc-chapter .progress-dot.read { background: var(--success); }

/* 章→小节两级目录（文库阅读器） */
.toc-chapter .toc-arrow {
    width: 14px;
    text-align: center;
    color: var(--china-red);
    flex-shrink: 0;
}
.toc-sub {
    padding: 7px 18px 7px 62px;
    cursor: pointer;
    font-size: 13.5px;
    color: var(--ink-soft);
    border-left: 3px solid transparent;
    transition: all .15s;
}
.toc-sub:hover { background: var(--paper); color: var(--classic-blue); }
.toc-sub.active { background: var(--classic-blue-pale); color: var(--classic-blue); font-weight: 600; border-left-color: var(--china-red); }

/* 关联概念 */
.toc-concepts {
    padding: 12px 18px 18px;
    border-top: 1px dashed var(--paper-dark);
    margin-top: 8px;
}
.toc-concepts .concept-title {
    font-size: 12px;
    color: var(--ink-soft);
    letter-spacing: 1px;
    margin-bottom: 8px;
}
.concept-chip {
    margin: 0 4px 6px 0;
    cursor: pointer;
    transition: all .15s;
    display: inline-block;
}
.concept-chip:hover {
    background: var(--gold-light);
    transform: translateY(-1px);
}

/* 上一节 / 下一节 */
.reader-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 30px;
    padding-top: 22px;
    border-top: 2px solid var(--paper-dark);
}
.reader-nav .btn { min-width: 120px; }

.reader-main {
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 36px 44px;
    min-height: 600px;
}
.reader-header {
    border-bottom: 2px solid var(--paper-dark);
    padding-bottom: 20px;
    margin-bottom: 28px;
}
.reader-header h2 {
    font-family: var(--font-serif);
    font-size: 28px;
    color: var(--classic-blue);
    margin-bottom: 8px;
}
.reader-toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding: 12px 16px;
    background: var(--paper);
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
    align-items: center;
}
.reader-toolbar label { font-size: 13px; color: var(--ink-soft); }
.reader-toolbar input[type="range"] { width: 100px; }
.reader-toolbar .sep { width: 1px; height: 20px; background: var(--paper-deep); margin: 0 4px; }

.section-title-block {
    font-family: var(--font-serif);
    font-size: 20px;
    color: var(--china-red-dark);
    margin: 28px 0 14px;
    padding-left: 12px;
    border-left: 4px solid var(--china-red);
}
.original-text {
    font-family: var(--font-serif);
    font-size: 20px;
    line-height: 2.4;
    color: var(--ink-black);
    text-indent: 2em;
    padding: 20px 24px;
    background: var(--paper);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--gold);
    cursor: text;
    user-select: text;
}
.translation-text {
    font-size: 16px;
    line-height: 2;
    color: var(--ink-soft);
    padding: 16px 20px;
    margin-top: 12px;
    background: var(--classic-blue-pale);
    border-radius: var(--radius-sm);
}
.guide-text {
    font-size: 15px;
    line-height: 2;
    padding: 16px 20px;
    margin-top: 12px;
    background: #fff8e1;
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--gold);
}
.locked-overlay {
    position: relative;
    filter: blur(3px);
    pointer-events: none;
}
.locked-tip {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.85);
    border-radius: var(--radius-sm);
    z-index: 2;
}
.annotation-toggle {
    display: inline-flex;
    gap: 8px;
    margin-top: 14px;
}
.annotation-box {
    margin-top: 12px;
    padding: 14px 18px;
    background: #f5f0e0;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--classic-blue);
}
.annotation-box .version { font-weight: 600; color: var(--classic-blue); margin-bottom: 6px; font-size: 13px; }

/* 章节自检 */
.exercises-list { margin-top: 12px; }
.exercise-item {
    padding: 16px;
    background: #fff;
    border: 1px solid var(--paper-dark);
    border-radius: var(--radius-sm);
    margin-bottom: 14px;
}
.exercise-item .ex-q { font-size: 15px; margin-bottom: 12px; line-height: 1.7; }
.exercise-item .ex-options { margin-bottom: 12px; }
.exercise-item .ex-opt { display: block; padding: 8px 12px; margin-bottom: 6px; background: var(--paper); border-radius: 6px; cursor: pointer; }
.exercise-item .ex-opt:hover { background: #f0e8d0; }
.exercise-item .ex-opt input { margin-right: 8px; }
.exercise-item .ex-result { margin-top: 12px; padding: 12px; background: var(--paper); border-radius: 6px; }

/* 笔记区 */
.notes-area { margin-top: 36px; padding-top: 24px; border-top: 2px solid var(--paper-dark); }
.notes-area h4 { font-family: var(--font-serif); color: var(--classic-blue); margin-bottom: 14px; font-size: 18px; }
.note-item {
    padding: 14px 18px;
    background: var(--paper);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    border-left: 3px solid var(--gold);
}
.note-item .note-meta { font-size: 12px; color: #999; margin-bottom: 6px; display: flex; justify-content: space-between; }
.note-item .note-content { font-size: 14px; line-height: 1.7; }

/* ====== 习题 ====== */
.exercise-card {
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 18px;
}
.exercise-card .q-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}
.exercise-card .q-content {
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 16px;
}
.option-item {
    display: block;
    padding: 10px 16px;
    margin-bottom: 8px;
    background: var(--paper);
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 2px solid transparent;
    transition: all .15s;
}
.option-item:hover { background: var(--classic-blue-pale); }
.option-item.selected { border-color: var(--classic-blue); background: var(--classic-blue-pale); }
.option-item.correct { border-color: var(--success); background: #e4f0db; }
.option-item.wrong { border-color: var(--danger); background: #fde2e2; }
.feedback-box {
    margin-top: 14px;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    display: none;
}
.feedback-box.show { display: block; }
.feedback-correct { background: #e4f0db; color: var(--success); }
.feedback-wrong { background: #fde2e2; color: var(--danger); }

/* ====== 个人中心 ====== */
.profile-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 24px;
    margin-top: 20px;
}
.profile-sidebar {
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    height: fit-content;
    position: sticky;
    top: 84px;
}
.profile-avatar {
    width: 80px; height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--china-red), var(--gold));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    margin: 0 auto 12px;
    font-family: var(--font-serif);
}
.profile-name { text-align: center; font-size: 18px; font-weight: 600; color: var(--classic-blue); }
.profile-phone { text-align: center; font-size: 13px; color: #999; margin-top: 4px; }
.profile-menu { margin-top: 24px; }
.profile-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--ink-soft);
    font-size: 14px;
    transition: all .15s;
    margin-bottom: 4px;
}
.profile-menu a:hover { background: var(--paper); color: var(--classic-blue); }
.profile-menu a.active { background: var(--classic-blue-pale); color: var(--classic-blue); font-weight: 600; }

.profile-content { min-height: 500px; }
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: #fff;
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border-top: 3px solid var(--china-red);
}
.stat-card.blue { border-top-color: var(--classic-blue); }
.stat-card.gold { border-top-color: var(--gold); }
.stat-card .num { font-family: var(--font-serif); font-size: 30px; font-weight: 900; color: var(--classic-blue); }
.stat-card .label { font-size: 13px; color: #888; margin-top: 4px; }

/* ====== 创作者市场 ====== */
.market-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 22px;
}
.material-card {
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    border-top: 3px solid var(--gold);
}
.material-card .m-head {
    padding: 16px 20px;
    background: linear-gradient(135deg, #fff8e1, #f5ecd2);
    border-bottom: 1px solid var(--paper-dark);
}
.material-card .m-head h4 { font-family: var(--font-serif); color: var(--classic-blue); font-size: 17px; }
.material-card .m-body { padding: 16px 20px; font-size: 14px; color: var(--ink-soft); line-height: 1.7; min-height: 70px; }
.material-card .m-foot {
    padding: 12px 20px;
    border-top: 1px solid var(--paper-dark);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #888;
}

/* ====== 通知下拉 ====== */
.notif-dropdown {
    position: absolute;
    top: 56px;
    right: 20px;
    width: 340px;
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    overflow: hidden;
    display: none;
}
.notif-dropdown.show { display: block; }
.notif-dropdown .nd-head {
    padding: 14px 18px;
    border-bottom: 1px solid var(--paper-dark);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.notif-dropdown .nd-list { max-height: 360px; overflow-y: auto; }
.notif-item {
    padding: 12px 18px;
    border-bottom: 1px solid var(--paper-dark);
    cursor: pointer;
    transition: background .15s;
}
.notif-item:hover { background: var(--paper); }
.notif-item.unread { background: #fef9f0; }
.notif-item .nt-title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.notif-item .nt-content { font-size: 13px; color: #888; }
.notif-item .nt-time { font-size: 11px; color: #bbb; margin-top: 4px; }

/* ====== 登录弹窗 ====== */
.login-box { text-align: center; }
.login-box .big-seal {
    width: 64px; height: 64px;
    margin: 0 auto 16px;
    font-size: 22px;
}
.quick-login {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 16px;
}

/* ====== 底部 ====== */
.site-footer {
    background: var(--classic-blue);
    color: #fff;
    padding: 36px 20px;
    text-align: center;
    margin-top: 60px;
}
.site-footer .links {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.site-footer .links a { color: rgba(255,255,255,.75); font-size: 14px; }
.site-footer .links a:hover { color: var(--gold); }
.site-footer .copyright { font-size: 13px; opacity: .6; }
.footer-divider {
    width: 80px; height: 2px;
    background: var(--gold);
    margin: 0 auto 16px;
}

/* ====== 响应式（平板） ====== */
@media (max-width: 900px) {
    .reader-layout { grid-template-columns: 1fr; }
    .reader-sidebar { position: static; max-height: 280px; }
    .profile-layout { grid-template-columns: 1fr; }
    .profile-sidebar { position: static; }
    .hero h1 { font-size: 34px; letter-spacing: 3px; }
    .hero-stats { gap: 28px; }
}

/* ====== 响应式（手机 / 小平板） ====== */
@media (max-width: 768px) {
    body { font-size: 14px; }

    /* 导航：汉堡菜单 */
    .hamburger { display: flex; }
    .nav-links {
        position: fixed;
        top: calc(56px + env(safe-area-inset-top));
        left: 0; right: 0;
        flex-direction: column;
        background: linear-gradient(135deg, var(--classic-blue) 0%, var(--classic-blue-light) 100%);
        padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
        gap: 4px;
        transform: translateY(-120%);
        transition: transform .3s ease;
        box-shadow: var(--shadow-lg);
        z-index: 99;
    }
    .nav-links.open { transform: translateY(0); }
    .nav-links a {
        padding: 14px 16px;
        font-size: 16px;
        border-radius: 8px;
    }

    /* 顶栏紧凑化 */
    .nav-wrap { height: 56px; padding: 0 12px; gap: 6px; }
    .logo { font-size: 18px; letter-spacing: 1px; gap: 8px; }
    .logo .seal { width: 28px; height: 28px; font-size: 11px; }
    /* 搜索：默认仅显示图标圆钮，聚焦时展开 */
    .search-box { flex-shrink: 0; }
    .search-box input {
        width: 36px;
        padding: 8px 8px 8px 32px;
        opacity: 1;
        overflow: hidden;
        color: transparent;
        caret-color: #fff;
        border-radius: 18px;
    }
    .search-box input::placeholder { color: transparent; }
    .search-box:focus-within { position: relative; z-index: 101; }
    .search-box input:focus {
        width: 160px;
        color: #fff;
        padding-left: 34px;
    }
    .search-box input:focus::placeholder { color: rgba(255,255,255,.6); }
    .notif-icon { font-size: 18px; padding: 6px; min-height: 36px; }
    .user-chip { padding: 5px 8px 5px 5px; }
    .user-chip span { display: none !important; }
    .user-avatar { width: 28px; height: 28px; font-size: 12px; }

    /* Hero 区 */
    .hero { padding: 40px 16px 56px; }
    .hero h1 { font-size: 28px; letter-spacing: 3px; }
    .hero .subtitle { font-size: 15px; letter-spacing: 2px; }
    .hero-divider { width: 80px; margin: 18px auto; }
    .hero-badge { font-size: 11px; padding: 5px 16px; letter-spacing: 1px; }
    /* 按钮行（Hero 第 5 个子元素；原 nth-child(4) 选择器不命中，按钮未拉满） */
    .hero-inner > div:nth-child(5) {
        margin-top: 22px !important;
        display: flex;
        gap: 10px;
    }
    .hero-inner > div:nth-child(5) .btn { flex: 1; min-width: 0; margin: 0 !important; }
    .hero-stats { gap: 14px; margin-top: 24px; }
    .hero-stat .num { font-size: 26px; }
    .hero-stat .label { font-size: 11px; }

    /* 学习路径：手机端两列小卡（覆盖 frontend.js 内联单列） */
    .main-wrap > div[style*="minmax(200px)"] {
        grid-template-columns: 1fr 1fr !important;
        gap: 12px !important;
    }

    /* 主容器 */
    .main-wrap { padding: 20px 14px 40px; }
    .section-title { font-size: 20px; margin-bottom: 16px; }

    /* 典籍卡片 */
    .classic-grid { gap: 14px; grid-template-columns: 1fr 1fr; }
    .classic-cover { height: 100px; font-size: 44px; }
    .classic-body { padding: 14px; }
    .classic-body h3 { font-size: 17px; }
    .classic-body .desc { min-height: 36px; font-size: 12px; }

    /* 分类标签 */
    .cat-tabs { gap: 8px; margin-bottom: 18px; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
    .cat-tabs::-webkit-scrollbar { display: none; }
    .cat-tab { padding: 7px 16px; font-size: 13px; white-space: nowrap; flex-shrink: 0; }

    /* 阅读页 */
    .reader-layout { gap: 14px; }
    .reader-sidebar { max-height: 220px; border-radius: var(--radius-md); }
    .reader-main { padding: 18px 16px; }
    .reader-header h2 { font-size: 22px; }
    .reader-toolbar {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px 12px;
    }
    .reader-toolbar label { font-size: 12px; }
    .reader-toolbar input[type="range"] { width: 70px; }
    .reader-toolbar .sep { display: none; }
    .reader-toolbar .badge { padding: 3px 8px; font-size: 11px; }
    .section-title-block { font-size: 17px; margin: 22px 0 10px; }
    .original-text { min-height: 44px; padding: 14px 16px; }
    .translation-text { padding: 12px 14px; }
    .guide-text { font-size: 13px; padding: 12px 14px; }
    .annotation-box { padding: 12px 14px; }

    /* 习题 */
    .exercise-card { padding: 16px; }
    .option-item { padding: 12px 14px; min-height: 44px; display: flex; align-items: center; }

    /* 个人中心 */
    .profile-sidebar { padding: 16px; }
    .profile-avatar { width: 64px; height: 64px; font-size: 26px; }
    .profile-menu a { padding: 12px 14px; font-size: 15px; min-height: 44px; }
    .stat-cards { grid-template-columns: 1fr 1fr; gap: 12px; }
    .stat-card { padding: 16px; }
    .stat-card .num { font-size: 24px; }

    /* 创作者市场 */
    .market-grid { grid-template-columns: 1fr; gap: 14px; }

    /* 通知下拉 */
    .notif-dropdown {
        position: fixed;
        top: calc(56px + env(safe-area-inset-top));
        right: 8px; left: 8px;
        width: auto;
        max-width: none;
    }
    .notif-dropdown .nd-list { max-height: 50vh; }

    /* 模态框 */
    .modal-mask { padding: 0; align-items: flex-end; }
    .modal {
        max-width: 100%;
        max-height: 88vh;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }
    .modal-body { padding: 18px; }
    .modal-header { padding: 14px 18px; }
    .modal-footer { padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); }

    /* 表格横向滚动 */
    .table-wrap { -webkit-overflow-scrolling: touch; }
    table.data-table th, table.data-table td { padding: 10px 12px; font-size: 13px; }

    /* 按钮触控优化 */
    .btn { min-height: 40px; }
    .btn-sm { min-height: 34px; padding: 6px 14px; }
    .btn-lg { min-height: 48px; }

    /* 表单 */
    .form-control { min-height: 42px; font-size: 15px; }

    /* 底部 */
    .site-footer { padding: 28px 16px calc(28px + env(safe-area-inset-bottom)); margin-top: 40px; }
    .site-footer .links {
        justify-content: center;
        gap: 10px 18px;
        margin-bottom: 14px;
    }
    .site-footer .links a {
        font-size: 13px;
        position: relative;
        padding: 0 10px;
    }
    .site-footer .links a:not(:last-child)::after {
        content: '';
        position: absolute;
        right: -9px;
        top: 50%;
        transform: translateY(-50%);
        width: 1px;
        height: 12px;
        background: rgba(255,255,255,.2);
    }
    .footer-divider { width: 60px; margin: 0 auto 14px; }
    .site-footer .copyright {
        font-size: 12px;
        line-height: 1.8;
        max-width: 320px;
        margin: 0 auto;
    }

    /* 滚动惯性 */
    .toc-list, .nd-list, .modal { -webkit-overflow-scrolling: touch; }
}

/* ============================================================
   文库阅读（原有基础样式 · 免费/伴学门控板块）
   ============================================================ */
.wk-content { font-family: var(--font-serif); line-height: 2; color: #2b2b2b; }
.wk-loading { text-align: center; color: #999; padding: 60px 0; }
.wk-chapter-title { font-size: 22px; font-weight: 700; text-align: center; margin: 18px 0 22px; color: var(--classic-blue); font-family: var(--font-serif); }
.wk-sec { margin: 18px 0; }
.wk-sec-tag { display: inline-block; background: var(--classic-blue); color: #fff; font-size: 13px; padding: 2px 12px; border-radius: 4px; margin-bottom: 10px; }
.wk-free .wk-sec-tag { background: var(--success); }
.wk-open .wk-sec-tag { background: var(--gold); }
.wk-locked { border: 1px dashed #d5c6a8; background: #faf7ef; padding: 16px; border-radius: 8px; text-align: center; }
.wk-locked .wk-sec-tag { background: var(--gold); }
.wk-lock-msg { color: #8a7a4f; margin: 8px 0 12px; font-size: 14px; }
.wk-p { margin: 0 0 8px; white-space: pre-wrap; }
.wk-tools button:disabled { opacity: .4; cursor: not-allowed; }
.wk-sub-card { cursor: pointer; }
@media (max-width: 768px) {
    .wk-content { font-size: 19px; }
    .wk-locked { padding: 12px; }
}

/* ============================================================
   手机端 · 小说阅读器（独立设计，番茄小说/晋江/QQ阅读样式）
   沉浸式全屏正文 · 点屏唤出菜单 · 字号/背景设置 · 目录抽屉
   ============================================================ */
.wk-mob {
    position: fixed;
    inset: 0;
    z-index: 60;
    overflow: hidden;
    font-family: var(--font-serif);
    transition: background .3s ease;
}
.wk-mob-mask { position: fixed; inset: 0; background: rgba(0,0,0,.25); z-index: 61; display: none; }
.wk-mob-top {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 50px;
    padding: 0 16px;
    padding-top: env(safe-area-inset-top);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0,0,0,.06);
    backdrop-filter: blur(6px);
    z-index: 63;
    opacity: 0;
    transition: opacity .25s ease;
    font-size: 14px;
}
.wk-mob-back { cursor: pointer; color: var(--classic-blue); }
.wk-mob-title { font-size: 15px; font-weight: 600; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-mob-btn { cursor: pointer; color: var(--classic-blue); }
.wk-mob-body {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 60px 22px calc(90px + env(safe-area-inset-bottom));
    box-sizing: border-box;
}
.wk-mob-meta {
    text-align: center;
    font-size: 19px;
    font-weight: 700;
    margin-bottom: 18px;
    color: inherit;
    line-height: 1.6;
}
.wk-mob-time { display: inline-block; font-size: 12px; font-weight: 400; color: #999; margin-left: 8px; }
.wk-mob-lock { display: inline-block; font-size: 12px; background: var(--gold); color: #fff; padding: 2px 12px; border-radius: 12px; margin-left: 8px; cursor: pointer; }
.wk-mob-content { font-size: 20px; line-height: 2; text-align: justify; }
.wk-mob-content .wk-sec-tag { font-size: 12px; }
.wk-mob-content .wk-p { margin-bottom: 6px; }
.wk-mob-navhint { text-align: center; color: #bbb; font-size: 13px; margin-top: 26px; }
.wk-mob-bottom {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(6px);
    padding: 8px 16px calc(12px + env(safe-area-inset-bottom));
    z-index: 63;
    opacity: 0;
    transition: opacity .25s ease;
    border-top: 1px solid rgba(0,0,0,.06);
}
.wk-mob-menu-on .wk-mob-bottom, .wk-mob-menu-on .wk-mob-top { opacity: 1; }
.wk-mob-progress { height: 3px; background: rgba(0,0,0,.08); border-radius: 2px; margin-bottom: 10px; overflow: hidden; background: var(--classic-blue); width: 0%; transition: width .1s linear; }
.wk-mob-bottom-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wk-mob-nav {
    flex: 1;
    min-height: 40px;
    border: 1px solid rgba(0,0,0,.1);
    background: #fff;
    border-radius: 20px;
    font-size: 14px;
    color: var(--classic-blue);
    cursor: pointer;
}
.wk-mob-nav:disabled { opacity: .35; cursor: not-allowed; }
.wk-mob-count { font-size: 13px; color: #888; min-width: 70px; text-align: center; }

/* 目录抽屉 */
.wk-mob-dir {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: 78%;
    max-width: 320px;
    background: #fff;
    z-index: 65;
    transform: translateX(100%);
    transition: transform .28s ease;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 18px rgba(0,0,0,.12);
}
.wk-mob-dir.open { transform: translateX(0); }
.wk-mob-dir-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid #eee;
    font-weight: 600;
    font-size: 15px;
    color: var(--classic-blue);
}
.wk-mob-dir-close { font-size: 13px; color: #888; cursor: pointer; font-weight: 400; }
.wk-mob-dir-list { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 10px 12px; }
.wk-mob-dir-ch { font-size: 14px; font-weight: 700; padding: 8px 6px; color: #555; }
.wk-mob-dir-item { font-size: 14px; padding: 9px 12px; border-radius: 8px; color: #444; cursor: pointer; line-height: 1.6; }
.wk-mob-dir-item.cur { background: var(--classic-blue); color: #fff; }

/* 设置面板（底部弹出） */
.wk-mob-settings {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    background: #fff;
    z-index: 64;
    padding: 14px 18px calc(14px + env(safe-area-inset-bottom));
    border-top-left-radius: 14px;
    border-top-right-radius: 14px;
    box-shadow: 0 -4px 18px rgba(0,0,0,.12);
}
.wk-mob-set-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.wk-mob-set-label { font-size: 13px; color: #666; min-width: 40px; }
.wk-mob-set-row input[type="range"] { flex: 1; }
.wk-mob-set-val { font-size: 13px; color: var(--classic-blue); min-width: 24px; text-align: center; }
.wk-mob-bgs { display: flex; gap: 8px; flex-wrap: wrap; }
.wk-mob-bg { font-size: 12px; padding: 5px 14px; border-radius: 14px; border: 1px solid #ddd; cursor: pointer; color: #666; }
.wk-mob-bg.on { background: var(--classic-blue); color: #fff; border-color: var(--classic-blue); }

/* 经典阅读器移动端（独立于电脑端）：隐藏侧栏按钮，沉浸式 */
@media (max-width: 768px) {
    .reader-nav-auto { justify-content: center; }
    .reader-nav-hint { font-size: 13px; color: #888; text-align: center; }
}

/* 手机端沉浸式阅读：隐藏站点全局头部/底部 */
body.mob-reader-mode .site-header,
body.mob-reader-mode .site-footer { display: none !important; }

/* ============================================================
   窄屏手机端（≤480px）独立布局：精致紧凑 · 单列大卡 · 2×2 数据格
   ============================================================ */
@media (max-width: 480px) {
    /* 顶部导航更紧凑 */
    .nav-wrap { height: 52px; padding: 0 10px; }
    .logo { font-size: 17px; letter-spacing: 1px; gap: 6px; }
    .logo .seal { width: 26px; height: 26px; font-size: 10px; }
    .hamburger { width: 36px; height: 36px; gap: 4px; padding: 0 6px; }
    .search-box input { width: 34px; padding: 7px 7px 7px 30px; }
    .notif-icon { font-size: 17px; }

    /* Hero：纵向空隙收紧，数据 2×2 面板 */
    .hero { padding: 30px 14px 40px; }
    .hero-badge { font-size: 10px; padding: 4px 14px; letter-spacing: 1px; margin-bottom: 12px; }
    .hero h1 { font-size: 26px; letter-spacing: 2px; margin-bottom: 0; }
    .hero .subtitle { font-size: 14px; letter-spacing: 1px; }
    .hero-divider { width: 64px; margin: 14px auto; }
    .hero-inner > div:nth-child(5) { margin-top: 16px !important; }
    .hero-stats {
        margin-top: 20px;
        display: grid;
        grid-template-columns: 1fr 1fr;
        row-gap: 14px;
        column-gap: 10px;
        padding: 14px 6px;
        background: rgba(255,255,255,.08);
        border-radius: 14px;
        border: 1px solid rgba(255,255,255,.14);
    }
    .hero-stat .num { font-size: 24px; }
    .hero-stat .label { font-size: 11px; letter-spacing: 1px; }

    /* 主容器与标题 */
    .main-wrap { padding: 16px 12px 36px; }
    .section-title { font-size: 18px; margin-bottom: 12px; }

    /* 书架：单列大卡，信息完整不折行 */
    .classic-grid { grid-template-columns: 1fr; gap: 16px; }
    .classic-cover { height: 150px; font-size: 56px; }
    .classic-body { padding: 16px; }
    .classic-body h3 { font-size: 19px; }
    .classic-body .meta { font-size: 12px; }
    .classic-body .desc { font-size: 13px; min-height: 40px; }
    .classic-footer { margin-top: 12px; padding-top: 12px; }
    .classic-price { font-size: 17px; }

    /* 分类标签 */
    .cat-tabs { gap: 6px; margin-bottom: 14px; }
    .cat-tab { padding: 6px 14px; font-size: 12px; }

    /* 阅读页 */
    .reader-main { padding: 14px 12px; }
    .reader-header h2 { font-size: 20px; }
    .reader-toolbar { padding: 8px 10px; gap: 6px; }
    .original-text { padding: 12px 14px; font-size: 19px; line-height: 2.2; }
    .translation-text, .guide-text { padding: 11px 12px; }

    /* 学习路径两列小卡 */
    .main-wrap > div[style*="minmax(200px)"] { gap: 10px !important; }

    /* 创作者市场 */
    .market-grid { gap: 12px; }

    /* 习题 */
    .exercise-card { padding: 14px; }
    .option-item { padding: 11px 13px; }

    /* 个人中心 */
    .stat-cards { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-card { padding: 14px; }
    .stat-card .num { font-size: 22px; }

    /* 底部 */
    .site-footer { padding: 24px 14px calc(24px + env(safe-area-inset-bottom)); }
    .site-footer .links { gap: 8px 14px; }
}

/* ============================================================
   电脑端（≥1024px）独立布局：宽屏舒展 · Hero 左右分栏 · 卡片加宽
   ============================================================ */
@media (min-width: 1024px) {
    /* 容器加宽：宽屏不再紧缩在中间 */
    .nav-wrap { max-width: 1440px; padding: 0 28px; }
    .main-wrap { max-width: 1440px; padding: 40px 28px 80px; }

    /* Hero 上下布局：文案 + 按钮 + 数据指标纵向居中排列（左右间距适度，上下间距不变） */
    .hero { padding: 72px 28px 84px; }
    .hero-inner {
        max-width: 1200px;
        margin: 0 auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .hero-badge { margin-bottom: 22px; }
    .hero-inner h1 { font-size: 52px; letter-spacing: 8px; margin-bottom: 0; }
    .hero-divider { margin: 22px auto; }
    .hero .subtitle { font-size: 17px; letter-spacing: 3px; }
    .hero-inner > div:nth-child(5) { margin-top: 10px !important; }
    .hero-stats {
        margin-top: 36px;
        flex-direction: row;
        gap: 60px;
        padding: 26px 34px;
        background: rgba(255,255,255,.08);
        border: 1px solid rgba(255,255,255,.16);
        border-top: 2px solid var(--gold);
        border-radius: 18px;
        backdrop-filter: blur(4px);
        width: 100%;
        max-width: 1020px;
        box-sizing: border-box;
    }
    .hero-stat { text-align: center; }
    .hero-stat .num { font-size: 40px; }
    .hero-stat .label { font-size: 14px; letter-spacing: 2px; }

    /* 卡片网格更舒展 */
    .classic-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 26px; }
    .classic-cover { height: 150px; font-size: 64px; }
    .classic-body { padding: 20px; }
    .classic-body h3 { font-size: 22px; }
    .market-grid { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 26px; }

    /* 阅读页 / 个人中心主区加宽 */
    .reader-layout { grid-template-columns: 300px 1fr; gap: 28px; }
    .reader-main { padding: 44px 52px; }
    .profile-layout { grid-template-columns: 260px 1fr; gap: 28px; }
    .section-title { font-size: 26px; margin-bottom: 24px; }
}