/* 分类选择器样式 */
.category-selector {
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.category-levels {
    display: flex;
    min-height: 300px;
    max-height: 400px;
    width: 100%;
    overflow-x: auto;
}

.category-level {
    min-width: 200px;
    flex-shrink: 0;
    border-right: 1px solid #e0e6ed;
    display: flex;
    flex-direction: column;
}

.category-level:last-child {
    border-right: none;
}

.level-header {
    padding: 12px 16px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e6ed;
    display: flex;
    align-items: center;
    font-weight: 500;
    font-size: 0.9rem;
}

.level-header i {
    margin-right: 8px;
    font-size: 1rem;
}

.level-content {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    /* 增强触摸体验 */
    min-height: 44px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.category-item:hover {
    background: #f8f9fa;
    border-left-color: #dee2e6;
}

.category-item.selected {
    background: #e3f2fd;
    border-left-color: #2196f3;
    color: #1976d2;
    font-weight: 500;
}

.category-item.selected .category-arrow {
    color: #2196f3;
}

.category-name {
    flex: 1;
    line-height: 1.4;
    word-break: break-word;
}

.category-arrow {
    color: #6c757d;
    font-size: 0.8rem;
    transition: color 0.2s ease;
    margin-left: 8px;
    flex-shrink: 0;
}

.loading-placeholder,
.error-message,
.empty-message {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #6c757d;
    font-size: 0.9rem;
}

.error-message {
    color: #dc3545;
}

.empty-message {
    color: #adb5bd;
}

.selected-path {
    padding: 12px 16px;
    background: #f8f9fa;
    border-top: 1px solid #e0e6ed;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    min-height: 48px;
}

.path-label {
    font-weight: 500;
    color: #495057;
    margin-right: 8px;
    flex-shrink: 0;
}

.path-content {
    flex: 1;
    color: #6c757d;
    line-height: 1.4;
    word-break: break-word;
}



/* 滚动条样式 */
.level-content::-webkit-scrollbar {
    width: 6px;
}

.level-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.level-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.level-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.category-level {
    animation: fadeIn 0.3s ease;
}

/* 选择器容器样式 */
.category-selector-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
    padding: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.category-selector-modal.show {
    opacity: 1;
}

.category-selector-modal .category-selector-dialog {
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.category-selector-modal.show .category-selector-dialog {
    transform: scale(1);
}

.category-selector-dialog {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    width: 850px;
    max-width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.category-selector-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e0e6ed;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.category-selector-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.category-selector-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.category-selector-close:hover {
    background: #f8f9fa;
}

.category-selector-body {
    padding: 0;
    flex: 1;
    overflow: hidden;
}

/* 智能匹配区域样式 */
.suggested-categories {
    padding: 20px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    flex-shrink: 0;
}

.suggested-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.suggested-title {
    font-weight: 600;
    color: #495057;
    margin-right: 8px;
}

.suggested-subtitle {
    font-size: 0.875rem;
    color: #6c757d;
}

.suggested-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.suggested-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    font-size: 0.875rem;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.suggested-tag:hover {
    background-color: #e3f2fd;
    border-color: #2196f3;
    color: #1976d2;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(33, 150, 243, 0.2);
}

.suggested-tag.active {
    background-color: #2196f3;
    border-color: #2196f3;
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(33, 150, 243, 0.3);
}

.suggested-tag.active:hover {
    background-color: #1976d2;
    border-color: #1976d2;
}

.category-selector-footer {
    padding: 16px 20px;
    border-top: 1px solid #e0e6ed;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-shrink: 0;
}

.category-selector-footer .btn {
    min-height: 44px;
    padding: 10px 20px;
    font-size: 0.95rem;
    border-radius: 6px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* 响应式设计 - 平板设备 */
@media (max-width: 1024px) {
    .category-selector-dialog {
        width: 100%;
        max-width: 800px;
        margin: 0 10px;
    }
    
    .category-levels {
        max-height: 350px;
    }
    
    .category-level {
        min-width: 180px;
    }
}

/* 响应式设计 - 移动端设备 */
@media (max-width: 768px) {
    .category-selector-modal {
        padding: 0;
        align-items: flex-end;
    }
    
    .category-selector-modal .category-selector-dialog {
        transform: translateY(100%);
        transition: transform 0.3s ease;
    }
    
    .category-selector-modal.show .category-selector-dialog {
        transform: translateY(0);
    }
    
    .category-selector-dialog {
        width: 100%;
        max-width: 100%;
        max-height: 85vh;
        border-radius: 12px 12px 0 0;
        margin: 0;
    }
    
    .category-selector-header {
        padding: 16px 16px;
        position: relative;
    }
    
    .category-selector-title {
        font-size: 1.05rem;
        text-align: center;
        flex: 1;
    }
    
    .category-selector-close {
        position: absolute;
        right: 16px;
        top: 50%;
        transform: translateY(-50%);
    }
    
    .category-levels {
        flex-direction: column;
        max-height: none;
        overflow-x: visible;
    }
    
    .category-level {
        min-width: auto;
        border-right: none;
        border-bottom: 1px solid #e0e6ed;
        flex-shrink: 0;
        transition: all 0.3s ease;
    }
    
    .category-level:last-child {
        border-bottom: none;
    }
    
    /* 折叠状态样式 */
    .category-level.collapsed {
        flex-shrink: 0;
    }
    
    .category-level.collapsed .level-content {
        max-height: 0;
        overflow: hidden;
        padding: 0;
        border: none;
    }
    
    .category-level.collapsed .level-header {
        background: #e3f2fd;
        border-left: 3px solid #2196f3;
    }
    
    /* 活跃状态样式 */
    .category-level.active {
        flex: 1;
    }
    
    .category-level.active .level-content {
        flex: 1;
        max-height: calc(70vh - 120px); /* 为活跃级别分配更多空间 */
    }
    
    .category-level.active .level-header {
        background: #f8f9fa;
        border-left: 3px solid #28a745;
    }
    
    .level-header {
        padding: 14px 16px;
        font-size: 0.95rem;
        background: #f8f9fa;
        position: sticky;
        top: 0;
        z-index: 10;
        display: flex;
        align-items: center;
        justify-content: space-between;
        cursor: pointer;
        transition: all 0.3s ease;
    }
    
    .level-header-content {
        display: flex;
        align-items: center;
        flex: 1;
    }
    

    
    .level-toggle-icon {
        color: #6c757d;
        font-size: 0.9rem;
        transition: transform 0.3s ease;
        flex-shrink: 0;
    }
    
    .level-header.clickable:hover {
        background: #e9ecef;
    }
    
    .level-header.clickable:active {
        background: #dee2e6;
    }
    
    /* 折叠动画 */
    .category-level .level-content {
        opacity: 1;
        transform: translateY(0);
        transition: all 0.3s ease;
    }
    
    .category-level.collapsed .level-content {
        opacity: 0;
        transform: translateY(-10px);
    }
    
    /* 改善视觉层次 */
    .category-level.collapsed {
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        border-radius: 4px;
        margin: 2px 0;
    }
    
    .category-level.active {
        box-shadow: 0 2px 8px rgba(40, 167, 69, 0.15);
        border-radius: 4px;
        margin: 4px 0;
    }
    
    /* 折叠状态下的选中文本样式 */
    .level-selected-text {
        color: #1976d2;
        font-weight: 600;
        background: rgba(33, 150, 243, 0.1);
        padding: 2px 6px;
        border-radius: 3px;
        margin-left: 8px;
    }
    
    .level-content {
        max-height: 200px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        transition: max-height 0.3s ease, padding 0.3s ease;
    }
    
    .category-item {
        padding: 14px 16px;
        font-size: 0.95rem;
        min-height: 48px;
        border-left: none;
        border-bottom: 1px solid transparent;
    }
    
    .category-item:hover {
        background: #f8f9fa;
        border-left-color: transparent;
    }
    
    .category-item.selected {
        background: #e3f2fd;
        border-left-color: transparent;
        border-bottom-color: #2196f3;
        border-bottom-width: 2px;
    }
    
    .category-name {
        font-size: 0.95rem;
    }
    
    .category-arrow {
        font-size: 0.9rem;
    }
    
    .selected-path {
        padding: 16px;
        font-size: 0.9rem;
        min-height: 52px;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .path-label {
        width: 100%;
        margin-bottom: 4px;
    }
    
    .path-content {
        width: 100%;
        font-size: 0.9rem;
        color: #495057;
        font-weight: 500;
    }
    
    .category-selector-footer {
        padding: 16px;
        gap: 10px;
        flex-direction: row;
    }
    
    .category-selector-footer .btn {
        flex: 1;
        min-height: 48px;
        font-size: 1rem;
        font-weight: 500;
    }
    
    .category-selector-footer .btn-cancel {
        flex: 0.6;
    }
    
    .category-selector-footer .btn-confirm {
        flex: 1;
    }
    
    /* 移动端智能匹配标签样式 */
    .suggested-categories {
        padding: 16px;
    }
    
    .suggested-header {
        margin-bottom: 10px;
    }
    
    .suggested-title {
        font-size: 0.9rem;
    }
    
    .suggested-subtitle {
        font-size: 0.8rem;
    }
    
    .suggested-tags {
        gap: 6px;
    }
    
    .suggested-tag {
        padding: 8px 12px;
        font-size: 0.8rem;
        min-height: 36px;
        border-radius: 18px;
    }
}

/* 超小屏幕设备适配 */
@media (max-width: 480px) {
    .category-selector-dialog {
        max-height: 90vh;
    }
    
    .category-selector-header {
        padding: 14px;
    }
    
    .category-selector-title {
        font-size: 1rem;
    }
    
    .level-header {
        padding: 12px 14px;
        font-size: 0.9rem;
    }
    
    .category-item {
        padding: 12px 14px;
        font-size: 0.9rem;
        min-height: 44px;
    }
    
    .selected-path {
        padding: 14px;
        font-size: 0.85rem;
    }
    
    .category-selector-footer {
        padding: 14px;
    }
    
    .category-selector-footer .btn {
        min-height: 44px;
        font-size: 0.95rem;
    }
    
    .level-content {
        max-height: 180px;
    }
}

/* 横屏模式适配 */
@media (max-height: 600px) and (orientation: landscape) {
    .category-selector-dialog {
        max-height: 95vh;
    }
    
    .level-content {
        max-height: 120px;
    }
    
    .selected-path {
        padding: 10px 16px;
        min-height: 40px;
    }
    
    .category-selector-footer {
        padding: 12px 16px;
    }
    
    .category-selector-footer .btn {
        min-height: 40px;
        padding: 8px 16px;
    }
}

/* 改善滚动体验 */
@media (max-width: 768px) {
    .level-content::-webkit-scrollbar {
        width: 3px;
    }
    
    .level-content::-webkit-scrollbar-thumb {
        background: #bbb;
        border-radius: 2px;
    }
    
    /* iOS样式优化 */
    .level-content {
        scroll-behavior: smooth;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .category-selector {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .level-header {
        background: #1a202c;
        color: #e2e8f0;
        border-color: #4a5568;
    }
    
    .category-item {
        color: #e2e8f0;
    }
    
    .category-item:hover {
        background: #4a5568;
    }
    
    .category-item.selected {
        background: #2b6cb0;
        color: #bee3f8;
    }
    
    .selected-path {
        background: #1a202c;
        border-color: #4a5568;
    }
    
    .path-label,
    .path-content {
        color: #e2e8f0;
    }
    
    .category-selector-dialog {
        background: #2d3748;
    }
    
    .category-selector-header {
        border-color: #4a5568;
    }
    
    .category-selector-title {
        color: #e2e8f0;
    }
    
    .category-selector-close {
        color: #a0aec0;
    }
    
    .category-selector-close:hover {
        background: #4a5568;
    }
    
    .category-selector-footer {
        border-color: #4a5568;
    }
    
    /* 深色模式智能匹配标签样式 */
    .suggested-categories {
        background: #1a202c;
        border-color: #4a5568;
    }
    
    .suggested-title {
        color: #e2e8f0;
    }
    
    .suggested-subtitle {
        color: #a0aec0;
    }
    
    .suggested-tag {
        background-color: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .suggested-tag:hover {
        background-color: #2b6cb0;
        border-color: #3182ce;
        color: #bee3f8;
    }
    
    .suggested-tag.active {
        background-color: #3182ce;
        border-color: #3182ce;
        color: #ffffff;
    }
    
    .suggested-tag.active:hover {
        background-color: #2c5282;
        border-color: #2c5282;
    }
} 