/* ========================================================
   Slim 主题专属微语流样式 (Slim Twitter / Memos Stream)
   纯净极简、时间轴留白、无缝自适应深浅色模式
   ======================================================== */

.twitter-container {
    max-width: var(--page-max-width, 840px);
    margin: 0 auto;
    padding: 0 var(--section-gap-x, 1.25rem) 4rem;
    box-sizing: border-box;
}

/* 微语列表时间流 */
.twitter-stream {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-top: 1.5rem;
    position: relative;
}

/* 微语卡片：通透毛玻璃半透质感 (Ultra-Translucent Frosted Glass) */
.twitter-card {
    background: rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: var(--radius-ui, 8px);
    padding: 1.25rem 1.4rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.03), inset 0 1px 0 rgba(255, 255, 255, 0.7);
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease, transform 0.25s ease;
    box-sizing: border-box;
    position: relative;
}
.twitter-card:hover {
    background: rgba(255, 255, 255, 0.45);
    border-color: var(--accent, #0969da);
    box-shadow: 0 8px 30px rgba(9, 105, 218, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transform: translateY(-1px);
}
html.dark .twitter-card {
    background: rgba(25, 29, 34, 0.25);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
html.dark .twitter-card:hover {
    background: rgba(25, 29, 34, 0.45);
    border-color: var(--accent, #39d353);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

/* 置顶微语高亮边框 */
.twitter-card.is-top {
    border-left: 3px solid var(--accent, #0969da);
}

/* 卡片头部 */
.twitter-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.85rem;
}
.twitter-author-meta {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}
.twitter-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--background-elevated, #f6f8fa);
    border: 1px solid var(--gray-light, #eaeef2);
    flex-shrink: 0;
}
.twitter-author-info {
    display: flex;
    flex-direction: column;
}
.twitter-author-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary, #1f2328);
    line-height: 1.3;
}
.twitter-date {
    font-size: 0.75rem;
    color: var(--text-muted, #6e7781);
    line-height: 1.4;
}
.twitter-badges {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.twitter-top-badge {
    font-size: 11px;
    color: var(--accent, #0969da);
    background: rgba(9, 105, 218, 0.1);
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 500;
    line-height: 1.3;
}
html.dark .twitter-top-badge {
    background: rgba(57, 211, 83, 0.15);
    color: var(--accent, #39d353);
}

/* 微语正文内容 */
.twitter-content {
    font-size: var(--text-md, 0.95rem);
    color: var(--text-primary, #1f2328);
    line-height: var(--line-height-body, 1.7);
    word-break: break-word;
    font-family: var(--font-family-text);
}
.twitter-content p {
    margin: 0 0 0.65rem;
}
.twitter-content p:last-child {
    margin-bottom: 0;
}
.twitter-content a {
    color: var(--accent, #0969da);
    text-decoration: none;
}
.twitter-content a:hover {
    text-decoration: underline;
}

/* 配图预览 */
.twitter-media {
    margin-top: 0.75rem;
}
.twitter-media-link {
    display: inline-block;
    max-width: 100%;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--gray-light, #eaeef2);
    cursor: zoom-in;
    background: var(--background-elevated, #f6f8fa);
    transition: opacity 0.2s ease;
}
.twitter-media-link:hover {
    opacity: 0.92;
}
.twitter-media-img {
    max-width: 100%;
    max-height: 380px;
    display: block;
    object-fit: cover;
}
html.dark .twitter-media-link {
    border-color: rgba(255, 255, 255, 0.1);
}

/* 底部交互栏 */
.twitter-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--gray-light, #eaeef2);
}
html.dark .twitter-actions {
    border-top-color: rgba(255, 255, 255, 0.07);
}

.twitter-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: none;
    border: none;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--text-muted, #6e7781);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    line-height: 1;
}
.twitter-action-btn svg {
    width: 15px;
    height: 15px;
    transition: transform 0.2s ease, fill 0.2s ease;
}
.twitter-action-btn:hover {
    color: var(--text-primary, #1f2328);
    background: var(--background-elevated, #f6f8fa);
}
html.dark .twitter-action-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* 点赞高亮激活 */
.twitter-like-btn.liked {
    color: #e0245e !important;
}
.twitter-like-btn.liked svg {
    fill: #e0245e;
    stroke: #e0245e;
}
.twitter-like-btn.animating svg {
    animation: heartPulse 0.45s ease;
}
@keyframes heartPulse {
    0% { transform: scale(1); }
    40% { transform: scale(1.35); }
    100% { transform: scale(1); }
}

/* 回复讨论区域 */
.twitter-replies-wrap {
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px dashed var(--gray-light, #eaeef2);
    display: none;
}
.twitter-replies-wrap.active {
    display: block;
}
html.dark .twitter-replies-wrap {
    border-top-color: rgba(255, 255, 255, 0.08);
}

.twitter-replies-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-bottom: 0.85rem;
}
.twitter-reply-item {
    font-size: 0.82rem;
    line-height: 1.5;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 4px;
    color: var(--text-primary, #1f2328);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    transition: background 0.2s ease, opacity 0.3s ease, transform 0.3s ease;
}
html.dark .twitter-reply-item {
    background: rgba(255, 255, 255, 0.04);
}
.twitter-reply-main {
    flex: 1;
    min-width: 0;
    word-break: break-word;
}
.twitter-reply-meta {
    font-weight: 600;
    color: var(--text-secondary, #4d5761);
    margin-right: 6px;
}
.twitter-reply-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.twitter-reply-time {
    font-size: 0.72rem;
    color: var(--text-muted, #6e7781);
    font-weight: normal;
}
.twitter-reply-del-btn {
    background: transparent;
    border: none;
    color: var(--text-muted, #6e7781);
    cursor: pointer;
    padding: 1px 5px;
    font-size: 0.72rem;
    border-radius: 3px;
    opacity: 0.6;
    transition: opacity 0.2s, color 0.2s, background 0.2s;
    line-height: 1.2;
}
.twitter-reply-del-btn:hover {
    opacity: 1;
    color: #cf222e;
    background: rgba(207, 34, 46, 0.08);
}
.twitter-action-btn.twitter-del-btn:hover {
    color: #cf222e;
    background: rgba(207, 34, 46, 0.08);
}

/* 回复输入表单 */
.twitter-reply-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.04);
    padding: 10px 12px;
    border-radius: 6px;
}
html.dark .twitter-reply-form {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.06);
}
.twitter-reply-form-row {
    display: flex;
    gap: 8px;
}
.twitter-reply-input {
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid var(--gray-light, #eaeef2);
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 0.8rem;
    color: var(--text-primary, #1f2328);
    outline: none;
    transition: border-color 0.2s ease, background 0.2s ease;
    font-family: inherit;
    box-sizing: border-box;
}
html.dark .twitter-reply-input {
    background: rgba(0, 0, 0, 0.25);
    border-color: rgba(255, 255, 255, 0.1);
}
.twitter-reply-input:focus {
    border-color: var(--accent, #0969da);
}
.twitter-reply-name {
    width: 140px;
}
.twitter-reply-content {
    flex: 1;
}
.twitter-reply-submit {
    background: var(--accent, #0969da);
    border: none;
    color: #fff;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    align-self: flex-end;
}
.twitter-reply-submit:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* 分页导航 */
.twitter-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-top: 2rem;
}
.twitter-page-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 6px 14px;
    background: var(--background-body, #fff);
    border: 1px solid var(--gray-light, #eaeef2);
    border-radius: 6px;
    color: var(--text-primary, #1f2328);
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}
.twitter-page-btn:hover {
    border-color: var(--accent, #0969da);
    color: var(--accent, #0969da);
}
.twitter-page-btn.disabled {
    opacity: 0.4;
    pointer-events: none;
}
html.dark .twitter-page-btn {
    background: var(--background-elevated, #202428);
    border-color: rgba(255, 255, 255, 0.08);
}
.twitter-page-info {
    font-size: 0.82rem;
    color: var(--text-muted, #6e7781);
}

/* 空状态 */
.twitter-empty {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--text-muted, #6e7781);
}

@media (max-width: 640px) {
    .twitter-card {
        padding: 1rem;
    }
    .twitter-reply-form-row {
        flex-direction: column;
    }
    .twitter-reply-name {
        width: 100%;
    }
}
