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

html, body {
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 40px auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

h1 {
    color: #2c3e50;
    margin-bottom: 10px;
}

h2 {
    color: #34495e;
    margin: 20px 0 10px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

th, td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
    white-space: nowrap;
}

th {
    background-color: #f8f9fa;
    font-weight: 600;
}

tr:hover {
    background-color: #f8f9fa;
}

.empty {
    color: #999;
    font-style: italic;
    margin-top: 10px;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.pagination button {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.pagination button:hover:not(:disabled) {
    background: #e9ecef;
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination button.active {
    background: #2c3e50;
    color: #fff;
    border-color: #2c3e50;
}

.page-info {
    font-size: 14px;
    color: #666;
    margin-right: 8px;
}

/* ========== Split Pane Layout ========== */

.split-wrapper {
    display: flex;
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
}

.split-left {
    flex: 1 1 100%;
    overflow-y: auto;
    transition: flex 0.3s ease;
}

.split-left.shrink {
    flex: 0 0 55%;
    min-width: 480px;
}

.split-right {
    flex: 0 0 0%;
    overflow: hidden;
    border-left: 1px solid #e0e0e0;
    background: #fff;
    transition: flex 0.3s ease;
}

.split-right.open {
    flex: 0 0 45%;
}

/* ========== Analysis Panel ========== */

.analysis-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
}

.analysis-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
    flex-shrink: 0;
}

.analysis-title {
    font-size: 15px;
    font-weight: 600;
    color: #2c3e50;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.analysis-close {
    width: 28px;
    height: 28px;
    border: none;
    background: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.analysis-close:hover {
    background: #e9ecef;
    color: #333;
}

.analysis-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    font-size: 14px;
    line-height: 1.7;
}

/* ========== Analysis Button ========== */

.btn-analysis {
    padding: 3px 10px;
    font-size: 12px;
    border: 1px solid #3498db;
    background: #fff;
    color: #3498db;
    border-radius: 3px;
    cursor: pointer;
    white-space: nowrap;
}

.btn-analysis:hover {
    background: #3498db;
    color: #fff;
}

.text-muted {
    color: #ccc;
    font-size: 12px;
}

/* ========== Active Row Highlight ========== */

tr.row-active {
    background-color: #e8f4fd !important;
}

tr.row-active td {
    border-bottom-color: #bee5f7;
}

/* ========== Markdown Content Styles ========== */

.analysis-body h1 {
    font-size: 20px;
    margin: 20px 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #eee;
}

.analysis-body h1:first-child {
    margin-top: 0;
}

.analysis-body h2 {
    font-size: 17px;
    margin: 18px 0 8px;
    color: #2c3e50;
}

.analysis-body h3 {
    font-size: 15px;
    margin: 14px 0 6px;
    color: #34495e;
}

.analysis-body p {
    margin: 8px 0;
}

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

.analysis-body li {
    margin: 4px 0;
}

.analysis-body strong {
    color: #2c3e50;
}

.analysis-body hr {
    border: none;
    border-top: 1px solid #eee;
    margin: 16px 0;
}

.analysis-body table {
    margin: 10px 0;
    font-size: 13px;
}

.analysis-body blockquote {
    margin: 10px 0;
    padding: 8px 14px;
    border-left: 3px solid #3498db;
    background: #f8f9fa;
    color: #555;
}
