/**
 * LinkHub - 闪念模块样式
 * 借鉴语雀小记布局：左侧固定输入区 + 右侧内容流
 */

/* ==================== 主布局：左右分栏 ==================== */
.flash-layout {
    display: flex;
    gap: 0;
    height: calc(100vh - 80px);
    overflow: hidden;
}

/* ==================== 左侧：固定输入区 ==================== */
.flash-left {
    width: 320px;
    min-width: 320px;
    border-right: 1px solid #ecedf0;
    display: flex;
    flex-direction: column;
    background: #fff;
    position: relative;
}

/* 输入区工具栏 */
.flash-input-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px 0;
}

.flash-toolbar-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-tertiary);
    transition: background 0.12s, color 0.12s;
}

.flash-toolbar-btn:hover {
    background: rgba(55, 53, 47, 0.06);
    color: var(--text-primary);
}

/* 主输入框区域 */
.flash-input-body {
    flex: 1;
    padding: 12px 16px;
    overflow-y: auto;
}

.flash-textarea {
    width: 100%;
    border: none;
    outline: none;
    resize: none;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-primary);
    background: transparent;
    min-height: 80px;
    font-family: inherit;
}

.flash-textarea::placeholder {
    color: #c8c8c8;
    font-size: 14px;
}

/* 可折叠的额外字段（标签 + 项目） */
.flash-extra-fields {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px 8px;
    flex-wrap: wrap;
}

.flash-tag-input {
    font-size: 13px;
    padding: 4px 10px;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    outline: none;
    width: 130px;
    color: var(--text-secondary);
    background: #fafbfc;
    transition: border-color 0.2s;
}

.flash-tag-input:focus {
    border-color: rgba(106, 92, 255, 0.4);
}

.flash-project-select {
    font-size: 13px;
    padding: 4px 8px;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    outline: none;
    color: var(--text-secondary);
    background: #fafbfc;
    cursor: pointer;
    max-width: 140px;
}

/* 底部标签展示区 */
.flash-input-tags {
    padding: 0 16px;
    min-height: 0;
}

/* 底部操作栏 */
.flash-input-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-top: 1px solid #f0f0f0;
}

.flash-input-hint {
    font-size: 13px;
    color: #c8c8c8;
    user-select: none;
}

.flash-input-shortcut {
    font-size: 11px;
    color: #c8c8c8;
    user-select: none;
}

/* ==================== 右侧：内容流 ==================== */
.flash-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fafafa;
}

/* 右侧顶部：筛选 + 搜索 */
.flash-right-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    border-bottom: 1px solid #ecedf0;
    background: #fff;
    flex-shrink: 0;
}

.flash-filter-tabs {
    display: flex;
    align-items: center;
    gap: 2px;
}

.flash-tab {
    padding: 5px 14px;
    font-size: 13px;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.12s;
    white-space: nowrap;
}

.flash-tab:hover {
    background: rgba(55, 53, 47, 0.04);
}

.flash-tab.active {
    color: var(--text-primary);
    background: rgba(55, 53, 47, 0.06);
    font-weight: 500;
}

.flash-right-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.flash-danger-btn {
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 500;
    color: #fff;
    background: #ef4444;
    border: 1px solid #ef4444;
    border-radius: 6px;
    cursor: pointer;
    line-height: 1.2;
    white-space: nowrap;
    align-items: center;
    justify-content: center;
    transition: background 0.12s, border-color 0.12s, opacity 0.12s;
}

.flash-danger-btn:hover {
    background: #dc2626;
    border-color: #dc2626;
}

.flash-stats-text {
    font-size: 13px;
    color: var(--text-tertiary);
    white-space: nowrap;
}

/* 搜索框 */
.flash-search-wrap {
    position: relative;
}

.flash-search-svg {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    pointer-events: none;
}

.flash-search-input {
    font-size: 13px;
    padding: 5px 10px 5px 28px;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    outline: none;
    width: 160px;
    color: var(--text-primary);
    background: #fafbfc;
    transition: border-color 0.2s, width 0.2s;
}

.flash-search-input:focus {
    border-color: rgba(106, 92, 255, 0.4);
    width: 200px;
}

/* ==================== 内容流（可滚动） ==================== */
.flash-stream {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
}

/* 日期分组 */
.flash-day-group {
    margin-bottom: 8px;
}

.flash-day-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-tertiary);
    padding: 8px 0 6px;
    letter-spacing: 0.3px;
}

/* ==================== 闪念卡片（语雀小记风格） ==================== */
.flash-card {
    position: relative;
    background: #ffffff;
    border: 1px solid #ecedf0;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 10px;
    transition: box-shadow 0.15s, border-color 0.15s;
    cursor: default;
}

.flash-card:hover {
    border-color: #d8dae0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

/* 多选模式选中状态 */
.flash-card.selected {
    border-color: rgba(106, 92, 255, 0.4);
    background: rgba(106, 92, 255, 0.02);
}

.flash-card-trash {
    border-color: #f4d9d9;
    background: #fff9f9;
}

.flash-card-trash:hover {
    border-color: #ebc0c0;
}

.flash-card-trash .flash-card-time {
    color: #c27b7b;
}

/* 多选复选框 */
.flash-card-check {
    position: absolute;
    top: 16px;
    left: -30px;
    width: 18px;
    height: 18px;
    border: 1.5px solid #d0d0d0;
    border-radius: 4px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #fff;
    background: #fff;
    transition: all 0.12s;
}

.flash-stream.select-mode .flash-card-check {
    display: flex;
}

.flash-stream.select-mode .flash-card {
    margin-left: 36px;
}

.flash-card.selected .flash-card-check {
    background: var(--primary);
    border-color: var(--primary);
}

/* 卡片时间戳（顶部淡色小字，语雀风格） */
.flash-card-time {
    font-size: 13px;
    color: #bbb;
    margin-bottom: 8px;
    line-height: 1;
}

/* 卡片内容 */
.flash-card-content {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-primary);
    word-break: break-word;
    white-space: pre-wrap;
}

/* 内容中的链接 */
.flash-link {
    color: var(--primary);
    text-decoration: none;
}

.flash-link:hover {
    text-decoration: underline;
}

/* 卡片底部元信息 */
.flash-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    flex-wrap: wrap;
}

/* 标签 */
.flash-tag {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(106, 92, 255, 0.07);
    color: rgba(106, 92, 255, 0.7);
}

/* 项目关联标签 */
.flash-project-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(34, 197, 94, 0.07);
    color: rgba(34, 197, 94, 0.75);
}

/* 转换状态标记 */
.flash-converted-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(55, 53, 47, 0.05);
    color: var(--text-tertiary);
    cursor: pointer;
    transition: background 0.12s;
}

.flash-converted-badge:hover {
    background: rgba(55, 53, 47, 0.1);
}

/* ==================== 卡片 hover 操作按钮（右上角，语雀风格） ==================== */
.flash-card-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.12s;
}

.flash-card:hover .flash-card-actions {
    opacity: 1;
}

.flash-act-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-tertiary);
    transition: all 0.12s;
}

.flash-act-btn:hover {
    background: #f5f5f5;
    border-color: #e2e5ed;
    color: var(--text-primary);
}

.flash-act-btn.danger {
    color: #ef4444;
}

.flash-act-btn.danger:hover {
    color: #dc2626;
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.35);
}

/* ==================== 更多操作下拉菜单 ==================== */
.flash-dropdown-menu {
    position: fixed;
    z-index: 200;
    background: #fff;
    border: 1px solid #e2e5ed;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    padding: 4px;
    min-width: 140px;
}

.flash-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 5px;
    transition: background 0.1s;
}

.flash-menu-item:hover {
    background: #f5f5f5;
}

.flash-menu-item.danger {
    color: #ef4444;
}

.flash-menu-item.danger:hover {
    background: rgba(239, 68, 68, 0.06);
}

.flash-menu-icon {
    font-size: 14px;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.flash-menu-divider {
    height: 1px;
    background: #f0f0f0;
    margin: 4px 8px;
}

/* ==================== 内联编辑 ==================== */
.flash-edit-area {
    width: 100%;
    border: 1px solid #e2e5ed;
    border-radius: 6px;
    outline: none;
    resize: none;
    font-size: 14px;
    line-height: 1.7;
    padding: 8px 10px;
    color: var(--text-primary);
    background: #fafbfc;
    font-family: inherit;
    min-height: 60px;
    transition: border-color 0.2s;
}

.flash-edit-area:focus {
    border-color: rgba(106, 92, 255, 0.4);
}

.flash-edit-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.flash-edit-save {
    padding: 4px 14px;
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    background: var(--primary);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: opacity 0.12s;
}

.flash-edit-save:hover {
    opacity: 0.85;
}

.flash-edit-cancel {
    padding: 4px 14px;
    font-size: 13px;
    color: var(--text-tertiary);
    background: transparent;
    border: 1px solid #e2e5ed;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.12s;
}

.flash-edit-cancel:hover {
    border-color: #ccc;
    color: var(--text-secondary);
}

/* ==================== 发送按钮 ==================== */
.flash-send-btn {
    padding: 5px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    background: var(--primary);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.15s;
    flex-shrink: 0;
}

.flash-send-btn:hover {
    opacity: 0.85;
}

/* ==================== 批量操作栏 ==================== */
.flash-batch-bar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: #ffffff;
    border: 1px solid #e2e5ed;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    z-index: 100;
    font-size: 13px;
}

.flash-batch-count {
    color: var(--text-secondary);
    font-size: 13px;
}

.flash-batch-btn {
    padding: 5px 12px;
    font-size: 13px;
    border: 1px solid #e2e5ed;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.12s;
}

.flash-batch-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(106, 92, 255, 0.04);
}

.flash-batch-btn.danger {
    color: #dc2626;
    border-color: rgba(239, 68, 68, 0.35);
    background: #fff5f5;
}

.flash-batch-btn.danger:hover {
    color: #b91c1c;
    border-color: #dc2626;
    background: #fee2e2;
}

.flash-batch-btn.cancel {
    color: var(--text-tertiary);
}

/* ==================== 空状态 ==================== */
.flash-empty {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-tertiary);
}

.flash-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.flash-empty-text {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.flash-empty-sub {
    font-size: 13px;
    color: #c8c8c8;
}

/* ==================== 加载更多 ==================== */
.flash-load-more {
    text-align: center;
    padding: 16px 24px;
}

.flash-load-more-btn {
    font-size: 13px;
    color: var(--text-tertiary);
    background: transparent;
    border: 1px solid #e2e5ed;
    border-radius: 6px;
    padding: 5px 16px;
    cursor: pointer;
    transition: all 0.12s;
}

.flash-load-more-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ==================== 全局快捷入口浮动按钮 ==================== */
#flashGlobalBtn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(106, 92, 255, 0.35);
    z-index: 200;
    transition: transform 0.15s, box-shadow 0.15s;
}

#flashGlobalBtn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(106, 92, 255, 0.45);
}

/* 全局快捷输入浮层 */
.flash-global-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
}

.flash-global-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.flash-global-box {
    width: 520px;
    max-width: 90vw;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
    padding: 20px;
    transform: translateY(-10px);
    transition: transform 0.2s;
}

.flash-global-overlay.show .flash-global-box {
    transform: translateY(0);
}

/* 全局浮层输入框（比页面内的更高） */
.flash-global-box .flash-textarea {
    min-height: 140px;
}

.flash-global-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.flash-input-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
    /* 移动端：左右分栏改为上下布局 */
    .flash-layout {
        flex-direction: column;
        height: auto;
    }
    .flash-left {
        width: 100%;
        min-width: 0;
        border-right: none;
        border-bottom: 1px solid #ecedf0;
        max-height: 200px;
    }
    .flash-right {
        height: calc(100vh - 280px);
    }
    .flash-stream {
        padding: 12px 16px;
    }
    .flash-right-header {
        padding: 10px 16px;
        flex-wrap: wrap;
        gap: 8px;
    }
    .flash-right-actions {
        width: 100%;
        flex-wrap: wrap;
        gap: 8px;
    }
    .flash-search-wrap {
        flex: 1 1 180px;
    }
    .flash-search-input,
    .flash-search-input:focus {
        width: 100%;
    }
    .flash-global-box {
        margin: 0 12px;
    }
    .flash-batch-bar {
        left: 12px;
        right: 12px;
        transform: none;
    }
}


/* ==================== 闪念图片缩略图（横向排列、自动换行） ==================== */
.flash-img-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.flash-img-item {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 6px;
    cursor: pointer;
    background: #f5f5f5;
}

.flash-img-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s;
}

.flash-img-item:hover img {
    transform: scale(1.05);
}

/* ==================== 图片查看器浮层 ==================== */
.flash-img-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    user-select: none;
}

.flash-img-overlay img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 4px;
    cursor: default;
    transition: transform 0.15s ease;
    transform-origin: center center;
}

/* 翻页按钮 */
.flash-viewer-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 10;
}
.flash-viewer-btn:hover { background: rgba(255,255,255,0.3); }
.flash-viewer-prev { left: 16px; }
.flash-viewer-next { right: 16px; }

/* 页码指示器 */
.flash-viewer-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    pointer-events: none;
}

/* 关闭按钮 */
.flash-viewer-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}
.flash-viewer-close:hover { background: rgba(255,255,255,0.3); }

/* ==================== 输入区图片预览 ==================== */
.flash-img-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 0 0;
}

.flash-preview-item {
    position: relative;
    width: 72px;
    height: 72px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e8e8e8;
}

.flash-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.flash-preview-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.flash-preview-remove:hover {
    background: rgba(239, 68, 68, 0.8);
}
