/* 统一底部分享面板（文章列表 / 文章详情） */

.share-sheet-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.share-sheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    animation: share-fade-in 0.2s ease;
}

.share-sheet-panel {
    position: relative;
    background: #fff;
    border-radius: 20px 20px 0 0;
    padding: 18px 16px 24px;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.18);
    transform: translateY(100%);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    max-height: 86vh;
    overflow-y: auto;
}

.share-sheet-panel.show {
    transform: translateY(0);
}

@keyframes share-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 顶部卡片 */
.share-sheet-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f0f0f0;
}

.share-sheet-icon-img,
.share-sheet-icon-default {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    flex-shrink: 0;
    overflow: hidden;
    background: #f5f7fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.share-sheet-icon-img {
    object-fit: cover;
}

.share-sheet-icon-default {
    font-size: 24px;
    color: #2563eb;
}

.share-sheet-info {
    min-width: 0;
    flex: 1;
}

.share-sheet-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.share-sheet-url {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.share-sheet-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.share-sheet-close:hover {
    background: #e5e7eb;
}

/* 应用网格 */
.share-sheet-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px 8px;
    margin-bottom: 18px;
}

@media (min-width: 400px) {
    .share-sheet-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

.share-sheet-app {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 6px 2px;
    border-radius: 10px;
    transition: background 0.15s;
}

.share-sheet-app:hover,
.share-sheet-app:active {
    background: #f3f4f6;
}

.share-sheet-app-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.share-sheet-app-icon.native { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.share-sheet-app-icon.wechat { background: linear-gradient(135deg, #07c160, #05a350); }
.share-sheet-app-icon.qq { background: linear-gradient(135deg, #12b7f5, #0a9fe2); }
.share-sheet-app-icon.weibo { background: linear-gradient(135deg, #e6162d, #c41227); }
.share-sheet-app-icon.copy { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.share-sheet-app-icon.more { background: linear-gradient(135deg, #9ca3af, #6b7280); }

.share-sheet-app-name {
    font-size: 12px;
    color: #374151;
    white-space: nowrap;
}

/* 取消按钮 */
.share-sheet-cancel {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 12px;
    background: #f3f4f6;
    color: #374151;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
}

.share-sheet-cancel:hover,
.share-sheet-cancel:active {
    background: #e5e7eb;
}

/* 微信分享二级面板 */
.share-sheet-wechat {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    animation: share-fade-in 0.2s ease;
    padding: 20px;
}

.share-sheet-wechat-card {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    width: 100%;
    max-width: 320px;
    text-align: center;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.share-sheet-wechat-title {
    font-size: 17px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 14px;
}

.share-sheet-wechat-qr {
    width: 180px;
    height: 180px;
    border-radius: 10px;
    margin: 0 auto 10px;
    display: block;
    border: 1px solid #f0f0f0;
}

.share-sheet-wechat-tip {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 14px;
}

.share-sheet-wechat-input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 13px;
    color: #374151;
    background: #f9fafb;
    margin-bottom: 14px;
    outline: none;
}

.share-sheet-wechat-actions {
    display: flex;
    gap: 10px;
}

.share-sheet-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
}

.share-sheet-btn.primary {
    background: #2563eb;
    color: #fff;
}

.share-sheet-btn.ghost {
    background: #f3f4f6;
    color: #374151;
}

/* Toast */
/* 极简分享提示：浅色胶囊，无黑底、无边框黑框，仅文字 + 绿色对勾 */
/* ✅ 位置改到页面顶部导航下方，与 Knowledge.css 保持一致 */
.share-toast {
    position: fixed;
    left: 50%;
    top: 80px;
    bottom: auto;
    transform: translateX(-50%) translateY(-10px) scale(0.96);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 86vw;
    padding: 11px 18px;
    background: rgba(255, 255, 255, 0.97);
    color: #1f2937;
    border: 1px solid rgba(37, 99, 235, 0.22);
    border-radius: 999px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.22s ease, transform 0.22s ease;
    pointer-events: none;
    white-space: nowrap;
}

.share-toast .toast-ico {
    color: #16a34a;
    font-size: 15px;
    display: inline-flex;
}

.share-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
}

@media (max-width: 720px) {
    .share-toast { top: 64px; }
}

/* 桌面端：面板不要太宽 */
@media (min-width: 768px) {
    .share-sheet-panel {
        border-radius: 20px;
        max-width: 520px;
        margin: 0 auto;
        transform: translateY(20px);
        opacity: 0;
        transition: transform 0.25s ease, opacity 0.25s ease;
    }
    .share-sheet-panel.show {
        transform: translateY(0);
        opacity: 1;
    }
    .share-sheet-overlay {
        justify-content: center;
        padding: 20px;
    }
    .share-sheet-backdrop {
        background: rgba(0, 0, 0, 0.35);
    }
}
