* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

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

.header {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.header h1 {
    color: #333;
    font-size: 32px;
    margin-bottom: 5px;
}

.header .subtitle {
    color: #666;
    font-size: 16px;
}

.header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.search-filter-bar {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
}

.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.filter-label {
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

.tag-filter {
    padding: 6px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    background: white;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s;
}

.tag-filter:hover {
    border-color: #667eea;
    color: #667eea;
}

.tag-filter.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.sort-options {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 15px;
    flex-wrap: wrap;
}

.sort-btn {
    padding: 8px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s;
}

.sort-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.sort-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card .label {
    color: #888;
    font-size: 14px;
    margin-bottom: 8px;
}

.stat-card .value {
    color: #333;
    font-size: 28px;
    font-weight: bold;
}

.groups-container {
    display: grid;
    gap: 20px;
}

.group-card {
    background: white;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.group-card:hover {
    transform: translateY(-3px);
}

.group-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.group-header .icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    margin-right: 15px;
}

.group-header .info {
    flex: 1;
}

.group-header .name {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.group-header .username {
    color: #667eea;
    font-size: 14px;
}

.group-header .count {
    background: #667eea;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
}

.messages {
    display: grid;
    gap: 15px;
}

.message {
    background: #f9f9f9;
    border-radius: 12px;
    padding: 20px;
    border-left: 4px solid #667eea;
    transition: all 0.3s;
    position: relative;
}

.message:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
    background: #f5f5f5;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 10px;
}

.message-sender {
    font-weight: bold;
    color: #333;
    font-size: 16px;
}

.message-date {
    color: #888;
    font-size: 14px;
}

.message-text {
    color: #555;
    line-height: 1.8;
    margin-bottom: 12px;
    word-wrap: break-word;
    max-height: 150px;
    overflow: hidden;
    position: relative;
    transition: max-height 0.3s ease;
}

.message-text.expanded {
    max-height: none;
}

.message-text.collapsed::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(transparent, #f9f9f9);
    display: block;
    pointer-events: none;
}

/* Markdown 样式 */
.message-text h1,
.message-text h2,
.message-text h3,
.message-text h4,
.message-text h5,
.message-text h6 {
    margin: 16px 0 8px 0;
    font-weight: bold;
    color: #333;
}

.message-text h1 { font-size: 1.5em; }
.message-text h2 { font-size: 1.3em; }
.message-text h3 { font-size: 1.1em; }

.message-text p {
    margin: 8px 0;
}

.message-text ul,
.message-text ol {
    margin: 8px 0;
    padding-left: 24px;
}

.message-text li {
    margin: 4px 0;
}

.message-text code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #e83e8c;
}

.message-text pre {
    background: #f4f4f4;
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 12px 0;
}

.message-text pre code {
    background: none;
    padding: 0;
    color: #333;
}

.message-text blockquote {
    border-left: 4px solid #667eea;
    padding-left: 16px;
    margin: 12px 0;
    color: #666;
    font-style: italic;
}

.message-text a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.message-text a:hover {
    text-decoration: underline;
    color: #5568d3;
}

.message-text strong {
    font-weight: bold;
    color: #333;
}

.message-text em {
    font-style: italic;
}

.message-text hr {
    border: none;
    border-top: 1px solid #ddd;
    margin: 16px 0;
}

.message-text table {
    border-collapse: collapse;
    width: 100%;
    margin: 12px 0;
}

.message-text table th,
.message-text table td {
    border: 1px solid #ddd;
    padding: 8px 12px;
    text-align: left;
}

.message-text table th {
    background: #f8f8f8;
    font-weight: bold;
}

.expand-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s;
    font-weight: 500;
}

.expand-btn:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.expand-btn:active {
    transform: translateY(0);
}

.message-footer {
    display: flex;
    gap: 20px;
    color: #888;
    font-size: 14px;
    flex-wrap: wrap;
}

.message-footer .item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.message-footer .icon {
    font-size: 16px;
}

.job-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.job-tag {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 5px 14px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.job-tag:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.loading {
    text-align: center;
    padding: 50px;
    color: white;
    font-size: 18px;
}

.loading-spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error {
    background: #ff4444;
    color: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 20px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state .icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-results {
    background: white;
    border-radius: 16px;
    padding: 60px 20px;
    text-align: center;
    color: #666;
}

.highlight,
mark.highlight {
    background: yellow;
    padding: 2px 4px;
    border-radius: 3px;
    color: #333;
    font-weight: 500;
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 24px;
    }

    .stats {
        grid-template-columns: 1fr;
    }

    .group-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .search-box {
        flex-direction: column;
    }

    .filter-tags {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* 分页控件样式 */
.pagination {
    margin: 40px 0;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.pagination-info {
    color: #666;
    font-size: 14px;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.page-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    min-width: 40px;
}

.page-btn:hover:not(.disabled):not(.active) {
    background: #f5f5f5;
    border-color: #667eea;
    color: #667eea;
}

.page-btn.active {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
}

.page-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-ellipsis {
    padding: 0 8px;
    color: #999;
}

.pagination-jump {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.pagination-jump input {
    width: 60px;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
}

.pagination-jump input:focus {
    outline: none;
    border-color: #667eea;
}

@media (max-width: 768px) {
    .pagination-controls {
        gap: 4px;
    }
    
    .page-btn {
        padding: 6px 12px;
        font-size: 12px;
        min-width: 36px;
    }
    
    .pagination-jump {
        flex-wrap: wrap;
        justify-content: center;
    }
}

