body {
    background-color: #f5f5f5;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    color: #333;
    padding-bottom: 60px;
}

.main-container {
    max-width: 960px;
}

.navbar-brand {
    font-size: 1.4rem;
}

.navbar .nav-link {
    font-size: 0.95rem;
}

.navbar .btn-outline-light {
    padding: 0.375rem 0.75rem;
    margin-left: 0.5rem;
}

.sort-tabs {
    display: flex;
    gap: 1rem;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 0.5rem;
}

.sort-link {
    color: #6c757d;
    text-decoration: none;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    transition: color 0.2s;
}

.sort-link:hover {
    color: #0d6efd;
}

.sort-link.active {
    color: #0d6efd;
    border-bottom: 2px solid #0d6efd;
    margin-bottom: -0.5rem;
    padding-bottom: 0.75rem;
}

.post-list {
    background-color: #fff;
    border-radius: 0.5rem;
    border: 1px solid #e9ecef;
    overflow: hidden;
}

.post-thumbnail {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    border-radius: 0.375rem;
    overflow: hidden;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
    font-size: 1.2rem;
    background-color: #f8f9fa;
}

.thumb-video-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    background: linear-gradient(135deg, #6f42c1 0%, #0d6efd 100%);
}

.post-media {
    margin-top: 1rem;
    text-align: center;
}

.post-image {
    max-width: 100%;
    border-radius: 0.5rem;
}

.post-video {
    max-width: 100%;
    max-height: 500px;
    border-radius: 0.5rem;
}

.post-item {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

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

.post-item:hover {
    background-color: #fafafa;
}

.vote-box {
    min-width: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.vote-btn {
    background: none;
    border: none;
    color: #adb5bd;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.2s;
    line-height: 1;
}

.vote-btn:hover:not([disabled]) {
    color: #dc3545;
}

.vote-btn.voted {
    color: #dc3545;
}

.vote-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.vote-btn-large {
    font-size: 1.8rem;
    padding: 0.5rem;
}

.vote-count {
    font-size: 1rem;
    font-weight: bold;
    color: #dc3545;
}

.vote-count-large {
    font-size: 1.4rem;
    margin: 0.25rem 0;
}

.post-content {
    min-width: 0;
}

.post-title {
    font-size: 1.1rem;
    margin-bottom: 0.4rem;
    line-height: 1.4;
    font-weight: 600;
}

.post-title a {
    color: #1a1a1a;
    text-decoration: none;
}

.post-title a:hover {
    color: #0d6efd;
}

.post-meta {
    font-size: 0.85rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.post-meta a {
    text-decoration: none;
}

.post-meta a:hover {
    text-decoration: underline;
}

.category-badge {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    font-weight: 500;
    background-color: #6f42c1 !important;
}

.source-domain {
    font-style: italic;
}

.post-detail-card {
    background-color: #fff;
    border-radius: 0.5rem;
    border: 1px solid #e9ecef;
    padding: 1.5rem;
}

.post-detail-title {
    font-size: 1.6rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    font-weight: 700;
    color: #1a1a1a;
}

.post-content-body {
    font-size: 1rem;
    line-height: 1.8;
    color: #333;
    padding: 1rem;
    background-color: #fafafa;
    border-radius: 0.375rem;
    margin-top: 1rem;
    white-space: pre-wrap;
}

.comment-item {
    transition: background-color 0.2s;
}

.comment-card {
    border: 1px solid #e9ecef;
    background-color: #fff;
}

.comment-card:hover {
    border-color: #dee2e6;
}

.avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: bold;
    flex-shrink: 0;
}

.avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: bold;
    flex-shrink: 0;
    object-fit: cover;
    background-color: #0d6efd;
    color: #fff;
}

.avatar-circle-large {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: bold;
    flex-shrink: 0;
    object-fit: cover;
    background-color: #0d6efd;
    color: #fff;
}

.avatar-nav {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    vertical-align: middle;
    flex-shrink: 0;
}

.avatar-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.comment-content {
    font-size: 0.95rem;
    line-height: 1.6;
    word-break: break-word;
}

.comment-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.comment-vote-btn {
    color: #6c757d;
    font-size: 0.85rem;
    padding: 0.125rem 0.375rem;
}

.comment-vote-btn:hover:not([disabled]) {
    color: #0d6efd;
}

.comment-vote-btn.voted {
    color: #0d6efd;
}

.comment-vote-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.reply-toggle-btn {
    color: #6c757d;
    font-size: 0.85rem;
    padding: 0.125rem 0.375rem;
}

.reply-toggle-btn:hover {
    color: #0d6efd;
}

.reply-form {
    padding-left: 44px;
}

.footer {
    border-top: 1px solid #e9ecef;
    font-size: 0.85rem;
}

.alert {
    margin-bottom: 1rem;
}

.card {
    border: 1px solid #e9ecef;
}

.form-control:focus,
.form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
}

.page-link {
    color: #0d6efd;
}

.page-item.active .page-link {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.dropdown-item:active {
    background-color: #0d6efd;
}

.active-tab {
    color: #0d6efd;
    border-bottom: 2px solid #0d6efd;
    font-weight: 500;
}

@media (max-width: 768px) {
    .main-container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .post-item {
        padding: 0.75rem;
    }

    .post-title {
        font-size: 1rem;
    }

    .post-meta {
        font-size: 0.75rem;
        gap: 0.5rem;
    }

    .vote-box {
        min-width: 40px;
    }

    .post-thumbnail {
        width: 40px;
        height: 40px;
    }

    .thumb-placeholder {
        font-size: 1rem;
    }

    .thumb-video-icon {
        font-size: 1.2rem;
    }

    .post-detail-title {
        font-size: 1.3rem;
    }

    .post-detail-card {
        padding: 1rem;
    }

    .navbar-brand {
        font-size: 1.2rem;
    }
}
