/* ============================================================
   欢乐AI 全站统一视觉样式 v3.0
   板块二：全站视觉100%统一
   ============================================================ */

/* ===== 1. 导航栏统一 ===== */
/* 全站纯白底色，橙色底线，无子页面橙色分割线 */
.nav {
    display: flex !important;
    background: #FFFFFF !important;
    border-bottom: 1px solid #F0F0F0 !important;
    box-shadow: 0 2px 12px rgba(0,0,0,.04) !important;
}
/* 登录按钮统一：浅橙圆角，取消子页面全橙色填充 */
.nav-login {
    background: #F5F5F5 !important;
    color: #F59E0B !important;
    border: 1px solid #E8E8E8 !important;
    border-radius: 20px !important;
    padding: 8px 22px !important;
    font-weight: 600 !important;
    box-shadow: none !important;
}
.nav-login:hover {
    background: #FFF8E1 !important;
    border-color: #F59E0B !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 8px rgba(245,158,11,.15) !important;
}

/* ===== 2. Tab标签栏统一 ===== */
/* 选中：浅绿下划线，取消填充底色选中 */
.tab-bar {
    display: flex;
    background: #FFFFFF;
    border-bottom: 1px solid #F0F0F0;
    position: sticky;
    top: 60px;
    z-index: 99;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.tab-item {
    flex-shrink: 0;
    padding: 14px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #888;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all .2s;
    white-space: nowrap;
    background: transparent !important;
    position: relative;
}
.tab-item:hover { color: #555; }
.tab-item.active {
    color: #10B981 !important;
    font-weight: 700 !important;
    border-bottom-color: #10B981 !important;
    background: transparent !important;
}
.tab-item .tab-icon { margin-right: 4px; }

/* ===== 3. 卡片统一样式 ===== */
/* 圆角16px，内边距12px */
html body .card, html body .card-audio-item, html body .book-card, html body .pb-card, .carousel-card {
    border-radius: 16px !important;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
    transition: all .25s;
}
.card:hover, .card-audio-item:hover, .book-card:hover, .pb-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(245,158,11,.12);
}
.card .card-body, .card-audio-item .card-body, .book-card .info, .pb-card .info {
    padding: 12px !important;
}
/* 卡片角标/标签排版对齐 */
.card-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, #F59E0B, #FF8C42);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 8px;
    z-index: 2;
}
.card-tag {
    display: inline-block;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 6px;
    background: #F0F9FF;
    color: #0369A1;
    font-weight: 500;
}

/* ===== 4. 悬浮新人特惠弹窗（全站统一） ===== */
.floating-member-btn {
    position: fixed;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 10px;
    background: linear-gradient(135deg, #F59E0B, #FF8C42);
    color: #fff;
    border-radius: 16px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 4px 20px rgba(245,158,11,.4);
    animation: floatBounce 2s ease-in-out infinite;
    text-align: center;
    line-height: 1.3;
    cursor: pointer;
}
.floating-member-btn:hover {
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 6px 28px rgba(245,158,11,.5);
}
.floating-member-icon {
    font-size: 24px;
}
@keyframes floatBounce {
    0%, 100% { transform: translateY(-50%); }
    50% { transform: translateY(-55%); }
}

/* ===== 5. 骨架屏加载动画 ===== */
.skeleton {
    animation: skeletonShimmer 1.5s ease-in-out infinite;
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    border-radius: 8px;
}
@keyframes skeletonShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
/* 骨架卡片 */
.skeleton-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.skeleton-cover {
    width: 100%;
    aspect-ratio: 3/4;
}
.skeleton-title {
    height: 16px;
    margin: 12px 12px 8px;
    width: 80%;
}
.skeleton-meta {
    height: 12px;
    margin: 0 12px 12px;
    width: 50%;
}
/* 两段式加载提示 */
.loading-hint {
    text-align: center;
    padding: 60px 20px;
}
.loading-hint .hint-stage {
    font-size: 15px;
    font-weight: 600;
    color: #666;
    margin-bottom: 6px;
    animation: hintFade 2s ease-in-out infinite;
}
.loading-hint .hint-sub {
    font-size: 13px;
    color: #BBB;
    animation: hintFade 2s ease-in-out 0.5s infinite;
}
@keyframes hintFade {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* ===== 6. 居中登录弹窗 ===== */
.login-modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: overlayFadeIn .2s ease;
}
@keyframes overlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.login-modal {
    background: #fff;
    border-radius: 20px;
    padding: 40px 32px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
    animation: modalSlideUp .3s ease;
    position: relative;
}
@keyframes modalSlideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.login-modal h2 {
    font-size: 22px;
    color: #333;
    margin-bottom: 12px;
}
.login-modal p {
    font-size: 14px;
    color: #888;
    margin-bottom: 24px;
    line-height: 1.6;
}
.login-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 20px;
    color: #CCC;
    cursor: pointer;
    padding: 4px;
}
.login-modal-close:hover { color: #666; }
.login-modal-btn {
    display: block;
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #F59E0B, #FF8C42);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all .25s;
    box-shadow: 0 4px 16px rgba(245,158,11,.3);
}
.login-modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(245,158,11,.4);
}
.login-modal-link {
    display: block;
    margin-top: 16px;
    font-size: 13px;
    color: #F59E0B;
    text-decoration: none;
}
.login-modal-link:hover { text-decoration: underline; }

/* ===== 7. AI生成弹窗（30秒超时标准化提示） ===== */
.gen-loading {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(255,255,255,.96);
    z-index: 9999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.gen-loading.show { display: flex; }
.gen-loading .spinner {
    width: 48px; height: 48px;
    border: 4px solid #FCD34D;
    border-top-color: #F59E0B;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.gen-loading .text {
    margin-top: 20px;
    font-size: 16px;
    font-weight: 600;
    color: #666;
}
.gen-loading .stage-text {
    margin-top: 8px;
    font-size: 13px;
    color: #BBB;
}
.gen-loading .progress-text {
    margin-top: 8px;
    font-size: 12px;
    color: #CCC;
}
.gen-loading .cancel-btn {
    margin-top: 20px;
    padding: 10px 28px;
    border-radius: 10px;
    background: #EF4444;
    color: #fff;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all .2s;
}
.gen-loading .cancel-btn:hover {
    background: #DC2626;
    transform: scale(1.03);
}

/* ===== 8. Toast消息提示 ===== */
.msg-toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    z-index: 99999;
    box-shadow: 0 4px 20px rgba(0,0,0,.2);
    animation: toastIn .3s ease;
    white-space: nowrap;
}
@keyframes toastIn {
    from { transform: translateX(-50%) translateY(-10px); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* ===== 9. 绘本阅读器全屏 ===== */
.reader-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: #000;
    z-index: 10001;
    display: flex;
    flex-direction: column;
}
.reader-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(0,0,0,.85);
    color: #fff;
    z-index: 2;
}
.reader-toolbar .reader-title {
    font-size: 15px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    text-align: center;
}
.reader-toolbar button {
    background: none;
    border: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background .2s;
}
.reader-toolbar button:hover { background: rgba(255,255,255,.15); }
.reader-viewport {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}
.reader-viewport img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}
.reader-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,.2);
    color: #fff;
    border: none;
    font-size: 28px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
    z-index: 3;
}
.reader-nav:hover { background: rgba(255,255,255,.35); }
.reader-nav-prev { left: 16px; }
.reader-nav-next { right: 16px; }
.reader-page-num {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,.6);
    color: #fff;
    font-size: 13px;
    padding: 4px 14px;
    border-radius: 12px;
    z-index: 3;
}

/* ===== 10. 权限提示条 ===== */
.perm-lock-banner {
    background: #FFF8E1;
    border: 1px solid #FDE68A;
    border-radius: 12px;
    padding: 16px 20px;
    margin: 16px 0;
    font-size: 14px;
    color: #92400E;
    text-align: center;
    line-height: 1.6;
}
.perm-lock-banner a {
    color: #F59E0B;
    font-weight: 700;
    text-decoration: none;
}

/* ===== 11. 输入框筛选标签自适应 ===== */
.ai-quick-tags, .quick-prompts-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.quick-tag, .quick-prompt-tag, .option-chip {
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 13px;
    padding: 6px 14px;
    border-radius: 18px;
    cursor: pointer;
    transition: all .2s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    max-width: none;
}
@media (max-width: 767px) {
    .quick-tag, .quick-prompt-tag, .option-chip {
        font-size: 12px;
        padding: 5px 12px;
    }
}

/* ===== 12. 响应式补充 ===== */
@media (max-width: 767px) {
    .floating-member-btn {
        right: 8px;
        padding: 8px 8px;
        font-size: 10px;
        border-radius: 12px;
    }
    .floating-member-icon { font-size: 20px; }
    .login-modal { padding: 30px 20px; }
}


/* ===== 13. 卡片封面圆角统一(16px) ===== */
.card-cover-wrap {
    border-radius: 16px !important;
    overflow: hidden;
}
.card-cover-wrap img, .card-cover-wrap .card-cover {
    border-radius: 16px !important;
}
/* 有声故事卡片内边距 */
.card-audio-item .card-body {
    padding: 12px !important;
}
/* 卡片标题+meta统一 */
.card-title {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
}
.card-meta {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
    display: flex;
    gap: 8px;
    align-items: center;
}
