/**
 * Flow 页面样式
 * 信息流双栏布局、详情面板、Emoji 反应、就地回复表单等样式
 * 莫兰蒂色系设计
 */

/* ========== 外层容器 ========== */
.flow-wrapper {
    min-height: 600px;
    height: calc(100vh - 120px);
    max-height: calc(100vh - 120px);
    overflow: visible;
    background: #f5f5f5;
    border-radius: 8px;
    margin: -15px;  /* 抵消 container 的 padding */
    display: flex;
    flex-direction: column;
}

/* ========== 移动端标题栏 ========== */
.flow-mobile-header {
    padding: 12px 16px;
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    position: sticky;
    top: 0;
    z-index: 100;
}

/* ========== 双栏容器 ========== */
.flow-split-container {
    display: flex;
    flex: 1;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

/* ========== 左侧信息流面板 ========== */
.flow-list-pane {
    flex: 0 0 50%;
    max-width: 600px;
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px;
    border-right: 1px solid #e9ecef;
    background: #fff;
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 transparent;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

.flow-list-pane::-webkit-scrollbar {
    width: 6px;
}

.flow-list-pane::-webkit-scrollbar-thumb {
    background-color: #c1c1c1;
    border-radius: 3px;
}

/* PC端标题 */
.flow-header {
    position: sticky;
    top: 0;
    background: #faf8f5; /* 莫兰蒂米白 */
    z-index: 10;
    padding-bottom: 12px;
    border-bottom: 1px solid #e8e4dc;
}

/* ========== 信息流卡片 - 莫兰蒂色系 ========== */
.flow-item {
    background: #faf8f5; /* 温暖的米白色 */
    border-radius: 8px;
    margin-bottom: 8px;
    padding: 14px 16px;
    border: 1px solid #e8e4dc;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.flow-item:hover {
    background: #f0ebe3; /* 莫兰蒂米色 */
    border-color: #c5bdb0;
    box-shadow: 0 2px 8px rgba(139, 115, 85, 0.08);
}

.flow-item.active {
    background: #e8ebe3; /* 莫兰蒂灰绿色 */
    border-color: #8B9A8C; /* 莫兰蒂绿色 */
    border-left: 3px solid #8B9A8C;
}

/* 推荐原因 - 莫兰蒂色系 */
.flow-reason {
    display: inline-block;
    background: linear-gradient(135deg, #e8ebe3 0%, #d4d9d0 100%); /* 莫兰蒂灰绿渐变 */
    color: #6b7b6d; /* 莫兰蒂绿 */
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    margin-bottom: 8px;
}

/* ========== 作者信息 ========== */
.flow-author {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.flow-author-avatar,
.flow-author-avatar-default {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    margin-right: 8px;
    object-fit: cover;
}

.flow-author-avatar-default {
    background: linear-gradient(135deg, #8B9A8C 0%, #A8B5A0 100%); /* 莫兰蒂绿色渐变 */
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
}

.flow-author-name {
    font-weight: 600;
    color: #4a4a4a; /* 莫兰蒂深灰 */
    font-size: 0.85rem;
}

.flow-author-meta {
    color: #8a8a8a; /* 莫兰蒂灰 */
    font-size: 0.7rem;
}

/* ========== 内容区域 ========== */
.flow-title {
    font-size: 1rem;
    font-weight: 600;
    color: #3a3a3a; /* 莫兰蒂深灰 */
    margin-bottom: 6px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.flow-summary {
    color: #6a6a6a; /* 莫兰蒂灰 */
    font-size: 0.85rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 8px;
}

/* ========== 统计信息 ========== */
.flow-stats {
    display: flex;
    align-items: center;
    gap: 16px;
    color: #8a8a8a; /* 莫兰蒂灰 */
    font-size: 0.8rem;
}

.flow-stat {
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s;
}

.flow-stat:hover {
    color: #8B9A8C; /* 莫兰蒂绿 */
}

.flow-stat i {
    font-size: 0.9rem;
}

.flow-stat.liked {
    color: #8B9A8C; /* 莫兰蒂绿 */
}

.flow-stat.liked i {
    font-weight: bold;
}

/* ========== 键盘导航提示 - 莫兰蒂色系 ========== */
.keyboard-hint {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(139, 154, 140, 0.95); /* 莫兰蒂绿半透明 */
    color: #fff;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s;
    box-shadow: 0 2px 8px rgba(139, 115, 85, 0.15);
}

.keyboard-hint.visible {
    opacity: 1;
}

.keyboard-hint kbd {
    background: rgba(255,255,255,0.25);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}

/* ========== 详情面板 Emoji 反应样式 ========== */
.flow-detail-emoji-reactions {
    flex: 1;
}

.flow-detail-emoji-reactions .emoji-reactions-container {
    margin-top: 0;
}

.flow-detail-emoji-reactions .emoji-reactions {
    gap: 8px;
}

.flow-detail-emoji-reactions .emoji-reaction {
    padding: 6px 10px;
    font-size: 14px;
}

.flow-detail-emoji-reactions .emoji-reaction .emoji {
    font-size: 16px;
}

.flow-detail-emoji-reactions .emoji-reaction .count {
    font-size: 12px;
}

/* ========== 就地回复表单样式 ========== */
.flow-reply-form-container {
    margin: 16px 0;
    padding: 16px;
    background: #f0ebe3;
    border-radius: 8px;
    border: 1px solid #e8e4dc;
}

.flow-reply-form-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #4a4a4a;
    margin-bottom: 12px;
}

.flow-reply-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1c7b7;
    border-radius: 6px;
    background: #fff;
    font-size: 0.95rem;
    line-height: 1.5;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.flow-reply-textarea:focus {
    outline: none;
    border-color: #8B9A8C;
    box-shadow: 0 0 0 2px rgba(139, 154, 140, 0.2);
}

.flow-reply-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
}

.flow-reply-message {
    margin-top: 12px;
}

.flow-reply-message .alert-sm {
    padding: 8px 12px;
    font-size: 0.875rem;
    margin-bottom: 0;
}

/* ========== 无限滚动触发器 ========== */
.infinite-scroll-trigger {
    height: 50px;
    margin-top: 20px;
}

/* ========== 右侧详情面板 - 莫兰蒂色系 ========== */
.flow-detail-pane {
    flex: 1;
    height: 100%;
    overflow-y: auto;
    background: #f5f0e8; /* 与首页一致的淡黄色背景 */
}

.flow-detail-sticky {
    min-height: 100%;
}

/* 详情内容样式 */
.flow-detail-content {
    background: #faf8f5; /* 温暖的米白色 */
    min-height: 100%;
    padding: 24px;
}

.flow-detail-header {
    border-bottom: 1px solid #e8e4dc;
    padding-bottom: 16px;
    margin-bottom: 16px;
}

.flow-detail-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #3a3a3a; /* 莫兰蒂深灰 */
    line-height: 1.4;
    margin-bottom: 12px;
}

.flow-detail-author {
    display: flex;
    align-items: center;
}

.flow-detail-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
    object-fit: cover;
}

.flow-detail-author-info {
    flex: 1;
}

.flow-detail-author-name {
    font-weight: 600;
    color: #4a4a4a; /* 莫兰蒂深灰 */
}

.flow-detail-author-meta {
    color: #8a8a8a; /* 莫兰蒂灰 */
    font-size: 0.85rem;
}

.flow-detail-body {
    font-size: 1rem;
    line-height: 1.8;
    color: #4a4a4a; /* 莫兰蒂深灰 */
}

.flow-detail-body p {
    margin-bottom: 1em;
}

.flow-detail-stats {
    display: flex;
    gap: 24px;
    padding: 16px 0;
    border-top: 1px solid #e8e4dc;
    border-bottom: 1px solid #e8e4dc;
    margin: 16px 0;
}

.flow-detail-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #6a6a6a; /* 莫兰蒂灰 */
    font-size: 0.95rem;
}

/* 空状态 */
.empty-state {
    padding: 40px 20px;
}

/* ========== 加载动画 ========== */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spinning {
    animation: spin 1s linear infinite;
}

/* ========== 移动端适配 ========== */
@media (max-width: 991px) {
    .flow-wrapper {
        height: auto;
        overflow: visible;
    }
    
    .flow-split-container {
        flex-direction: column;
    }
    
    .flow-list-pane {
        flex: 1;
        max-width: 100%;
        height: auto;
        overflow: visible;
        padding: 8px;
        border-right: none;
    }
    
    .flow-detail-pane {
        display: none !important;
    }
    
    .flow-item {
        padding: 12px;
        margin-bottom: 6px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    .flow-item.active {
        border-left: none;
        background: #fff;
    }
    
    .flow-title {
        font-size: 0.95rem;
    }
    
    .flow-summary {
        font-size: 0.8rem;
        -webkit-line-clamp: 2;
    }
}
