/* Global Styles */
:root {
    --primary-color: #3b82f6;
    --primary-dark: #1e40af;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --text-dark: #1f2937;
    --text-gray: #6b7280;
    --border-color: #e5e7eb;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-dark);
    background-color: var(--bg-light);
    line-height: 1.6;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 40px 0;
    margin-bottom: 40px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 32px;
    margin-bottom: 10px;
}

header p {
    font-size: 16px;
    opacity: 0.9;
}

/* Main */
main {
    min-height: 60vh;
    margin-bottom: 40px;
}

/* Footer */
footer {
    background-color: var(--bg-white);
    border-top: 1px solid var(--border-color);
    padding: 20px 0;
    text-align: center;
    color: var(--text-gray);
    margin-top: 40px;
}

/* Timeline Container */
.timeline-container h2 {
    margin-bottom: 30px;
    font-size: 24px;
}

/* Category Tabs */
.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
    padding: 10px;
    background-color: var(--bg-white);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tab-button {
    padding: 10px 20px;
    background-color: var(--bg-light);
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    transition: all 0.2s ease;
}

.tab-button:hover {
    background-color: #e0e7ff;
    border-color: var(--primary-color);
}

.tab-button.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Category Content */
.category-content {
    display: none;
}

.category-content.active {
    display: block;
}

.timeline {
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--primary-color);
}

.timeline-date {
    margin-bottom: 40px;
    padding-left: 60px;
    position: relative;
}

.timeline-date::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--primary-color);
    border: 3px solid var(--bg-light);
}

.date-header {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
}

.posts-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.posts-table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--bg-white);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.posts-table thead {
    background-color: #f0f4f8;
    border-bottom: 2px solid var(--border-color);
}

.posts-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
}

.posts-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
}

.posts-table tbody tr:hover {
    background-color: #fafbfc;
}

.title-column {
    width: 40%;
}

.summary-column {
    width: 60%;
    color: var(--text-dark);
    font-size: 14px;
    line-height: 1.5;
}

.post-title-link {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 600;
    display: block;
    margin-bottom: 6px;
    transition: color 0.3s;
}

.post-title-link:hover {
    color: var(--primary-color);
}

.post-id {
    color: var(--text-gray);
    font-size: 12px;
}

.post-author {
    color: var(--text-gray);
    font-size: 12px;
    margin-top: 4px;
}

.post-meta {
    color: var(--text-gray);
    font-size: 14px;
    margin-top: 10px;
}

.category-badge {
    display: inline-block;
    background-color: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    margin-right: 8px;
}

.reply-count {
    display: inline-block;
    color: var(--text-gray);
    font-size: 12px;
    margin-left: 8px;
}

.forum-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.forum-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Post Detail */
.post-detail {
    background-color: var(--bg-white);
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.post-header {
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.post-header h2 {
    margin-bottom: 10px;
    font-size: 28px;
}

.post-header .post-id {
    color: var(--text-gray);
    font-size: 14px;
}

/* Sections */
.summary-section,
.original-section {
    margin-bottom: 32px;
}

.summary-section {
    margin-top: 20px;
}

.summary-section h3,
.original-section h3 {
    margin-bottom: 12px;
    font-size: 18px;
    color: var(--primary-color);
}

.summary-content {
    padding: 20px;
    background-color: var(--bg-light);
    border-left: 4px solid var(--primary-color);
    border-radius: 4px;
    line-height: 1.6;
}

.summary-content h1,
.summary-content h2,
.summary-content h3,
.summary-content h4,
.summary-content h5,
.summary-content h6 {
    margin: 12px 0 8px 0;
    color: var(--primary-color);
    font-weight: 600;
}

.summary-content p {
    margin: 8px 0;
}

.summary-content ul,
.summary-content ol {
    margin: 8px 0 8px 20px;
    padding-left: 20px;
}

.summary-content li {
    margin: 4px 0;
    line-height: 1.5;
}

.summary-content code {
    background-color: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.summary-content pre {
    background-color: #f5f5f5;
    padding: 12px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 12px 0;
}

.summary-content pre code {
    background-color: transparent;
    padding: 0;
}

.original-content {
    padding: 20px;
    background-color: var(--bg-light);
    border-left: 4px solid var(--secondary-color);
    border-radius: 4px;
    line-height: 1.8;
    font-size: 16px;
}

.original-content p {
    margin: 8px 0;
}

.original-content .reply-divider {
    margin: 16px 0 12px 0;
    padding: 8px 0;
    border-bottom: 1px dashed var(--border-color);
    color: var(--text-gray);
    font-size: 14px;
}

/* Post Footer */
.post-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.btn-back {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--text-gray);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s;
}

.btn-back:hover {
    background-color: var(--text-dark);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background-color: var(--bg-white);
    border-radius: 8px;
    color: var(--text-gray);
}

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

    .posts-table {
        font-size: 14px;
    }

    .posts-table th,
    .posts-table td {
        padding: 12px;
    }

    .post-title {
        min-width: 200px;
    }

    .post-summary {
        display: none;
    }

    .post-detail {
        padding: 20px;
    }

    .post-header h2 {
        font-size: 20px;
    }
}
