/* 全局样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    padding: 20px;
    background: #f5f5f5;
    margin: 0;
    overflow-x: hidden;
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 0 20px;
    margin-bottom: 30px;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.user-button {
    padding: 10px 24px;
    border: 2px solid #ccc;
    border-radius: 20px;
    background: white;
    color: #333;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    flex-shrink: 0; /* 防止按钮在 flex 布局中被压缩 */
}

/* 桌面端样式 (768px以上) */
@media (min-width: 769px) {
    .timeline-container {
        display: block;
        background: white;
        border-radius: 12px;
        padding: 30px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.08);
        overflow-x: auto;
    }

    #feed-view {
        display: none;
    }

    .tooltip {
        position: fixed;
        background: rgba(0,0,0,0.85);
        color: white;
        padding: 8px 12px;
        border-radius: 6px;
        font-size: 14px;
        pointer-events: none;
        white-space: pre-line;
        z-index: 10000;
    }

    #timeline {
        overflow: visible;
    }

    .status-line {
        stroke-width: 3;
    }

    .date-marker {
        font-size: 12px;
        fill: #999;
        text-anchor: middle;
        user-select: none;
    }

    foreignObject img {
        user-select: none;
        pointer-events: none;
    }
}

/* 移动端样式 (768px以下) */
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 20px;
        padding: 0;
    }

    .user-button {
        margin-bottom: 1rem;
    }

    .timeline-container {
        display: none;
    }

    #feed-view {
        display: block;
        max-width: 600px;
        margin: 0 auto;
    }

    .feed-card {
        background: white;
        border-radius: 12px;
        margin-bottom: 1.5rem;
        box-shadow: 0 4px 12px rgba(0,0,0,0.08);
        overflow: hidden;
    }

    .feed-card .game-header {
        width: 100%;
        aspect-ratio: 460 / 215;
        object-fit: cover;
    }

    .feed-card .content { padding: 1rem 1.5rem; }
    .feed-card .header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 0.25rem;
    }
    .feed-card .status-name {
        font-size: 1.25rem;
        font-weight: 600;
        display: flex;
        align-items: center;
    }
    .feed-card .status-dot {
        width: 12px;
        height: 12px;
        border-radius: 50%;
        margin-right: 10px;
    }
    .feed-card .time {
        font-size: 0.9rem;
        color: #6c757d;
    }
    .feed-card .duration {
        color: #007bff;
        font-weight: 500;
    }
}

/* 新的通知横幅样式 */
#notification-area {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
    display: flex;
    justify-content: center;
    pointer-events: none; /* 允许点击穿透容器 */
}

.notification-banner {
    position: relative;
    top: -150px; /* 初始位置在屏幕外 */
    max-width: 420px;
    width: calc(100% - 40px);
    margin-top: 20px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    opacity: 0;
    transition: top 0.6s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.6s ease;
    cursor: pointer;
    pointer-events: all; /* 恢复 banner 的点击事件 */
}

.notification-banner.show {
    top: 0; /* 滑入到屏幕内 */
    opacity: 1;
}

.notification-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.notification-icon img {
    width: 100%;
    height: 100%;
    border-radius: 12px;
}

.notification-content {
    flex-grow: 1;
}

.notification-title {
    font-weight: 600;
    font-size: 1rem;
    color: #333;
    margin: 0 0 4px 0;
}

.notification-body {
    font-size: 0.9rem;
    color: #555;
    margin: 0;
}

.notification-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0,0,0,0.1);
    border: none;
    color: #888;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background 0.2s;
}

.notification-close:hover {
    background: rgba(0,0,0,0.2);
}

/* 加载动画 */
.loader {
    display: none;
    justify-content: center;
    align-items: center;
    padding: 4rem;
}
.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #aaa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}