.sgda-container {
    max-width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    color: #202124;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
}

.sgda-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid #e8e8e8;
    flex-wrap: wrap;
    background: #fafafa;
}

.sgda-breadcrumb {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    flex-wrap: wrap;
}

.sgda-breadcrumb-item {
    color: #1a73e8;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
}

.sgda-breadcrumb-item:hover {
    background: #e8f0fe;
}

.sgda-breadcrumb-current {
    font-weight: 600;
    color: #202124;
    padding: 2px 6px;
}

.sgda-breadcrumb-sep {
    display: inline-flex;
    vertical-align: middle;
}

.sgda-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.sgda-search {
    position: relative;
}

.sgda-search input {
    padding: 5px 32px 5px 10px;
    border: 1px solid #ddd;
    border-radius: 16px;
    font-size: 13px;
    width: 160px;
    outline: none;
    background: #fff;
    transition: all 0.2s;
}

.sgda-search input:focus {
    border-color: #1a73e8;
    width: 200px;
}

.sgda-search-icon {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    pointer-events: none;
}

#sgda-type-filter {
    padding: 5px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    outline: none;
    background: #fff;
    cursor: pointer;
}

.sgda-view-toggle {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.sgda-view-btn {
    background: #fff;
    border: none;
    padding: 4px 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.15s;
    line-height: 1;
}

.sgda-view-btn:hover {
    background: #f1f3f4;
}

.sgda-view-btn.active {
    background: #1a73e8;
    color: #fff;
}

.sgda-view-btn.active svg {
    fill: #fff;
}

.sgda-body {
    display: flex;
    min-height: 350px;
}

.sgda-sidebar {
    width: 220px;
    flex-shrink: 0;
    border-right: 1px solid #e8e8e8;
    background: #fafafa;
    padding: 8px 0;
    overflow-y: auto;
}

.sgda-sidebar-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: #80868b;
    padding: 6px 16px 8px;
    letter-spacing: 0.5px;
}

.sgda-tree-root {
    font-weight: 600;
}

.sgda-tree-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 16px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.1s;
}

.sgda-tree-item:hover {
    background: #e8f0fe;
}

.sgda-tree-item.active {
    background: #d2e3fc;
    font-weight: 500;
}

.sgda-tree-icon {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    line-height: 1;
}

.sgda-tree-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sgda-main {
    flex: 1;
    min-width: 0;
}

.sgda-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 50px 20px;
    gap: 10px;
}

.sgda-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #e0e0e0;
    border-top-color: #1a73e8;
    border-radius: 50%;
    animation: sgda-spin 0.6s linear infinite;
}

@keyframes sgda-spin {
    to { transform: rotate(360deg); }
}

/* List View */
.sgda-list {
    width: 100%;
}

.sgda-list-row {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.1s;
}

.sgda-list-row:last-child {
    border-bottom: none;
}

.sgda-list-row:hover {
    background: #f8f9fa;
}

.sgda-list-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.sgda-list-icon {
    width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
}

.sgda-list-name {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
}

.sgda-list-date {
    color: #80868b;
    font-size: 13px;
    white-space: nowrap;
    margin-left: 16px;
    flex-shrink: 0;
}

/* Grid View */
.sgda-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    padding: 16px;
}

.sgda-grid-card {
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 20px 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.sgda-grid-card:hover {
    border-color: #1a73e8;
    box-shadow: 0 1px 4px rgba(26,115,232,0.1);
}

.sgda-grid-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
    line-height: 1;
}

.sgda-grid-name {
    font-weight: 500;
    font-size: 13px;
    line-height: 1.3;
    word-break: break-word;
    margin-bottom: 6px;
}

.sgda-grid-date {
    font-size: 11px;
    color: #999;
}

/* Upload area */
.sgda-upload {
    padding: 0 16px 12px;
}

.sgda-upload-area {
    border: 2px dashed #d0d0d0;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #fafafa;
}

.sgda-upload-area:hover,
.sgda-upload-area.sgda-dragover {
    border-color: #1a73e8;
    background: #e8f0fe;
}

.sgda-upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.sgda-upload-icon {
    display: flex;
    align-items: center;
}

.sgda-upload-text {
    margin: 0;
    font-size: 13px;
    color: #666;
}

.sgda-upload-progress {
    padding: 12px 0;
}

.sgda-upload-progress-bar {
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
}

.sgda-upload-progress-fill {
    height: 100%;
    width: 0%;
    background: #1a73e8;
    transition: width 0.3s;
}

.sgda-upload-status {
    margin: 6px 0 0;
    font-size: 12px;
    color: #666;
}

/* Thumbnails */
.sgda-thumb {
    display: block;
    object-fit: cover;
    border-radius: 2px;
}

.sgda-grid-icon .sgda-thumb {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    margin: 0 auto;
}

/* Empty & Error */
.sgda-empty {
    text-align: center;
    padding: 50px 20px;
    color: #999;
}

.sgda-empty-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
}

.sgda-empty p {
    margin: 0;
    font-size: 14px;
}

.sgda-error {
    padding: 10px 16px;
    color: #c62828;
    font-size: 13px;
}

/* Responsive */
@media (max-width: 768px) {
    .sgda-body {
        flex-direction: column;
    }

    .sgda-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e8e8e8;
        max-height: 150px;
        overflow-y: auto;
    }

    .sgda-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .sgda-controls {
        justify-content: flex-end;
    }

    .sgda-search input,
    .sgda-search input:focus {
        width: 130px;
    }

    .sgda-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 8px;
        padding: 12px;
    }

    .sgda-grid-card {
        padding: 14px 10px 10px;
    }
}
