* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Noto Sans SC', sans-serif;
    background: #f1f5f9;
    color: #1e293b;
    min-height: 100vh;
}

.tb-app { max-width: 1400px; margin: 0 auto; padding: 24px 20px 40px; }

/* ====== 顶栏 ====== */
.tb-header {
    display: flex; align-items: center; gap: 16px;
    padding: 16px 0; border-bottom: 1px solid #e2e8f0; margin-bottom: 28px;
}
.tb-back { text-decoration: none; color: #3b82f6; font-weight: 500; font-size: 0.9rem; white-space: nowrap; }
.tb-back:hover { color: #1d4ed8; }
.tb-title { font-size: 1.2rem; font-weight: 700; color: #1e293b; flex: 1; text-align: center; }
.tb-header-spacer { width: 80px; }

/* ====== 区块标题 ====== */
.section-title {
    font-size: 1.15rem; font-weight: 700; color: #1e293b;
    margin-bottom: 16px; padding-left: 14px;
    border-left: 4px solid #3b82f6; line-height: 1.3;
}

/* ====== 提示词走马灯 ====== */
.prompts-section { margin-bottom: 44px; }

.carousel-wrapper { position: relative; padding: 0 10px; }

/* 提示词两行网格 */
.prompt-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.prompt-grid-empty {
    display: flex;
    flex-direction: column;
    align-items: center; justify-content: center;
    grid-column: 1 / -1;
    padding: 60px 20px;
    color: #94a3b8;
    font-size: 0.95rem;
}

.prompt-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid #e2e8f0;
    transition: transform 0.2s, box-shadow 0.2s;
}
.prompt-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

/* 骨架屏脉冲动画 */
@keyframes skeleton-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 封面图 3:4 竖图 */
.prompt-card-image {
    width: 100%; aspect-ratio: 3 / 4;
    background: #f1f5f9; overflow: hidden;
    position: relative;
}
.prompt-card-image .prompt-card-skeleton {
    position: absolute; inset: 0;
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
    animation: skeleton-pulse 1.8s ease-in-out infinite;
    z-index: 1;
}
.prompt-card-image img {
    width: 100%; height: 100%; object-fit: cover; display: block;
    position: relative; z-index: 2;
    opacity: 0; transition: opacity 0.35s ease;
}
.prompt-card-image img.loaded { opacity: 1; }
.prompt-card-image .prompt-img-placeholder {
    width: 100%; height: 100%;
    background: linear-gradient(135deg, #f0f0f3, #e8e8ec);
    display: flex; align-items: center; justify-content: center;
    font-size: 3rem;
}

/* 左右箭头 */
.carousel-arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 40px; height: 40px; border-radius: 50%;
    background: #fff; border: 1px solid #e2e8f0; box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer; z-index: 2; font-size: 1.2rem; color: #475569;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
}
.carousel-arrow:hover { background: #f8fafc; color: #1e293b; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.carousel-arrow-left  { left: -12px; }
.carousel-arrow-right { right: -12px; }

/* 指示器圆点 */
.carousel-dots {
    display: flex; justify-content: center; gap: 8px; margin-top: 16px;
}
.carousel-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #cbd5e1; border: none; cursor: pointer; padding: 0;
    transition: all 0.2s;
}
.carousel-dot.active { background: #3b82f6; width: 24px; border-radius: 4px; }

/* ====== 学习导航 ====== */
.nav-section { margin-bottom: 20px; }

.nav-group { margin-bottom: 36px; }

.nav-group-title {
    font-size: 1rem; font-weight: 700; color: #1e293b;
    margin-bottom: 14px; padding-left: 4px;
    display: flex; align-items: center; gap: 8px;
}

/* 导航卡片网格 — 5列固定 */
.nav-scroll {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

/* 水平卡片：左logo + 右文字 */
.nav-card {
    display: flex; align-items: center; gap: 14px;
    background: #fff;
    border-radius: 12px;
    padding: 14px 16px;
    text-decoration: none;
    border: 1px solid #e2e8f0;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: visible;
    min-width: 0;
}
.nav-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.09);
    z-index: 1;
}

/* Logo 容器 — 圆形 + 分类色底 */
.nav-card-logo {
    width: 48px; height: 48px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.nav-card-logo img {
    width: 100%; height: 100%;
    object-fit: cover; display: block;
}
.nav-card-logo .nav-logo-placeholder {
    font-size: 1.1rem;
    font-weight: 700;
    color: #64748b;
    line-height: 1;
}

/* 文字区 — 名称 + 介绍截断 */
.nav-card-text { flex: 1; min-width: 0; }
.nav-card-name {
    font-size: 0.875rem; font-weight: 600; color: #1e293b;
    line-height: 1.3;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-card-desc {
    font-size: 0.75rem; color: #94a3b8;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    margin-top: 2px; line-height: 1.4;
}

/* 悬停浮窗 — 显示在卡片下方，完整展示介绍 */
.nav-card-tooltip {
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: #fff;
    font-size: 0.75rem;
    padding: 5px 12px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 100;
}
.nav-card-tooltip::after {
    content: '';
    position: absolute; bottom: 100%; left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-bottom-color: #1e293b;
}
.nav-card:hover .nav-card-tooltip { opacity: 1; }

/* 导航空状态 */
.nav-empty {
    text-align: center; padding: 60px 20px; color: #94a3b8;
}

/* ====== 详情弹窗 ====== */
.detail-overlay {
    position:fixed; inset:0; background:rgba(0,0,0,.5); z-index:9999;
    display:flex; align-items:center; justify-content:center; padding:20px;
}
.detail-modal {
    background:#fff; border-radius:16px; width:90vw; max-width:1000px;
    max-height:85vh; overflow:hidden; position:relative; display:flex; flex-direction:column;
}
.detail-close {
    position:absolute; top:12px; right:12px; z-index:1; width:32px;height:32px;
    border-radius:50%; border:none; background:rgba(0,0,0,.5); color:#fff;
    font-size:1rem; cursor:pointer; display:flex; align-items:center; justify-content:center;
}
.detail-layout { display:flex; height:100%; min-height:0; }
.detail-image-wrap {
    flex:1 1 50%; display:flex; align-items:center; justify-content:center;
    background:#f1f5f9; min-height:300px;
}
.detail-image-wrap img { width:100%; height:100%; object-fit:contain; }
.detail-image-fallback {
    display:flex; align-items:center; justify-content:center;
    color:#94a3b8; font-size:1rem; height:100%;
}
.detail-text { flex:1 1 50%; padding:24px; overflow-y:auto; }
.detail-cat {
    display:inline-block; padding:4px 12px; background:#f1f5f9;
    border-radius:20px; font-size:0.8rem; color:#475569; margin-bottom:16px;
}
.detail-section { margin-bottom:20px; }
.detail-label { font-size:0.8rem; color:#94a3b8; margin-bottom:8px; font-weight:500; }
.detail-content {
    font-size:0.9rem; color:#1e293b; line-height:1.7;
    white-space:pre-wrap; word-break:break-word;
}
.detail-copy-btn {
    margin-top:8px; padding:6px 14px; border:1px solid #e2e8f0; border-radius:8px;
    background:#fff; cursor:pointer; font-size:0.8rem; color:#3b82f6; transition:all .15s;
}
.detail-copy-btn:hover { background:#eff6ff; border-color:#3b82f6; }

/* ====== 响应式 ====== */
@media (max-width: 1279px) {
    .nav-scroll { grid-template-columns: repeat(3, 1fr); }  /* 3列 */
}

@media (max-width: 1024px) {
    .prompt-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .tb-header { flex-wrap: wrap; }
    .tb-header-spacer { display: none; }

    .prompt-grid { grid-template-columns: repeat(2, 1fr); }
    .carousel-arrow { display: none; }

    .nav-scroll { grid-template-columns: repeat(2, 1fr); }  /* 2列 */
    .nav-card-tooltip { display: none; }  /* 移动端不显示浮窗 */

    .detail-layout { flex-direction:column; }
    .detail-image-wrap { flex:0 0 250px; }
    .detail-text { flex:1 1 auto; }
}

@media (max-width: 480px) {
    .prompt-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .carousel-dot { width: 6px; height: 6px; }
    .carousel-dot.active { width: 18px; }
    .nav-scroll { grid-template-columns: 1fr; }  /* 1列 */
}
