/* 用户端样式 */
.user-page {
    background: #f8fafc;
    min-height: 100vh;
}

/* 顶部导航栏 */
.user-header {
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    padding: 0 1.5rem;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}
.user-header .logo {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.user-header .user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.user-header .user-info .nickname {
    font-weight: 500;
    color: var(--text-primary);
}

/* 主内容区 */
.user-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* 教程卡片网格 */
.tutorial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.tutorial-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.tutorial-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.tutorial-card .card-cover {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: #e2e8f0;
}
.tutorial-card .card-body {
    padding: 1rem;
}
.tutorial-card .card-body h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tutorial-card .card-body p {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.tutorial-card .card-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* 教程详情页 */
.tutorial-detail {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    padding: 2rem;
}
.tutorial-detail h1 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
}
.tutorial-detail .meta {
    display: flex;
    gap: 1.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.tutorial-content {
    line-height: 1.8;
    font-size: 1rem;
}
.tutorial-content img {
    max-width: 100%;
    border-radius: 6px;
    margin: 1rem 0;
}
.tutorial-content video {
    max-width: 100%;
    border-radius: 6px;
    margin: 1rem 0;
}
.tutorial-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

/* 子教程列表 */
.sub-tutorial-list {
    list-style: none;
}
.sub-tutorial-list li {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: background 0.15s;
}
.sub-tutorial-list li:hover {
    background: #f8fafc;
}
.sub-tutorial-list li .order {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 600;
}

/* 搜索栏 */
.search-bar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}
.search-bar .form-input {
    flex: 1;
}

/* AI 问答页 */
.ai-qa-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 140px);
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    overflow: hidden;
}
.ai-qa-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}
.ai-qa-message {
    margin-bottom: 1rem;
    display: flex;
    gap: 0.75rem;
}
.ai-qa-message.user {
    flex-direction: row-reverse;
}
.ai-qa-message .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}
.ai-qa-message.user .avatar {
    background: var(--primary);
    color: #fff;
}
.ai-qa-message.assistant .avatar {
    background: #f0f2f5;
    color: var(--text-secondary);
}
.ai-qa-message .bubble {
    max-width: 70%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.6;
}
.ai-qa-message.user .bubble {
    background: var(--primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.ai-qa-message.assistant .bubble {
    background: #f0f2f5;
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}
.ai-qa-input {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
}
.ai-qa-input .form-input {
    flex: 1;
}

/* 分享访问页 */
.share-access-card {
    max-width: 500px;
    margin: 4rem auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    padding: 2rem;
    text-align: center;
}
.share-access-card .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* 响应式 */
@media (max-width: 768px) {
    .user-main {
        padding: 1.5rem 1rem;
    }
    .tutorial-grid {
        grid-template-columns: 1fr;
    }
    .tutorial-detail {
        padding: 1.5rem;
    }
    .tutorial-detail h1 {
        font-size: 1.4rem;
    }
    .ai-qa-message .bubble {
        max-width: 85%;
    }
    .ai-qa-container {
        height: calc(100vh - 120px);
    }
}