:root {
    --stream-bg: #ffffff;
    --stream-border: #e5e5ea;
    --stream-text: #1D1D1F;
    --stream-text-light: #6E6E73;
    --stream-accent: #0071E3;
    --stream-hover: rgba(0, 113, 227, 0.04);
}

.activity-stream {
    background: var(--stream-bg);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.stream-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--stream-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stream-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--stream-text);
    margin: 0;
}

.stream-filter {
    display: flex;
    gap: 8px;
}

.filter-btn {
    padding: 6px 12px;
    border: 1px solid var(--stream-border);
    border-radius: 20px;
    background: transparent;
    font-size: 12px;
    color: var(--stream-text-light);
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    border-color: var(--stream-accent);
    color: var(--stream-accent);
}

.filter-btn.active {
    background: var(--stream-accent);
    border-color: var(--stream-accent);
    color: white;
}

.stream-content {
    max-height: none;
    overflow-y: visible;
    padding: 8px 0;
}

.stream-content::-webkit-scrollbar {
    width: 6px;
}

.stream-content::-webkit-scrollbar-track {
    background: transparent;
}

.stream-content::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

/* ===== Gitee 原生提交历史列表 ===== */
.gitee-commit-group {
    margin-bottom: 0;
}

.gitee-commit-date {
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--stream-text);
    background: rgba(0, 0, 0, 0.025);
    border-bottom: 1px solid var(--stream-border);
    border-top: 1px solid var(--stream-border);
}

.gitee-commit-date:first-child {
    border-top: none;
}

.gitee-commit-row {
    display: flex;
    flex-direction: column;
    padding: 10px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    cursor: pointer;
    transition: background 0.15s ease;
}

.gitee-commit-row:hover {
    background: var(--stream-hover);
}

.gitee-commit-row:last-child {
    border-bottom: none;
}

.gitee-commit-main {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 3px;
}

.gitee-commit-sha {
    font-family: 'SF Mono', 'Menlo', 'Monaco', 'Consolas', monospace;
    font-size: 12px;
    color: var(--stream-accent);
    text-decoration: none;
    background: rgba(0, 113, 227, 0.06);
    padding: 1px 6px;
    border-radius: 4px;
    flex-shrink: 0;
    white-space: nowrap;
    transition: background 0.15s;
    letter-spacing: 0.5px;
}

.gitee-commit-sha:hover {
    background: rgba(0, 113, 227, 0.15);
}

.gitee-commit-msg {
    font-size: 13px;
    color: var(--stream-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.5;
}

.gitee-commit-sub {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--stream-text-light);
    padding-left: 0;
}

.gitee-commit-author-avatar {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.gitee-commit-author {
    font-weight: 500;
    color: var(--stream-text);
}

.gitee-commit-time {
    color: var(--stream-text-light);
}

.gitee-commit-repo {
    color: var(--stream-text-light);
    text-decoration: none;
    font-size: 11px;
    transition: color 0.15s;
}

.gitee-commit-repo:hover {
    color: var(--stream-accent);
    text-decoration: underline;
}

/* 保留旧样式作为其他区域使用 */
.activity-item {
    display: flex;
    align-items: flex-start;
    padding: 12px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    cursor: pointer;
    transition: background 0.15s ease;
}

.activity-item:hover {
    background: var(--stream-hover);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-right: 12px;
    overflow: hidden;
    background: #F5F5F7;
}

.activity-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--stream-text-light);
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin-bottom: 4px;
}

.activity-user {
    font-size: 13px;
    font-weight: 600;
    color: var(--stream-text);
}

.activity-action {
    font-size: 13px;
    color: var(--stream-text-light);
}

.activity-target {
    font-size: 13px;
    color: var(--stream-accent);
    font-weight: 500;
}

.activity-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.activity-time {
    font-size: 11px;
    color: var(--stream-text-light);
}

.activity-desc {
    font-size: 12px;
    color: var(--stream-text-light);
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.activity-icon {
    font-size: 18px;
    flex-shrink: 0;
    margin-left: 12px;
    opacity: 0.6;
}

.stream-loading {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    gap: 8px;
}

.stream-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 113, 227, 0.2);
    border-top-color: var(--stream-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.stream-loading span {
    font-size: 12px;
    color: var(--stream-text-light);
}

.stream-load-more {
    display: block;
    text-align: center;
    padding: 16px;
    font-size: 13px;
    border-top: 1px solid var(--stream-border);
}

.stream-more-btn {
    padding: 8px 32px;
    border: 1px solid var(--stream-border);
    border-radius: 8px;
    background: var(--stream-bg);
    color: var(--stream-accent);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.stream-more-btn:hover {
    background: var(--stream-hover);
    border-color: var(--stream-accent);
}

.stream-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--stream-text-light);
}

.stream-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.stream-empty p {
    margin: 0;
    font-size: 14px;
}

.stream-retry-btn {
    margin-top: 16px;
    padding: 8px 24px;
    border: 1px solid var(--stream-border);
    border-radius: 6px;
    background: var(--stream-card-bg);
    color: var(--stream-text);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.stream-retry-btn:hover {
    border-color: var(--stream-accent);
    color: var(--stream-accent);
}

@media (max-width: 768px) {
    .stream-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .stream-filter {
        flex-wrap: wrap;
    }

    .activity-item {
        padding: 12px 16px;
    }

    .activity-target {
        font-size: 12px;
    }

    .activity-desc {
        max-width: 200px;
    }
}

/* ===== Gitee 原生个人主页动态流（/activity-stream） ===== */
.gitee-feed {
    background: var(--stream-bg, #ffffff);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.feed-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--stream-border, #e5e5ea);
}

.feed-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--stream-text, #1D1D1F);
    margin: 0;
}

.feed-filter-current {
    font-size: 13px;
    color: var(--stream-text-light, #6E6E73);
    background: rgba(0, 0, 0, 0.04);
    padding: 4px 12px;
    border-radius: 14px;
}

.feed-content {
    padding: 0;
}

.feed-date-group {
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.feed-date-group:last-child {
    border-bottom: none;
}

.feed-date {
    padding: 12px 20px 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--stream-text, #1D1D1F);
    background: rgba(0, 0, 0, 0.015);
}

.feed-item {
    display: flex !important;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    transition: background 0.15s ease;
    align-items: flex-start !important;
}

.feed-item:last-child {
    border-bottom: none;
}

.feed-item:hover {
    background: rgba(0, 0, 0, 0.015);
}

.feed-avatar {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    max-width: 36px !important;
    max-height: 36px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    flex-shrink: 0;
    background: #f5f5f7;
}

.feed-avatar-ph {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: var(--stream-accent, #0071E3);
}

.feed-body {
    flex: 1 !important;
    min-width: 0 !important;
}

.feed-line {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 4px;
}

.feed-actor {
    font-size: 14px;
    font-weight: 600;
    color: var(--stream-accent, #0071E3);
    text-decoration: none;
}

.feed-actor:hover {
    text-decoration: underline;
}

.feed-action {
    font-size: 14px;
    color: var(--stream-text-light, #6E6E73);
}

.feed-time {
    font-size: 12px;
    color: var(--stream-text-light, #6E6E73);
    margin-left: auto;
}

.feed-target {
    font-size: 13px;
    color: var(--stream-text-light, #6E6E73);
    margin-bottom: 6px;
}

.feed-repo,
.feed-branch {
    color: var(--stream-accent, #0071E3);
    text-decoration: none;
}

.feed-repo:hover,
.feed-branch:hover {
    text-decoration: underline;
}

.feed-target-sep {
    color: var(--stream-text-light, #6E6E73);
}

.feed-commits {
    margin-top: 6px;
    border-left: 2px solid rgba(0, 0, 0, 0.08);
    padding-left: 12px;
}

.feed-commit {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 4px 0;
}

.feed-commit-sha {
    font-family: 'SF Mono', 'Menlo', 'Monaco', 'Consolas', monospace;
    font-size: 12px;
    color: var(--stream-accent, #0071E3);
    background: rgba(0, 113, 227, 0.06);
    padding: 1px 6px;
    border-radius: 4px;
    text-decoration: none;
    flex-shrink: 0;
    white-space: nowrap;
    letter-spacing: 0.5px;
}

.feed-commit-sha:hover {
    background: rgba(0, 113, 227, 0.15);
}

.feed-commit-msg {
    font-size: 13px;
    color: var(--stream-text, #1D1D1F);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.5;
}

/* 折叠/展开提交 */
.feed-commits-collapsible .feed-commit-hidden {
    display: none;
}

.feed-commits-collapsible.feed-commits-expanded .feed-commit-hidden {
    display: flex;
}

.feed-commits-toggle {
    margin-top: 4px;
    font-size: 12px;
    color: var(--stream-accent, #0071E3);
    cursor: pointer;
    user-select: none;
}

.feed-commits-toggle:hover {
    text-decoration: underline;
}

.feed-commits-toggle .toggle-expanded {
    display: none;
}

.feed-commits-expanded .feed-commits-toggle .toggle-collapsed {
    display: none;
}

.feed-commits-expanded .feed-commits-toggle .toggle-expanded {
    display: inline;
}

/* 加载 / 分页 / 空 */
.feed-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px;
}

.feed-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(0, 113, 227, 0.2);
    border-top-color: var(--stream-accent, #0071E3);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.feed-loading span {
    font-size: 13px;
    color: var(--stream-text-light, #6E6E73);
}

.feed-loading-more {
    text-align: center;
    padding: 12px;
    color: var(--stream-text-light, #6E6E73);
    font-size: 13px;
}

.feed-load-more {
    text-align: center;
    padding: 16px;
    border-top: 1px solid var(--stream-border, #e5e5ea);
}

.feed-more-btn {
    padding: 8px 32px;
    border: 1px solid var(--stream-border, #e5e5ea);
    border-radius: 8px;
    background: #fff;
    color: var(--stream-accent, #0071E3);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.feed-more-btn:hover {
    background: rgba(0, 113, 227, 0.04);
    border-color: var(--stream-accent, #0071E3);
}

.feed-end {
    color: var(--stream-text-light, #6E6E73);
    font-size: 12px;
}

.feed-empty {
    text-align: center;
    padding: 60px 20px;
}

.feed-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.feed-empty p {
    margin: 0 0 16px;
    font-size: 14px;
    color: var(--stream-text-light, #6E6E73);
}

.feed-retry-btn {
    padding: 8px 24px;
    border: 1px solid var(--stream-border, #e5e5ea);
    border-radius: 6px;
    background: #fff;
    color: var(--stream-text, #1D1D1F);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.feed-retry-btn:hover {
    border-color: var(--stream-accent, #0071E3);
    color: var(--stream-accent, #0071E3);
}

@media (max-width: 768px) {
    .feed-header {
        padding: 14px 16px;
    }

    .feed-date {
        padding: 10px 16px 6px;
    }

    .feed-item {
        padding: 12px 16px;
    }

    .feed-time {
        margin-left: 0;
        flex-basis: 100%;
    }

    .feed-commits {
        padding-left: 8px;
    }
}