/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #1a1a1a;
    background-color: #f7f9fc;
}

/* 应用容器 */
.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 头部样式 */
.app-header {
    background-color: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

/* 连接状态样式 */
.connection-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #666;
    padding: 0.5rem 0.75rem;
    background: #f8f9fa;
    border-radius: 2rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #ffd700;
    transition: background-color 0.3s ease;
}

.status-dot.connected {
    background-color: #10b981;
}

.status-dot.disconnected {
    background-color: #ef4444;
}

/* 统计信息 */
.stats {
    display: flex;
    gap: 1rem;
}

.stat-item {
    background: #f8f9fa;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-label {
    font-size: 0.75rem;
    color: #666;
}

.stat-value {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a1a;
}

/* 主要内容区域 */
.app-main {
    flex: 1;
    padding: 1.5rem;
}

.content-container {
    max-width: 800px;
    margin: 0 auto;
}

/* 推文容器样式 */
.tweets-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* 推文卡片样式 */
.tweet {
    background-color: #ffffff;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: tweet-appear 0.3s ease-out;
}

@keyframes tweet-appear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tweet:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.tweet-header {
    margin-bottom: 1rem;
}

.tweet-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.username {
    font-weight: 600;
    color: #1a1a1a;
}

.user-note {
    color: #666;
    font-size: 0.875rem;
}

.timestamp {
    color: #666;
    font-size: 0.75rem;
    margin-left: auto;
}

.tweet-body {
    margin-bottom: 1rem;
}

.tweet-content {
    font-size: 1rem;
    color: #1a1a1a;
    margin-bottom: 1rem;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow: hidden;
}

.tweet-content img {
    max-width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    border-radius: 0.5rem;
    margin: 0.5rem 0;
    display: block;
}

/* 图片容器样式 */
.tweet-media {
    position: relative;
    margin: 0.5rem 0;
    border-radius: 0.5rem;
    overflow: hidden;
    background: #f8f9fa;
}

.tweet-media img {
    max-width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* 大图预览功能 */
.tweet-media.expandable {
    cursor: pointer;
}

.tweet-media.expandable::after {
    content: "点击查看大图";
    position: absolute;
    bottom: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-top-left-radius: 0.5rem;
}

.tweet-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.tweet-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #2563eb;
    text-decoration: none;
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    background: #f0f7ff;
    transition: background-color 0.2s ease;
}

.tweet-link:hover {
    background: #e0f2fe;
}

.link-icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* 分析结果样式 */
.analysis-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
}

.analysis-content {
    font-size: 0.875rem;
    color: #1a1a1a;
    margin-bottom: 0.75rem;
    white-space: pre-wrap;
}

.analysis-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 500;
    background: #f3f4f6;
    color: #666;
    transition: all 0.2s ease;
}

.analysis-tag.web3 {
    background: #ecfdf5;
    color: #059669;
}

.analysis-tag.non-web3 {
    background: #f3f4f6;
    color: #666;
}

/* 图片加载动画 */
.tweet-media img {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tweet-media img.loaded {
    opacity: 1;
}

/* 图片加载中状态 */
.tweet-media {
    min-height: 100px;
    background: linear-gradient(110deg, #eff1f3 8%, #e2e4e7 18%, #eff1f3 33%);
    background-size: 200% 100%;
    animation: 1.5s shine linear infinite;
}

@keyframes shine {
    to {
        background-position-x: -200%;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .app-header {
        padding: 1rem;
    }

    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .header-left {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 0.75rem;
    }

    .stats {
        margin-top: 0.5rem;
    }

    .app-main {
        padding: 1rem;
    }

    .tweet {
        padding: 1rem;
    }

    .tweet-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .timestamp {
        margin-left: 0;
    }
}

/* 星星评分样式 */
.star-rating {
    display: inline-block;
    font-size: 1.1em;
    letter-spacing: 2px;
}

.star-rating .star-filled {
    color: #ffd700;
}

.star-rating .star-empty {
    color: #e5e7eb;
}