/* ========================================
   Module: Media (媒体) - CSS
   三Tab：B站 / 今日头条 / OnlyFans
   列表页 + 详情页（流式文字+后台图片） + 分享浮层
   ======================================== */

/* ---- 页面容器 ---- */
.media-page {
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

/* ---- 顶栏 ---- */
.media-header {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: #fff;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
    min-height: 48px;
}
.media-header .title { font-size: 18px; font-weight: 700; }
.media-header .back-btn {
    width: 36px; height: 36px;
    border: none; background: transparent;
    font-size: 24px; color: #333;
    cursor: pointer; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
}
.media-header .back-btn:active { background: #f0f0f0; }
.media-header .title-container { flex: 1; text-align: center; }
.media-header .placeholder { width: 36px; }

/* ---- 详情页顶栏分享按钮 ---- */
.media-detail-share-btn {
    padding: 6px 14px;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    border-radius: 16px;
    cursor: pointer;
}
.media-detail-share-btn:active { opacity: 0.8; }

/* ---- Tab栏 ---- */
.media-tabs {
    display: flex;
    gap: 0;
    padding: 0 12px;
    background: #fff;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}
.media-tab-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 10px 4px 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    position: relative;
    color: #999;
    font-size: 12px;
    transition: color 0.2s;
}
.media-tab-btn::after {
    content: '';
    position: absolute;
    bottom: 0; left: 20%; right: 20%;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: transparent;
    transition: background 0.2s;
}
.media-tab-btn.active {
    color: var(--tab-color, #00a1d6);
    font-weight: 600;
}
.media-tab-btn.active::after {
    background: var(--tab-color, #00a1d6);
}
.media-tab-icon { font-size: 18px; }
.media-tab-label { font-size: 11px; }

/* ---- 列表内容区 ---- */
.media-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    -webkit-overflow-scrolling: touch;
}

/* ---- 卡片 ---- */
.media-card {
    background: #fff;
    border-radius: 12px;
    margin-bottom: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    overflow: hidden;
    transition: transform 0.15s;
}
.media-card:active { transform: scale(0.98); }
.media-card-body {
    display: flex;
    gap: 12px;
    padding: 14px 14px 8px;
    cursor: pointer;
}
.media-card-icon {
    font-size: 28px;
    flex-shrink: 0;
    width: 40px;
    text-align: center;
    padding-top: 2px;
}
.media-card-info {
    flex: 1;
    min-width: 0;
}
.media-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-color, #333);
    line-height: 1.4;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.media-card-desc {
    font-size: 13px;
    color: #888;
    line-height: 1.4;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.media-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 11px;
    color: #aaa;
}
.media-card-meta span {
    display: flex;
    align-items: center;
    gap: 2px;
}
.media-tag {
    background: #f0f0f0;
    color: #666;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 10px;
}
.media-card-arrow {
    display: flex;
    align-items: center;
    font-size: 20px;
    color: #ccc;
    flex-shrink: 0;
    padding-left: 4px;
}

/* ---- 卡片分享按钮 ---- */
.media-share-btn {
    display: block;
    width: calc(100% - 28px);
    margin: 0 14px 12px;
    padding: 8px 0;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
}
.media-share-btn:active { transform: scale(0.97); opacity: 0.85; }

/* ---- 刷新按钮 ---- */
.media-refresh-btn {
    position: absolute;
    bottom: 20px; right: 20px;
    width: 48px; height: 48px;
    border-radius: 50%; border: none;
    background: #00a1d6;
    color: #fff; font-size: 22px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: transform 0.2s;
    z-index: 10;
    display: flex; align-items: center; justify-content: center;
}
.media-refresh-btn:hover { transform: scale(1.1); }
.media-refresh-btn:active { transform: scale(0.9); }
.media-refresh-btn.spinning { animation: media-spin 0.8s linear infinite; }
@keyframes media-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ---- 空状态 / 加载 / 错误 ---- */
.media-empty { text-align: center; padding: 60px 20px; color: #999; }
.media-empty-icon { font-size: 48px; margin-bottom: 12px; }
.media-loading { text-align: center; padding: 40px 0; color: #999; font-size: 14px; }
.media-error { text-align: center; padding: 40px 20px; color: #ff6b6b; font-size: 14px; }
.media-retry-btn {
    margin-top: 12px; padding: 8px 24px;
    border: none; background: #ff6b6b; color: #fff;
    border-radius: 8px; font-size: 14px; cursor: pointer;
}

/* ========================================
   确认弹窗
   ======================================== */
.media-confirm-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.45);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
}
.media-confirm-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}
.media-confirm-modal {
    background: #fff;
    border-radius: 20px;
    padding: 28px 24px 20px;
    width: 80%;
    max-width: 300px;
    text-align: center;
    transform: scale(0.85);
    transition: transform 0.25s ease;
}
.media-confirm-overlay.visible .media-confirm-modal {
    transform: scale(1);
}
.media-confirm-icon { font-size: 42px; margin-bottom: 10px; }
.media-confirm-text {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}
.media-confirm-hint {
    font-size: 12px;
    color: #aaa;
    margin-bottom: 20px;
}
.media-confirm-actions { display: flex; gap: 10px; }
.media-confirm-cancel,
.media-confirm-ok {
    flex: 1;
    padding: 10px 0;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}
.media-confirm-cancel { background: #f0f0f0; color: #666; }
.media-confirm-ok {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}
.media-confirm-cancel:active { background: #e0e0e0; }
.media-confirm-ok:active { opacity: 0.85; }

/* ========================================
   详情页
   ======================================== */
.media-detail-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* 详情头部 */
.media-detail-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 24px 20px;
    color: #fff;
}
.media-detail-hero-icon { font-size: 32px; margin-bottom: 8px; }
.media-detail-hero-title {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 8px;
}
.media-detail-meta {
    font-size: 12px;
    opacity: 0.85;
    margin-bottom: 10px;
}
.media-detail-hero-desc {
    font-size: 14px;
    opacity: 0.9;
    line-height: 1.5;
}

/* 详情配图 */
.media-detail-image-wrap {
    padding: 16px 16px 0;
}
.media-detail-image {
    width: 100%;
    border-radius: 12px;
    display: block;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    animation: media-img-fadein 0.5s ease;
}
@keyframes media-img-fadein {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 详情文章 */
.media-detail-article {
    padding: 20px 16px;
}
.media-detail-article-label {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #667eea;
    display: inline-block;
}
.media-detail-article-body {
    font-size: 15px;
    line-height: 1.8;
    color: #444;
    text-align: justify;
    min-height: 60px;
}
.media-detail-article-body p {
    margin-bottom: 14px;
}

/* 流式光标 */
.media-detail-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: #667eea;
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: media-cursor-blink 0.8s step-end infinite;
}
@keyframes media-cursor-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* 详情底部 */
.media-detail-footer {
    padding: 10px 16px 24px;
}
.media-detail-share-bottom {
    width: 100%;
    padding: 12px 0;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    border-radius: 10px;
    cursor: pointer;
}
.media-detail-share-bottom:active { opacity: 0.85; }

/* ========================================
   分享浮层
   ======================================== */
.media-share-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.45);
    z-index: 100;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
}
.media-share-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}
.media-share-modal {
    background: #fff;
    width: 100%;
    max-height: 60%;
    border-radius: 16px 16px 0 0;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}
.media-share-overlay.visible .media-share-modal {
    transform: translateY(0);
}
.media-share-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
    border-bottom: 1px solid #eee;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    flex-shrink: 0;
}
.media-share-close {
    width: 28px; height: 28px;
    border: none; background: #f0f0f0;
    border-radius: 50%;
    font-size: 14px; color: #999;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.media-share-list {
    overflow-y: auto;
    padding: 8px 16px 20px;
    flex: 1;
}
.media-share-group-label {
    font-size: 12px;
    color: #aaa;
    padding: 10px 4px 4px;
    font-weight: 500;
}
.media-share-contact {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 10px;
    transition: background 0.15s;
    text-align: left;
}
.media-share-contact:active { background: #f5f5f5; }
.media-share-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.media-share-avatar-img {
    width: 36px; height: 36px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}
.media-share-name {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.media-share-empty {
    text-align: center;
    padding: 30px 20px;
    color: #bbb;
    font-size: 14px;
    line-height: 1.6;
}
.media-share-empty small { color: #ccc; font-size: 12px; }
