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

body, html {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    height: 100vh;
    width: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.header {
    background: #4A90E2;
    color: white;
    padding: 10px 20px;
    text-align: center;
    flex-shrink: 0;
    width: 100%;
}

.header h1 {
    font-size: 18px;
    font-weight: 600;
}

.toolbar {
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    flex-wrap: wrap;
    width: 100%;
}

.btn {
    padding: 8px 16px;
    background: #4A90E2;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.btn:hover {
    background: #357ABD;
}

.btn.active {
    background: #2c5e8a;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    font-size: 14px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ccc;
}

.status-dot.connected {
    background: #4caf50;
}

.status-dot.error {
    background: #f44336;
}

.main-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.sidebar {
    width: 0;
    min-width: 0;
    background: #2c3e50;
    color: white;
    flex-shrink: 0;
    overflow: hidden;
    transition: width 0.3s ease;
}

.sidebar.expanded {
    width: 280px;
    min-width: 280px;
    overflow-y: auto;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar li {
    padding: 10px 16px;
    cursor: pointer;
    border-bottom: 1px solid #34495e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px;
    line-height: 1.4;
}

.sidebar li:hover,
.sidebar li.active {
    background: #34495e;
}

.sidebar li.active {
    background: #4A90E2;
}

.sidebar li .table-cn {
    display: block;
    font-size: 11px;
    color: #aab7c4;
    margin-top: 2px;
}

.sidebar li.active .table-cn {
    color: #e0e0e0;
}

.sidebar li .empty-tag {
    display: inline-block;
    background: #999;
    color: white;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 3px;
    margin-top: 4px;
}

.sidebar li.empty-table {
    opacity: 0.6;
}

.sidebar li.empty-table:hover {
    opacity: 1;
}

.sidebar li.inaccessible-table {
    opacity: 0.5;
}

.sidebar li .inaccessible-tag {
    display: inline-block;
    background: #e74c3c;
    color: white;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 3px;
    margin-top: 4px;
}

.sidebar li .schema-tag {
    display: inline-block;
    background: #9b59b6;
    color: white;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 3px;
    margin-right: 4px;
}

.sidebar li .fav-icon {
    cursor: pointer;
    margin-right: 4px;
    font-size: 14px;
    opacity: 0.5;
}

.sidebar li .fav-icon:hover {
    opacity: 1;
}

.sidebar li .fav-icon.favorited {
    opacity: 1;
}

.sidebar li:hover,
.sidebar li.active {
    background: #34495e;
}

.sidebar li.active {
    background: #4A90E2;
}

.sidebar li.loading {
    color: #999;
    cursor: default;
}

.content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #ffffff;
}

.welcome {
    text-align: center;
    color: #666;
    padding: 40px;
}

.welcome h2 {
    color: #333;
    margin-bottom: 10px;
}

.welcome p {
    margin: 5px 0;
}

.welcome strong {
    color: #4A90E2;
    font-size: 20px;
}

.table-detail h3 {
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #4A90E2;
}

.table-detail h4 {
    color: #555;
    margin: 20px 0 10px;
}

.info-grid {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.info-card {
    background: #f8f9fa;
    padding: 12px 20px;
    border-radius: 6px;
    border-left: 4px solid #4A90E2;
}

.info-card .label {
    display: block;
    font-size: 12px;
    color: #888;
    margin-bottom: 4px;
}

.info-card .value {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.table-wrapper {
    overflow-x: auto;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

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

th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
    font-size: 13px;
}

tr:hover {
    background: #f8f9fa;
}

.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.overview-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.overview-card:hover {
    border-color: #4A90E2;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.2);
}

.overview-card .table-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    word-break: break-all;
}

.overview-card .table-cn {
    font-size: 12px;
    color: #888;
    margin-bottom: 8px;
}

.overview-card .row-count {
    font-size: 24px;
    color: #4A90E2;
    font-weight: bold;
}

.overview-card .row-label {
    font-size: 12px;
    color: #888;
}

.chart-container {
    margin: 15px 0;
}

.bar-chart {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bar-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bar-label {
    width: 80px;
    font-size: 13px;
    color: #555;
}

.bar-wrapper {
    flex: 1;
    height: 24px;
    background: #e8e8e8;
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4A90E2, #5BA3F5);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.bar-value {
    width: 50px;
    text-align: right;
    font-size: 13px;
    font-weight: 600;
    color: #4A90E2;
}

#analysisContent .info-grid {
    margin-bottom: 25px;
}

#analysisContent .info-card:nth-child(1) {
    border-left-color: #4A90E2;
}

#analysisContent .info-card:nth-child(2) {
    border-left-color: #5BA3F5;
}

#analysisContent .info-card:nth-child(3) {
    border-left-color: #50C878;
}

#analysisContent .info-card:nth-child(4) {
    border-left-color: #FFA500;
}

#analysisContent .info-card:nth-child(5) {
    border-left-color: #9B59B6;
}
