/* (Your style.css content remains exactly the same as before) */

:root {
    --bg-color: #1a1e26;
    --panel-bg: #222831;
    --text-color: #E0E0E0;
    --primary-color: #4A6A8C;
    --accent-color: #6AB7B7;
    --border-color: #39404A;
    --node-fill-default: #3E8E7E;
    --node-fill-root: #C88E3E;
    --node-stroke: #E0E0E0;
    --link-stroke-default: #5E7A8A;
    --link-stroke-active: var(--accent-color);
    --hover-bg: #30363F;
    --button-bg: var(--primary-color);
    --button-hover-bg: #5B7F9F;
    --error-color: #D65A5A;
    --panel-width: 320px;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --font-size-base: 0.95rem;
    --font-size-sm: 0.8rem;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    overflow: hidden;
    font-family: 'Inter', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    box-sizing: border-box;
    line-height: 1.6;
    font-size: var(--font-size-base);
}

body {
    display: flex;
    flex-direction: row;
}

button:focus, input:focus, a:focus, select:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 3px;
    box-shadow: 0 0 0 0.15rem rgba(106, 183, 183, 0.5);
}

#settingsPanel {
    width: var(--panel-width);
    height: 100%;
    background: var(--panel-bg);
    padding: var(--spacing-lg);
    z-index: 1000;
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    border-right: 1px solid var(--border-color);
}

#settingsPanel h2 {
    font-size: 1.6rem;
    color: var(--accent-color);
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    font-weight: 500;
}

.form-label {
    color: var(--text-color);
    font-size: var(--font-size-base);
    margin-bottom: var(--spacing-sm);
}
.form-control, .form-select {
    background-color: var(--bg-color) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-color) !important;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3) !important;
    padding: 0.6rem 0.8rem;
}
.form-control::placeholder {
    color: #8899A6 !important;
    opacity: 0.8;
}
.form-control:focus, .form-select:focus {
    border-color: var(--accent-color) !important;
    box-shadow: 0 0 0 0.25rem rgba(106, 183, 183, 0.25) !important;
}
.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23E0E0E0' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3csvg%3e") !important;
}

.btn-primary {
    background-color: var(--button-bg) !important;
    border: none !important;
    color: white !important;
    padding: 0.6rem var(--spacing-md);
    font-weight: 500;
    transition: background-color 0.2s ease, transform 0.1s ease !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}
.btn-primary:hover {
    background-color: var(--button-hover-bg) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}
.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.view-buttons {
    margin-top: var(--spacing-lg);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: var(--spacing-md);
}
.view-buttons .btn {
    padding: 0.7rem var(--spacing-md);
}

#mainContent {
    flex-grow: 1;
    position: relative;
    overflow: hidden;
    height: 100%;
    width: 100%;
    min-width: 0;
    background: var(--bg-color);
}

#tree, #table {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    overflow: auto;
    padding: var(--spacing-lg);
    box-sizing: border-box;
}

#tree svg {
    width: 100%;
    height: 100%;
    display: block;
}

.node circle {
    fill: var(--node-fill-default);
    stroke: var(--node-stroke);
    stroke-width: 1.5px;
    transition: fill 0.2s ease, stroke-width 0.2s ease;
}

.node.root-node circle {
    fill: var(--node-fill-root);
}

.node.virtual-root circle {
    fill: var(--primary-color);
}

.node:hover circle, .node.hovered circle {
    fill: var(--accent-color);
    stroke-width: 2.5px;
}

.node text {
    fill: var(--text-color);
    font-size: var(--font-size-sm);
    pointer-events: none;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
    transition: fill 0.2s ease;
}
.node text:last-of-type {
     fill: #A0A9B5;
     font-size: 0.75rem;
}
.node:hover text, .node.hovered text {
    fill: white;
}

.node image {
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.node:hover image, .node.hovered image {
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.6);
    transform: scale(1.02);
}

.link {
    stroke: var(--link-stroke-default);
    stroke-width: 1.5px;
    fill: none;
    transition: stroke 0.2s ease, stroke-width 0.2s ease;
}
.link.active {
    stroke: var(--link-stroke-active);
    stroke-width: 3px;
}

.table-container {
    width: 100%;
    height: 100%;
    overflow: auto;
    border-radius: 8px;
    background: var(--panel-bg);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}
.table {
    border-collapse: collapse;
    font-size: var(--font-size-base);
    color: var(--text-color);
    margin-bottom: 0;
}
.table th, .table td {
    padding: var(--spacing-md);
    border: 1px solid var(--border-color) !important;
    text-align: left;
    vertical-align: middle;
}
.table thead th {
    background: var(--primary-color) !important;
    position: sticky;
    top: 0;
    color: white !important;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: 0.02em;
}
.table-striped tbody tr:nth-of-type(odd) {
    background-color: var(--bg-color) !important;
}
.table-hover tbody tr:hover {
    background: var(--hover-bg) !important;
}
.table td a {
    color: var(--accent-color) !important;
    text-decoration: none !important;
    transition: color 0.2s ease, text-decoration 0.2s ease;
}
.table td a:hover {
    text-decoration: underline !important;
    color: var(--node-fill-default) !important;
}

#error {
    color: var(--error-color);
    margin-top: var(--spacing-md);
    font-weight: 600;
    text-align: center;
    padding: var(--spacing-sm);
    border-radius: 4px;
    background-color: rgba(214, 90, 90, 0.1);
}

#loading-spinner {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 6px solid rgba(255, 255, 255, 0.2);
    border-top: 6px solid var(--accent-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    z-index: 1002;
}

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

@media (max-width: 768px) {
    :root { --panel-width: 100%; }
    body { flex-direction: column; overflow-y: auto; }
    #settingsPanel {
        position: relative; width: 100%; height: auto; box-shadow: none;
        border-bottom: 1px solid var(--border-color); padding-bottom: var(--spacing-md);
    }
    #mainContent {
        margin-left: 0; height: auto; flex-grow: 1; min-height: 50vh;
    }
    #tree, #table {
        position: relative; padding: var(--spacing-md);
    }
    .node text { font-size: 0.7rem; }
    .node text:last-of-type { font-size: 0.65rem; }
    .node image { width: 64px; height: 48px; transform: translate(-32px, -53px); }
    .node circle { r: 6px; }
    .table th, .table td { padding: 0.6rem; font-size: var(--font-size-sm); }
}