    .ai-search-container {
        max-width: 1200px;
        margin: 20px auto 60px auto; /* 하단 여백 추가 */
        padding: 16px;
        min-height: calc(100vh - 200px); /* 최소 높이 설정으로 푸터 밀어내기 */
    }

    .ai-search-hero-section {
        text-align: center;
        background: white;
        border-radius: 20px;
        color: BLACK;
        position: relative;
        overflow: hidden;
        padding: 20px;
    }

    .ai-search-hero-section::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(10px);
    }

    .ai-search-hero-content {
        position: relative;
        z-index: 1;
    }

    .ai-search-hero-title {
        font-family: 'Inter', sans-serif;
        font-size: 2.2rem;
        font-weight: 700;
        margin-bottom: 8px;
        background: linear-gradient(45deg,rgb(0, 0, 0),rgb(207, 218, 255));
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        line-height: 1.1;
    }

    .ai-search-hero-subtitle {
        font-family: 'Inter', sans-serif;
        font-size: 1rem;
        font-weight: 400;
        opacity: 0.95;
        max-width: 600px;
        margin: 0 auto;
        line-height: 1.5;
    }

    .ai-search-card {
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(20px);
        border-radius: 24px;
        padding: 32px;
        /* box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1); */
        border: 1px solid rgba(255, 255, 255, 0.2);
        margin-bottom: 32px;
        transition: all 0.3s ease;
    }

    .ai-search-form {
        position: relative;
        margin-bottom: 1px;
    }



    /* 기존 탭 스타일 숨김 */
    .ai-search-tabs {
        display: none;
    }

    .ai-search-tab {
        flex: 1;
        min-width: 90px;
        padding: 8px 10px;
        border: none;
        background: transparent;
        border-radius: 50px;
        cursor: pointer;
        font-family: 'Inter', sans-serif;
        font-size: 12px;
        font-weight: 500;
        color: #64748b;
        transition: all 0.3s ease;
        position: relative;
        white-space: nowrap;
        text-align: center;
    }

    .ai-search-tab.active {
        background: white;
        color: #1e293b;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        font-weight: 600;
    }

    .ai-search-tab:hover:not(.active) {
        color: #475569;
        background: rgba(255, 255, 255, 0.5);
    }

    .ai-search-tab:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        color: #94a3b8;
    }

    .ai-search-tab:disabled:hover {
        background: transparent;
        color: #94a3b8;
    }

    .ai-search-tab i {
        margin-right: 5px;
        font-size: 11px;
    }

    /* 검색 타입별 설명 텍스트 */
    .ai-search-mode-desc {
        text-align: center;
        margin-bottom: 12px;
        padding: 6px 12px;
        border-radius: 8px;
        font-size: 12px;
        font-family: 'Inter', sans-serif;
        background: rgba(248, 250, 252, 0.6);
        color: #64748b;
        max-width: 600px;
        margin: 0 auto 12px auto;
    }

    .ai-search-mode-desc.deepseek {
        border-left: 4px solid #10b981;
    }

    .ai-search-mode-desc.gpt4o {
        border-left: 4px solid #667eea;
    }

    .ai-search-mode-desc.gemini {
        border-left: 4px solid #4285f4;
    }

    .ai-search-mode-desc.notebook {
        border-left: 4px solid #34a853;
    }

    .ai-search-mode-desc.reasoning {
        border-left: 4px solid #8b5cf6;
    }

    /* 노트북LM 바로가기 버튼 스타일 - 탭과 같은 행에 배치 */
    .notebook-shortcut-btn {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 10px 16px;
        background: linear-gradient(135deg, #22c55e, #3b82f6);
        color: white;
        border: none;
        border-radius: 50px;
        font-family: 'Inter', sans-serif;
        font-size: 13px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
        text-decoration: none;
        white-space: nowrap;
        text-align: center;
        min-width: 110px;
    }

    .notebook-shortcut-btn:hover {
        transform: scale(1.05);
        box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
        background: linear-gradient(135deg, #16a34a, #2563eb);
        color: white;
        text-decoration: none;
    }

    .notebook-shortcut-btn i {
        font-size: 14px;
    }

    /* 태블릿에서 위치 조정 */
    @media (max-width: 1024px) {
        .ai-search-tabs {
            max-width: 700px;
            flex-wrap: wrap;
            gap: 4px;
        }
        
        .ai-search-tab {
            font-size: 12px;
            padding: 8px 12px;
            min-width: 100px;
        }

        .notebook-shortcut-btn {
            font-size: 12px;
            padding: 8px 14px;
            min-width: 100px;
        }
    }

    /* 반응형 디자인 */
    @media (max-width: 768px) {
        .ai-search-container {
            margin: 8px auto 30px auto;
            padding: 10px;
            min-height: calc(100vh - 140px);
        }

        .ai-search-hero-section {
            padding: 12px 8px;
        }

        .ai-search-hero-title {
            font-size: 1.6rem;
        }

        .ai-search-hero-subtitle {
            font-size: 0.85rem;
        }

        .ai-search-card {
            padding: 12px;
        }

        /* 모바일에서는 탭 숨기고 셀렉트박스 표시 */
        .ai-search-tabs {
            display: none !important;
        }

        .ai-search-mode-desc {
            display: none !important;
        }

        .ai-search-mobile-select {
            display: block !important;
        }

        .ai-search-input {
            padding: 10px 14px !important;
            font-size: 16px !important;
        }

        .ai-search-btn {
            width: 40px;
            height: 40px;
        }

        .ai-search-btn i {
            font-size: 14px;
        }

        .ai-search-source-badge {
            padding: 4px 6px;
            width: 24px;
            height: 24px;
            justify-content: center;
            margin-right: 4px;
            border-radius: 50%;
        }

        .ai-search-source-badge .badge-text {
            display: none;
        }

        .ai-search-source-badge i {
            font-size: 12px;
        }

        .ai-search-result-header {
            flex-wrap: wrap;
            align-items: flex-start;
        }

        .ai-search-result-title {
            font-size: 13px;
            line-height: 1.3;
        }

        .ai-search-result-content {
            font-size: 11px;
            line-height: 1.4;
        }

        .ai-search-result-section {
            padding: 10px;
            margin-bottom: 6px;
        }

        /* 모바일에서 뉴스 결과 특별 처리 */
        .mobile-news-section {
            display: block;
            margin: 10px 0;
            padding: 12px;
        }

        .mobile-news-section h3 {
            font-size: 14px;
            margin-bottom: 8px;
        }

        .mobile-news-item {
            padding: 8px;
            margin-bottom: 4px;
        }

        .mobile-news-item-title {
            font-size: 12px;
        }

        .mobile-news-item-snippet {
            font-size: 10px;
        }

        /* 로딩 인디케이터 모바일 최적화 */
        .ai-search-loading-container {
            width: 70px;
            height: 70px;
            margin-bottom: 12px;
        }

        .ai-search-loading-text {
            font-size: 11px;
        }

        .ai-progress-container {
            width: 120px;
            margin: 8px auto;
        }

        /* 모바일용 AI 도구 체크박스 최적화 */
        .ai-search-tools-container {
            margin: 12px 0;
            padding: 8px 12px;
            border-radius: 8px;
        }

        .tools-checkbox-label {
            gap: 8px;
        }

        .tools-checkbox-custom {
            width: 16px;
            height: 16px;
        }

        .tools-checkbox-text {
            font-size: 12px;
        }

        .tools-checkbox-text i {
            font-size: 14px;
        }

        .tools-info-badge {
            width: 16px;
            height: 16px;
            font-size: 9px;
        }
    }

    @media (max-width: 480px) {
        .ai-search-container {
            margin: 6px auto 20px auto;
            padding: 8px;
            min-height: calc(100vh - 120px);
        }

        .ai-search-hero-title {
            font-size: 1.4rem;
        }

        .ai-search-hero-subtitle {
            font-size: 0.8rem;
        }

        .ai-search-card {
            padding: 8px;
        }

        /* 초소형 모바일에서도 셀렉트박스 사용 */
        .ai-search-tabs {
            display: none !important;
        }

        .ai-search-mode-desc {
            display: none !important;
        }

        .ai-search-mobile-select {
            display: none !important; /* GPT 전용에서는 선택 박스 완전 숨김 */
        }
        


        .ai-search-input {
            padding: 8px 12px !important;
            font-size: 16px !important;
        }

        .ai-search-btn {
            width: 36px;
            height: 36px;
        }

        .ai-search-btn i {
            font-size: 12px;
        }

        .ai-search-source-badge {
            padding: 3px;
            width: 20px;
            height: 20px;
            margin-right: 3px;
        }

        .ai-search-source-badge i {
            font-size: 10px;
        }

        .ai-search-result-section {
            padding: 8px;
            margin-bottom: 4px;
        }

        .ai-search-result-title {
            font-size: 12px;
        }

        .ai-search-result-content {
            font-size: 10px;
        }

        .ai-search-loading-container {
            width: 60px;
            height: 60px;
            margin-bottom: 8px;
        }

        .ai-search-loading-text {
            font-size: 10px;
        }

        .ai-progress-container {
            width: 100px;
            margin: 6px auto;
        }

        /* 초소형 모바일 AI 도구 체크박스 */
        .ai-search-tools-container {
            margin: 8px 0;
            padding: 6px 8px;
        }

        .tools-checkbox-custom {
            width: 14px;
            height: 14px;
        }

        .tools-checkbox-text {
            font-size: 11px;
        }

        .tools-checkbox-text i {
            font-size: 12px;
        }

        .tools-info-badge {
            width: 14px;
            height: 14px;
            font-size: 8px;
        }
    }

    /* PC용 검색 결과 그리드 레이아웃 */
    @media (min-width: 1043px) {
        .search-results-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 16px; /* 간격 줄임 */
            margin-bottom: 16px; /* 여백 줄임 */
        }
        
        .search-results-column {
            background: rgba(248, 250, 252, 0.8);
            border-radius: 12px; /* 둥근 모서리 줄임 */
            padding: 16px; /* 패딩 줄임 */
            border: 1px solid rgba(226, 232, 240, 0.5);
        }
        
        .search-results-column h3 {
            font-family: 'Inter', sans-serif;
            font-size: 16px; /* 크기 줄임 */
            font-weight: 700;
            margin: 0 0 12px 0; /* 여백 줄임 */
            color: #1e293b;
            display: flex;
            align-items: center;
            gap: 6px; /* 간격 줄임 */
        }
        
        .search-results-column.daum h3 {
            color: #3574e0; /* 다음 파란색 유지 */
        }
        
        .search-results-column.naver h3 {
            color: #03c75a; /* 네이버 녹색 유지 */
        }
        
        .news-section {
            grid-column: 1 / -1;
            background: linear-gradient(135deg, rgba(156, 39, 176, 0.1), rgba(233, 30, 99, 0.1));
            border-radius: 12px; /* 둥근 모서리 줄임 */
            padding: 20px; /* 패딩 줄임 */
            border: 1px solid rgba(156, 39, 176, 0.2);
            margin-top: 16px; /* 여백 줄임 */
        }
        
        .news-section h3 {
            font-family: 'Inter', sans-serif;
            font-size: 18px; /* 크기 줄임 */
            font-weight: 700;
            margin: 0 0 16px 0; /* 여백 줄임 */
            color: #9c27b0;
            display: flex;
            align-items: center;
            gap: 8px; /* 간격 줄임 */
        }
        
        .news-items {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* 최소 너비 줄임 */
            gap: 12px; /* 간격 줄임 */
        }
        
        .news-item {
            background: rgba(255, 255, 255, 0.8);
            padding: 14px; /* 패딩 줄임 */
            border-radius: 10px; /* 둥근 모서리 줄임 */
            border-left: 3px solid #9c27b0; /* 테두리 줄임 */
            transition: all 0.3s ease;
        }
        
        .news-item:hover {
            background: rgba(255, 255, 255, 0.95);
            transform: translateY(-1px); /* 이동 거리 줄임 */
            box-shadow: 0 3px 10px rgba(156, 39, 176, 0.15); /* 그림자 줄임 */
        }
        
        .news-item-title {
            font-weight: 600;
            margin-bottom: 6px; /* 여백 줄임 */
            line-height: 1.3; /* 줄간격 줄임 */
            font-size: 14px; /* 크기 줄임 */
        }
        
        .news-item-title a {
            color: #1e293b;
            text-decoration: none;
        }
        
        .news-item-title a:hover {
            color: #9c27b0;
        }
        
        .news-item-snippet {
            color: #64748b;
            font-size: 12px; /* 크기 줄임 */
            line-height: 1.4; /* 줄간격 줄임 */
            margin-bottom: 6px; /* 여백 줄임 */
        }
        
        .news-item-date {
            color: #9c27b0;
            font-size: 10px; /* 크기 줄임 */
            font-weight: 500;
        }
        
        /* 컬럼 내 결과 아이템 스타일 조정 */
        .search-results-column .ai-search-result-section {
            background: rgba(255, 255, 255, 0.6);
            margin-bottom: 10px; /* 여백 줄임 */
            padding: 12px; /* 패딩 줄임 */
            border-radius: 8px; /* 둥근 모서리 줄임 */
        }
        
        .search-results-column .ai-search-result-section:hover {
            background: rgba(255, 255, 255, 0.9);
        }
        
        /* PC에서 AI 분석 결과 패딩 최적화 */
        .ai-search-result-section {
            padding: 18px; /* 패딩 조정 */
        }
    }

    /* 🎯 태블릿용 뉴스 섹션 (1042px 이하) */
    @media (max-width: 1042px) and (min-width: 769px) {
        .news-section {
            background: linear-gradient(135deg, rgba(156, 39, 176, 0.1), rgba(233, 30, 99, 0.1));
            border-radius: 12px;
            padding: 18px;
            border: 1px solid rgba(156, 39, 176, 0.2);
            margin: 16px 0;
        }
        
        .news-section h3 {
            font-family: 'Inter', sans-serif;
            font-size: 17px;
            font-weight: 700;
            margin: 0 0 14px 0;
            color: #9c27b0;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        .news-items {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 12px;
        }
        
        .news-item {
            background: rgba(255, 255, 255, 0.8);
            padding: 14px;
            border-radius: 10px;
            border-left: 3px solid #9c27b0;
            transition: all 0.3s ease;
        }
        
        .news-item:hover {
            background: rgba(255, 255, 255, 0.95);
            transform: translateY(-1px);
            box-shadow: 0 3px 10px rgba(156, 39, 176, 0.15);
        }
        
        .news-item-title {
            font-weight: 600;
            margin-bottom: 6px;
            line-height: 1.3;
            font-size: 14px;
        }
        
        .news-item-title a {
            color: #1e293b;
            text-decoration: none;
        }
        
        .news-item-title a:hover {
            color: #9c27b0;
        }
        
        .news-item-snippet {
            color: #64748b;
            font-size: 12px;
            line-height: 1.4;
            margin-bottom: 6px;
        }
        
        .news-item-date {
            color: #9c27b0;
            font-size: 10px;
            font-weight: 500;
        }
    }

    /* 🎯 모바일용 뉴스 섹션 (768px 이하) */
    @media (max-width: 768px) {
        .news-section,
        .mobile-news-section {
            background: linear-gradient(135deg, rgba(156, 39, 176, 0.1), rgba(233, 30, 99, 0.1));
            border-radius: 10px;
            padding: 16px;
            border: 1px solid rgba(156, 39, 176, 0.2);
            margin: 12px 0;
            display: block !important;
        }
        
        .news-section h3,
        .mobile-news-section h3 {
            font-family: 'Inter', sans-serif;
            font-size: 16px;
            font-weight: 700;
            margin: 0 0 12px 0;
            color: #9c27b0;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        
        .news-items {
            display: block;
        }
        
        .news-item,
        .mobile-news-item {
            background: rgba(255, 255, 255, 0.8);
            padding: 12px;
            border-radius: 8px;
            border-left: 3px solid #9c27b0;
            margin-bottom: 10px;
            transition: all 0.3s ease;
        }
        
        .news-item:hover,
        .mobile-news-item:hover {
            background: rgba(255, 255, 255, 0.95);
            transform: translateY(-1px);
            box-shadow: 0 2px 8px rgba(156, 39, 176, 0.15);
        }
        
        .news-item-title,
        .mobile-news-item-title {
            font-weight: 600;
            margin-bottom: 6px;
            line-height: 1.3;
            font-size: 14px;
        }
        
        .news-item-title a,
        .mobile-news-item-title a {
            color: #1e293b;
            text-decoration: none;
        }
        
        .news-item-title a:hover,
        .mobile-news-item-title a:hover {
            color: #9c27b0;
        }
        
        .news-item-snippet,
        .mobile-news-item-snippet {
            color: #64748b;
            font-size: 12px;
            line-height: 1.4;
            margin-bottom: 6px;
        }
        
        .news-item-date {
            color: #9c27b0;
            font-size: 10px;
            font-weight: 500;
        }
    }

    /* 🎯 412px 이하 초소형 모바일 최적화 */
    @media (max-width: 412px) {
        .news-section,
        .mobile-news-section {
            background: linear-gradient(135deg, rgba(156, 39, 176, 0.1), rgba(233, 30, 99, 0.1));
            border-radius: 8px;
            padding: 12px;
            border: 1px solid rgba(156, 39, 176, 0.2);
            margin: 10px 0;
            display: block !important;
        }
        
        .news-section h3,
        .mobile-news-section h3 {
            font-family: 'Inter', sans-serif;
            font-size: 15px;
            font-weight: 700;
            margin: 0 0 10px 0;
            color: #9c27b0;
            display: flex;
            align-items: center;
            gap: 5px;
        }
        
        .news-item,
        .mobile-news-item {
            background: rgba(255, 255, 255, 0.8);
            padding: 10px;
            border-radius: 6px;
            border-left: 2px solid #9c27b0;
            margin-bottom: 8px;
            transition: all 0.3s ease;
        }
        
        .news-item:hover,
        .mobile-news-item:hover {
            background: rgba(255, 255, 255, 0.95);
            transform: translateY(-1px);
            box-shadow: 0 2px 6px rgba(156, 39, 176, 0.15);
        }
        
        .news-item-title,
        .mobile-news-item-title {
            font-weight: 600;
            margin-bottom: 5px;
            line-height: 1.3;
            font-size: 13px;
        }
        
        .news-item-title a,
        .mobile-news-item-title a {
            color: #1e293b;
            text-decoration: none;
        }
        
        .news-item-title a:hover,
        .mobile-news-item-title a:hover {
            color: #9c27b0;
        }
        
        .news-item-snippet,
        .mobile-news-item-snippet {
            color: #64748b;
            font-size: 11px;
            line-height: 1.4;
            margin-bottom: 5px;
        }
        
        .news-item-date {
            color: #9c27b0;
            font-size: 9px;
            font-weight: 500;
        }
    }

    .ai-search-input-container {
        position: relative;
        display: flex;
        align-items: center;
        background: #ffffff;
        border: 2px solid #e1e5e9;
        border-radius: 50px; 
        padding: 8px;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
        max-width: 800px;
        margin: 0 auto;
    }

    .ai-search-input-container:hover {
        border-color:rgb(255, 255, 255);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }

    .ai-search-input-container:focus-within {
        border-color:rgb(83, 154, 248);
        background:rgb(255, 255, 255);
        box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.12), 0 4px 12px rgba(0, 0, 0, 0.08);
        transform: translateY(-1px);
    }

    .ai-search-input {
        flex: 1 !important;
        height: 48px !important; /* 높이 줄임 */
        padding: 0 20px !important; /* 패딩 줄임 */
        font-size: 16px !important;
        border: none !important;
        outline: none !important;
        background: transparent !important;
        color: #334155 !important;
        font-weight: 400 !important;
        font-family: 'Inter', sans-serif !important;
        gap: 5px !important;
        margin-bottom: 0px !important;
    }

    .ai-search-input::placeholder {
        color:rgb(209, 123, 123);
        font-weight: 400;
    }

    .ai-search-btn {
        background: linear-gradient(135deg,rgb(102, 234, 227) 0%,rgb(94, 160, 214) 100%);
        color: white;
        border: none;
        width: 48px; /* 크기 줄임 */
        height: 48px; /* 크기 줄임 */
        border-radius: 50%;
        cursor: pointer;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
        gap: 5px;
    }

    .ai-search-btn:hover {
        transform: translateY(-2px) scale(1.05);
        box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
        background: linear-gradient(135deg,rgb(71, 197, 191) 0%,rgb(57, 118, 168) 100%);
    }

    .ai-search-btn:active {
        transform: translateY(0) scale(1);
        box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    }

    .ai-search-btn i {
        font-size: 16px; /* 아이콘 크기 줄임 */
        transition: transform 0.2s ease;
    }

    .ai-search-btn:hover i {
        transform: scale(1.1);
    }

    .ai-search-loading {
        display: none;
        text-align: center;
        margin: 20px 0; /* 여백 줄임 */
    }

    /* AI 뉴럴 네트워크 스타일 로딩 */
    .ai-search-loading-container {
        position: relative;
        width: 100px; /* 크기 줄임 */
        height: 100px; /* 크기 줄임 */
        margin: 0 auto 20px; /* 여백 줄임 */
    }

    .neural-network {
        position: relative;
        width: 100%;
        height: 100%;
    }

    .neural-node {
        position: absolute;
        width: 10px; /* 크기 줄임 */
        height: 10px; /* 크기 줄임 */
        background: #667eea;
        border-radius: 50%;
        animation: neural-pulse 2s ease-in-out infinite;
    }

    .neural-node:nth-child(1) { top: 20%; left: 50%; animation-delay: 0s; }
    .neural-node:nth-child(2) { top: 40%; left: 20%; animation-delay: 0.2s; }
    .neural-node:nth-child(3) { top: 40%; left: 80%; animation-delay: 0.4s; }
    .neural-node:nth-child(4) { top: 60%; left: 35%; animation-delay: 0.6s; }
    .neural-node:nth-child(5) { top: 60%; left: 65%; animation-delay: 0.8s; }
    .neural-node:nth-child(6) { top: 80%; left: 50%; animation-delay: 1s; }

    .neural-connection {
        position: absolute;
        height: 2px;
        background: linear-gradient(90deg, transparent, #667eea, transparent);
        animation: neural-flow 1.5s linear infinite;
        opacity: 0.6;
    }

    /* 연결선들 */
    .connection-1 { top: 30%; left: 45%; width: 25px; transform: rotate(45deg); animation-delay: 0.1s; }
    .connection-2 { top: 30%; left: 55%; width: 25px; transform: rotate(-45deg); animation-delay: 0.3s; }
    .connection-3 { top: 50%; left: 30%; width: 35px; transform: rotate(30deg); animation-delay: 0.5s; }
    .connection-4 { top: 50%; left: 60%; width: 35px; transform: rotate(-30deg); animation-delay: 0.7s; }
    .connection-5 { top: 70%; left: 45%; width: 25px; transform: rotate(-45deg); animation-delay: 0.9s; }
    .connection-6 { top: 70%; left: 55%; width: 25px; transform: rotate(45deg); animation-delay: 1.1s; }

    @keyframes neural-pulse {
        0%, 100% { 
            transform: scale(1); 
            box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
            background:rgb(26, 167, 248);
        }
        50% { 
            transform: scale(1.2); /* 스케일 줄임 */
            box-shadow: 0 0 0 8px rgba(102, 126, 234, 0); /* 그림자 줄임 */
            background:rgb(70, 229, 176);
        }
    }

    @keyframes neural-flow {
        0% { opacity: 0; transform: scaleX(0); }
        50% { opacity: 1; transform: scaleX(1); }
        100% { opacity: 0; transform: scaleX(0); }
    }

    /* 타이핑 텍스트 효과 */
    .ai-search-loading-text {
        color:rgb(58, 153, 207);
        font-size: 13px; /* 크기 줄임 */
        font-weight: 500;
        font-family: 'Inter', sans-serif;
        min-height: 18px; /* 높이 줄임 */
        position: relative;
    }

    .typing-text::after {
        content: '|';
        color: #667eea;
        animation: blink 1s infinite;
        margin-left: 2px;
    }

    @keyframes blink {
        0%, 50% { opacity: 1; }
        51%, 100% { opacity: 0; }
    }

    /* 진행률 바 */
    .ai-progress-container {
        width: 180px; /* 너비 줄임 */
        height: 3px; /* 높이 줄임 */
        background: rgba(102, 126, 234, 0.1);
        border-radius: 2px;
        margin: 12px auto; /* 여백 줄임 */
        overflow: hidden;
        position: relative;
    }

    .ai-progress-bar {
        height: 100%;
        background: linear-gradient(90deg, #667eea, #764ba2);
        border-radius: 2px;
        width: 0%;
        transition: width 0.3s ease;
        position: relative;
    }

    .ai-progress-bar::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
        animation: progress-shine 2s infinite;
    }

    @keyframes progress-shine {
        0% { transform: translateX(-100%); }
        100% { transform: translateX(200%); }
    }

    .ai-search-results-container {
        display: none;
        margin-top: 20px; /* 여백 줄임 */
    }

    .ai-search-result-section {
        background: white;
        border-radius: 12px;
        padding: 20px;
        margin-bottom: 16px;
        border: 1px solid #e2e8f0;
        transition: all 0.2s ease;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }

    .ai-search-result-section:hover {
        border-color: #cbd5e1;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }

    /* AI 분석 섹션만 특별하게 */
    .ai-search-result-section:first-child {
        background: linear-gradient(135deg, #f8fafc, #f1f5f9);
        border: 2px solid #e2e8f0;
    }

    /* 검색 결과 헤더 */
    .ai-search-result-header {
        display: flex;
        align-items: center;
        margin-bottom: 12px;
        gap: 8px;
    }

    /* 뱃지 스타일 - 네이버/다음 색상 구분 */
    .ai-search-source-badge-news {
        background: #dc2626;
        color: white;
        padding: 4px 8px;
        border-radius: 6px;
        font-size: 11px;
        font-weight: 600;
        display: inline-flex;
        align-items: center;
        gap: 4px;
    }

    .ai-search-source-badge-blog {
        background: #059669;
        color: white;
        padding: 4px 8px;
        border-radius: 6px;
        font-size: 11px;
        font-weight: 600;
        display: inline-flex;
        align-items: center;
        gap: 4px;
    }

    .ai-search-source-badge-cafe {
        background: #7c3aed;
        color: white;
        padding: 4px 8px;
        border-radius: 6px;
        font-size: 11px;
        font-weight: 600;
        display: inline-flex;
        align-items: center;
        gap: 4px;
    }

    .ai-search-source-badge-web {
        background: #32b8ec;
        color: white;
        padding: 4px 8px;
        border-radius: 6px;
        font-size: 11px;
        font-weight: 600;
        display: inline-flex;
        align-items: center;
        gap: 4px;
    }

    /* 🎯 네이버 전용 뱃지 - 녹색 */
    .ai-search-source-badge-naver {
        background: #03c75a; /* 네이버 녹색 */
        color: white;
        padding: 4px 8px;
        border-radius: 6px;
        font-size: 11px;
        font-weight: 600;
        display: inline-flex;
        align-items: center;
        gap: 4px;
    }

    /* 🎯 다음 전용 뱃지 - 파란색 */
    .ai-search-source-badge-daum {
        background: #3574e0; /* 다음 파란색 */
        color: white;
        padding: 4px 8px;
        border-radius: 6px;
        font-size: 11px;
        font-weight: 600;
        display: inline-flex;
        align-items: center;
        gap: 4px;
    }

    .ai-search-source-badge-default {
        background: #6b7280;
        color: white;
        padding: 4px 8px;
        border-radius: 6px;
        font-size: 11px;
        font-weight: 600;
        display: inline-flex;
        align-items: center;
        gap: 4px;
    }

    /* AI 뱃지만 특별하게 */
    .ai-search-source-badge.ai { 
        background: linear-gradient(135deg, #667eea, #764ba2);
        color: white;
        padding: 6px 12px;
        border-radius: 8px;
        font-size: 12px;
        font-weight: 700;
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }

    /* 제목 스타일 - 심플하게 */
    .ai-search-result-title {
        font-family: 'Inter', sans-serif;
        font-size: 16px;
        color: #1e293b;
        font-weight: 600;
        line-height: 1.4;
        flex: 1;
    }

    .ai-search-result-title a {
        color: #1e293b;
        text-decoration: none;
    }

    .ai-search-result-title a:hover {
        color: #3b82f6;
    }

    /* 내용 스타일 - 길이 제한 추가 (경고 해결) */
    .ai-search-result-content {
        color: #475569;
        font-size: 14px;
        line-height: 1.6;
        margin-top: 8px;
        /* 기본적으로는 줄 제한 없음 - AI 분석 결과는 전체 표시 */
        overflow-wrap: break-word;
        word-break: break-word;
    }

    /* 강조 텍스트 */
    .ai-search-result-content strong {
        color: #1e293b;
        font-weight: 600;
    }

    .ai-search-result-content em {
        color: #3b82f6;
        font-style: normal;
        font-weight: 500;
    }

    /* 피드백 섹션 - 심플하게 */
    .feedback-section {
        margin-top: 16px;
        padding: 16px;
        background: #f8fafc;
        border-radius: 8px;
        border: 1px solid #e2e8f0;
    }

    .feedback-header {
        margin-bottom: 12px;
        font-size: 14px;
        color: #475569;
        font-weight: 500;
    }

    .feedback-buttons {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
    }

    .feedback-btn {
        padding: 8px 16px;
        border: 1px solid #e2e8f0;
        border-radius: 6px;
        background: white;
        cursor: pointer;
        font-size: 13px;
        font-weight: 500;
        transition: all 0.2s ease;
        display: flex;
        align-items: center;
        gap: 4px;
    }

    .feedback-btn:hover:not(:disabled) {
        border-color: #cbd5e1;
        background: #f8fafc;
    }

    .like-btn {
        color: #059669;
        border-color: #059669;
    }

    .like-btn:hover:not(:disabled) {
        background: #ecfdf5;
    }

    .dislike-btn {
        color: #dc2626;
        border-color: #dc2626;
    }

    .dislike-btn:hover:not(:disabled) {
        background: #fef2f2;
    }

    .excellent-btn {
        color: #d97706;
        border-color: #d97706;
    }

    .excellent-btn:hover:not(:disabled) {
        background: #fffbeb;
    }

    .feedback-btn.selected {
        background: currentColor;
        color: white;
    }

    .feedback-count {
        background: #f1f5f9;
        padding: 2px 6px;
        border-radius: 4px;
        font-size: 11px;
        font-weight: 600;
        min-width: 16px;
        text-align: center;
    }

    .feedback-btn.selected .feedback-count {
        background: rgba(255, 255, 255, 0.3);
        color: white;
    }

    /* 전체 검색결과 보기 버튼 - 심플하게 */
    .search-results-toggle-container {
        text-align: center;
        margin: 24px 0;
    }

    .search-results-toggle-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 12px 24px;
        background: #3b82f6;
        color: white;
        border: none;
        border-radius: 8px;
        font-family: 'Inter', sans-serif;
        font-size: 14px;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.2s ease;
        text-decoration: none;
    }

    .search-results-toggle-btn:hover {
        background: #2563eb;
        color: white;
    }

    .search-results-toggle-btn i {
        font-size: 14px;
        transition: transform 0.2s ease;
    }

    .search-results-toggle-btn.expanded i {
        transform: rotate(180deg);
    }

    /* 카테고리 그룹 - 심플하게 */
    .category-group {
        margin-bottom: 20px;
    }

    .category-group h4 {
        font-size: 14px;
        font-weight: 600;
        color: #374151;
        margin-bottom: 12px;
        padding-bottom: 4px;
        border-bottom: 1px solid #e5e7eb;
        display: flex;
        align-items: center;
        gap: 6px;
    }

    /* 모바일 카테고리 섹션 */
    .mobile-category-section {
        margin-bottom: 24px;
    }

    .mobile-category-section h4 {
        font-size: 16px;
        font-weight: 600;
        color: #1f2937;
        margin-bottom: 12px;
        padding: 8px 0;
        border-bottom: 2px solid #e5e7eb;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    /* 뉴스 날짜는 하단 고정 */
    .news-date {
        font-size: 12px;
        color: #6b7280;
        margin-top: auto; /* 하단으로 밀어내기 */
        padding-top: 8px;
        flex-shrink: 0;
        min-height: 20px; /* 최소 높이 설정 */
    }

    /* 날짜가 없는 경우를 위한 빈 공간 */
    .ai-search-result-section .date-placeholder {
        font-size: 12px;
        color: transparent; /* 투명하게 만들어서 공간만 차지 */
        margin-top: auto;
        padding-top: 8px;
        flex-shrink: 0;
        min-height: 20px;
        content: " "; /* 빈 공간 */
    }

    /* 컴팩트 결과 아이템 */
    .ai-search-result-section.compact {
        padding: 16px;
        margin-bottom: 12px;
    }

    .ai-search-result-section.compact .ai-search-result-title {
        font-size: 15px;
    }

    .ai-search-result-section.compact .ai-search-result-content {
        font-size: 13px;
    }

    /* 전체 검색 결과 컨테이너 */
    .all-search-results-container {
        margin-top: 24px;
        padding-top: 24px;
        border-top: 1px solid #e5e7eb;
    }

    .all-search-results-header h3 {
        font-size: 18px;
        font-weight: 600;
        color: #1f2937;
        margin-bottom: 16px;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .all-search-results-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 16px;
    }

    @media (min-width: 768px) {
        .all-search-results-grid {
            grid-template-columns: 1fr 1fr;
        }
    }

    .all-results-column h4 {
        font-size: 16px;
        font-weight: 600;
        color: #374151;
        margin-bottom: 12px;
        display: flex;
        align-items: center;
        gap: 6px;
    }

    /* 반응형 */
    @media (max-width: 768px) {
        .ai-search-result-section {
            padding: 16px;
            margin-bottom: 12px;
        }
        
        .ai-search-result-title {
            font-size: 15px;
        }
        
        .ai-search-result-content {
            font-size: 13px;
        }
        
        .feedback-section {
            padding: 12px;
        }
        
        .feedback-btn {
            padding: 6px 12px;
            font-size: 12px;
        }
        
        .search-results-toggle-btn {
            padding: 10px 20px;
            font-size: 13px;
        }
    }

    /* 모바일에서 피드백 버튼 아이콘만 표시 */
    @media (max-width: 480px) {
        .feedback-btn .btn-text {
        display: none;
        }
        
        .feedback-btn {
            min-width: 40px;
            justify-content: center;
            padding: 8px;
        }
        
        .feedback-buttons {
            justify-content: center;
        }
    }

    /* 모바일 선택 부분 완전히 숨김 처리 */
    .ai-search-mobile-select {
        display: none !important; /* 모든 해상도에서 숨김 */
    }

    /* 모바일에서도 GPT 전용 모드 표시 */
    @media (max-width: 767px) {
        .ai-search-mobile-select {
            display: none !important; /* GPT 전용에서는 선택 박스 완전 숨김 */
        }
        

    }

    .ai-search-mobile-select:focus {
            border-color: #667eea;
        outline: none;
            box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
        }

        /* 모바일에서는 탭 숨기고 셀렉트박스 표시 */
        .ai-search-tabs {
            display: none !important;
        }

        .ai-search-mode-desc {
            display: none !important;
        }


    /* 🔧 AI 분석 섹션은 길이 제한 완전 해제 */
    .ai-search-result-section:first-child .ai-search-result-content {
        display: block !important;
        -webkit-line-clamp: unset !important;
        line-clamp: unset !important;
        -webkit-box-orient: unset !important;
        box-orient: unset !important;
        overflow: visible !important;
        text-overflow: unset !important;
        max-height: none !important;
        white-space: normal !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }

    /* 컴팩트 결과 아이템도 길이 제한 */
    .ai-search-result-section.compact .ai-search-result-content {
        font-size: 13px;
        -webkit-line-clamp: 2; /* 컴팩트는 2줄로 제한 */
        line-clamp: 2; /* 표준 속성 추가 */
        max-height: 3.2em; /* line-height 1.6 × 2줄 = 3.2em */
    }

    /* 검색 결과 섹션 높이 통일 */
    .ai-search-result-section {
        background: white;
        border-radius: 12px;
        padding: 20px;
        margin-bottom: 16px;
        border: 1px solid #e2e8f0;
        transition: all 0.2s ease;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        min-height: 140px; /* 최소 높이 설정 */
        display: flex;
        flex-direction: column;
    }

    /* AI 분석 섹션은 높이 제한 없음 */
    .ai-search-result-section:first-child {
        background: linear-gradient(135deg, #f8fafc, #f1f5f9);
        border: 2px solid #e2e8f0;
        min-height: auto; /* AI 분석은 높이 제한 없음 */
    }

    /* 컴팩트 결과 아이템 높이 통일 */
    .ai-search-result-section.compact {
        padding: 16px;
        margin-bottom: 12px;
        min-height: 120px; /* 컴팩트는 더 작은 높이 */
    }

    /* 검색 결과 헤더 */
    .ai-search-result-header {
        display: flex;
        align-items: center;
        margin-bottom: 12px;
        gap: 8px;
        flex-shrink: 0; /* 헤더는 줄어들지 않음 */
    }

    /* 내용 영역이 남은 공간을 차지하도록 */
    .ai-search-result-content {
        flex: 1;
        color: #475569;
        font-size: 14px;
        line-height: 1.6;
        margin-top: 8px;
        /* 🔧 일반 검색 결과에만 줄 제한 적용 */
        display: -webkit-box;
        display: box; /* 표준 속성 추가 */
        -webkit-line-clamp: 3; /* 3줄로 제한 */
        line-clamp: 3; /* 표준 속성 추가 */
        -webkit-box-orient: vertical;
        box-orient: vertical; /* 표준 속성 추가 */
        overflow: hidden;
        text-overflow: ellipsis;
        max-height: 4.8em; /* line-height 1.6 × 3줄 = 4.8em */
    }

    /* 🚀 AI 분석 결과는 텍스트 제한 완전 해제 */
    .ai-search-result-section:first-child .ai-search-result-content {
        display: block !important;
        -webkit-line-clamp: unset !important;
        line-clamp: unset !important;
        -webkit-box-orient: unset !important;
        box-orient: unset !important;
        overflow: visible !important;
        text-overflow: unset !important;
        max-height: none !important;
        white-space: pre-wrap !important;
    }

    /* 뉴스 날짜는 하단 고정 */
    .news-date {
        font-size: 12px;
        color: #6b7280;
        margin-top: auto; /* 하단으로 밀어내기 */
        padding-top: 8px;
        flex-shrink: 0;
    }

    /* 반응형 - 모바일에서 높이 조정 */
    @media (max-width: 768px) {
        .ai-search-result-section {
            padding: 16px;
            margin-bottom: 12px;
            min-height: 120px; /* 모바일에서는 더 작게 */
        }
        
        .ai-search-result-section.compact {
            min-height: 100px;
        }
        
        .ai-search-result-content {
            font-size: 13px;
            -webkit-line-clamp: 2; /* 모바일에서는 2줄로 제한 */
            line-clamp: 2; /* 표준 속성 추가 */
            max-height: 3.2em;
        }
        
        /* 🚀 모바일에서도 AI 분석 결과는 텍스트 제한 해제 */
        .ai-search-result-section:first-child .ai-search-result-content {
            font-size: 13px !important;
            display: block !important;
            -webkit-line-clamp: unset !important;
            line-clamp: unset !important;
            -webkit-box-orient: unset !important;
            box-orient: unset !important;
            overflow: visible !important;
            text-overflow: unset !important;
            max-height: none !important;
            white-space: pre-wrap !important;
        }
        
        .ai-search-result-section.compact .ai-search-result-content {
            font-size: 12px;
            -webkit-line-clamp: 2;
            line-clamp: 2; /* 표준 속성 추가 */
            max-height: 3.2em;
        }
    }

    @media (max-width: 480px) {
        .ai-search-result-section {
            min-height: 100px; /* 초소형 모바일에서는 더 작게 */
        }
        
        .ai-search-result-section.compact {
            min-height: 90px;
        }
        
        .ai-search-result-content {
            font-size: 12px;
            -webkit-line-clamp: 2;
            line-clamp: 2; /* 표준 속성 추가 */
            max-height: 3.2em;
        }
        
        /* 🚀 초소형 모바일에서도 AI 분석 결과는 텍스트 제한 해제 */
        .ai-search-result-section:first-child .ai-search-result-content {
            font-size: 12px !important;
            display: block !important;
            -webkit-line-clamp: unset !important;
            line-clamp: unset !important;
            -webkit-box-orient: unset !important;
            box-orient: unset !important;
            overflow: visible !important;
            text-overflow: unset !important;
            max-height: none !important;
            white-space: pre-wrap !important;
        }
    }

    /* 태블릿에서도 GPT 전용 모드 유지 */
    @media (min-width: 768px) {
        .ai-search-tabs {
            display: none !important; /* GPT 전용에서는 탭 숨김 */
        }
        
        .ai-search-mode-desc {
            display: none !important; /* GPT 전용에서는 모드 설명 숨김 */
        }
        
        .ai-search-mobile-select {
            display: none !important;
        }
        

    }

    /* PC에서도 GPT 전용 모드 유지 */
    @media (min-width: 1024px) {
        .ai-search-tabs {
            display: none !important; /* GPT 전용에서는 탭 숨김 */
        }
        
        .ai-search-mode-desc {
            display: none !important; /* GPT 전용에서는 모드 설명 숨김 */
        }
        
        .ai-search-mobile-select {
            display: none !important;
        }
        

    }

    /* 모든 검색 결과에 날짜 영역 통일 */
    .ai-search-result-section {
        background: white;
        border-radius: 12px;
        padding: 20px;
        margin-bottom: 16px;
        border: 1px solid #e2e8f0;
        transition: all 0.2s ease;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        min-height: 140px;
        display: flex;
        flex-direction: column;
        position: relative;
    }

    /* 모든 검색 결과 하단에 날짜 영역 확보 */
    .ai-search-result-section::after {
        content: "";
        margin-top: auto;
        padding-top: 8px;
        min-height: 20px;
        flex-shrink: 0;
    }

    /* 뉴스가 있는 경우 ::after 제거 */
    .ai-search-result-section:has(.news-date)::after {
        display: none;
    }

    /* 브라우저 호환성을 위한 대안 방법 */
    .result-footer {
        margin-top: auto;
        padding-top: 8px;
        min-height: 20px;
        flex-shrink: 0;
    }

    .result-footer.has-date {
        padding: 0;
        margin: 0;
        min-height: auto;
    }

    /* 컴팩트 결과도 동일하게 적용 */
    .ai-search-result-section.compact::after {
        content: "";
        margin-top: auto;
        padding-top: 6px;
        min-height: 18px;
        flex-shrink: 0;
    }

    .ai-search-result-section.compact:has(.news-date)::after {
        display: none;
    }

    /* 반응형에서도 동일하게 적용 */
    @media (max-width: 768px) {
        .ai-search-result-section::after {
            padding-top: 6px;
            min-height: 18px;
        }
        
        .ai-search-result-section.compact::after {
            padding-top: 4px;
            min-height: 16px;
        }
        
        .news-date {
            min-height: 18px;
            padding-top: 6px;
        }
    }

    @media (max-width: 480px) {
        .ai-search-result-section::after {
            padding-top: 4px;
            min-height: 16px;
        }
        
        .ai-search-result-section.compact::after {
            padding-top: 4px;
            min-height: 14px;
        }
        
        .news-date {
            min-height: 16px;
            padding-top: 4px;
        }
    }

    /* 대안: 더 호환성 좋은 방법 (필요시 사용) */
    .text-clamp-fallback {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap; /* 한 줄로 제한하는 경우 */
    }

    /* 여러 줄 말줄임표를 위한 JavaScript 대안 클래스 */
    .text-clamp-js {
        overflow: hidden;
        word-wrap: break-word;
        position: relative;
    }

    .text-clamp-js::after {
        content: '...';
        position: absolute;
        bottom: 0;
        right: 0;
        background: white;
        padding-left: 20px;
        background: linear-gradient(to right, transparent, white 50%);
    }

    /* 채팅 이력 사이드바 스타일 */
    .chat-history-sidebar {
        position: fixed;
        top: 0;
        left: -400px;
        width: 400px;
        height: 100vh;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        border-right: 1px solid rgba(226, 232, 240, 0.8);
        transition: left 0.3s ease;
        z-index: 999999; /* 매우 높은 z-index로 설정 - 헤더보다 높게 */
        overflow-y: auto;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
    }

    .chat-history-sidebar.active {
        left: 0;
    }

    .chat-history-header {
        position: sticky;
        top: 0;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(20px);
        padding: 20px;
        border-bottom: 1px solid rgba(226, 232, 240, 0.8);
        z-index: 1000001; /* 헤더가 최상위에 오도록 */
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .chat-history-header h3 {
        margin: 0;
        font-size: 16px;
        font-weight: 600;
        color: #1f2937;
        flex: 1;
    }

    .chat-history-toggle {
        background: none;
        border: none;
        font-size: 18px;
        cursor: pointer;
        color: #64748b;
        padding: 8px;
        border-radius: 50%;
        transition: all 0.2s ease;
        z-index: 1000002; /* 닫기 버튼이 최상위에 오도록 */
    }

    .chat-history-toggle:hover {
        background: rgba(248, 250, 252, 0.8);
        color: #334155;
    }

    .chat-history-content {
        flex: 1;
        overflow-y: auto;
        padding: 10px 0;
    }

    .session-date-group {
        margin-bottom: 20px;
    }

    .session-date-header {
        padding: 8px 20px;
        font-size: 12px;
        font-weight: 600;
        color: #6b7280;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    /* 검색 이력 사이드바 개선 */
    .session-item {
        padding: 12px 16px;
        margin-bottom: 8px;
        border-radius: 12px;
        cursor: pointer;
        transition: all 0.2s ease;
        border: 1px solid transparent;
        background: #ffffff;
    }

    .session-item:hover {
        background: #f8fafc;
        border-color: #e2e8f0;
        transform: translateX(4px);
    }

    .session-item.active {
        background: linear-gradient(135deg, #eff6ff, #dbeafe);
        border-color: #3b82f6;
        box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
    }

    .session-title {
        font-size: 14px;
        font-weight: 600;
        color: #1f2937;
        margin-bottom: 4px;
        line-height: 1.4;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .session-preview {
        font-size: 12px;
        color: #6b7280;
        line-height: 1.3;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .session-time {
        font-size: 11px;
        color: #9ca3af;
        margin-top: 4px;
    }

    .session-actions {
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        opacity: 0;
        transition: opacity 0.2s ease;
    }

    .session-item:hover .session-actions {
        opacity: 1;
    }

    .session-actions button {
        background: none;
        border: none;
        color: #ef4444;
        cursor: pointer;
        padding: 4px;
        border-radius: 3px;
        font-size: 12px;
    }

    .session-actions button:hover {
        background: #fee2e2;
    }

    .chat-history-footer {
        padding: 15px 20px;
        border-top: 1px solid #e5e7eb;
        background: #f8fafc;
    }

    .new-chat-btn {
        width: 100%;
        padding: 10px;
        background: #3b82f6;
        color: white;
        border: none;
        border-radius: 6px;
        font-size: 14px;
        font-weight: 500;
        cursor: pointer;
        transition: background 0.2s ease;
    }

    .new-chat-btn:hover {
        background: #2563eb;
    }

    /* 채팅 이력 토글 버튼 - 기본 설정 (PC용) */
    .chat-history-trigger {
        position: fixed;
        top: 80px; /* PC에서는 상단에서 80px (헤더 아래) */
        left: 30px; /* PC에서는 좌측에서 30px */
        width: 56px;
        height: 56px;
        background: linear-gradient(135deg, #667eea, #764ba2);
        border: none;
        border-radius: 50%;
        color: white;
            font-size: 20px;
            cursor: pointer;
        box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
        transition: all 0.3s ease;
        z-index: 99999 !important;
        display: flex;
        align-items: center;
        justify-content: center;
        pointer-events: auto !important;
        touch-action: manipulation !important;
        outline: none;
        -webkit-tap-highlight-color: rgba(102, 126, 234, 0.3);
        user-select: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        }
        
    .chat-history-trigger:hover {
        transform: scale(1.1);
        box-shadow: 0 6px 25px rgba(102, 126, 234, 0.6);
        }
        
    /* PC에서만 토글 기능 작동 */
    @media (min-width: 769px) {
        .chat-history-sidebar.active ~ .chat-history-trigger,
        body.chat-history-open .chat-history-trigger {
            opacity: 0;
            visibility: hidden;
            transform: scale(0.8);
            transition: all 0.3s ease;
        }
        }
        
    /* 모바일에서는 토글 기능 비활성화 - 트리거 버튼 항상 표시 */
    @media (max-width: 768px) {
        .chat-history-trigger {
            bottom: 30px !important; /* 모바일에서는 하단에서 30px */
            left: 30px !important; /* 모바일에서는 좌측에서 30px */
            top: auto !important; /* top 속성 제거 */
            right: auto !important; /* right 속성 제거 */
            width: 60px;
            height: 60px;
            font-size: 24px;
            z-index: 99999 !important;
        }
        
        /* 모바일에서는 토글 기능 강제 비활성화 */
        .chat-history-sidebar.active ~ .chat-history-trigger,
        body.chat-history-open .chat-history-trigger {
            opacity: 1 !important;
            visibility: visible !important;
            transform: scale(1) !important;
        }
    }

    /* 더 작은 모바일에서도 조정 */
    @media (max-width: 480px) {
        .chat-history-trigger {
            bottom: 20px !important; /* 더 작은 화면에서는 하단에서 20px */
            left: 20px !important; /* 더 작은 화면에서는 좌측에서 20px */
            width: 55px;
            height: 55px;
            font-size: 22px;
            z-index: 99999 !important;
        }
    }

    /* 412px 이하에서도 좌측 하단 유지 */
    @media (max-width: 412px) {
        .chat-history-trigger {
            bottom: 15px !important; /* 하단에서 15px */
            left: 15px !important; /* 좌측에서 15px */
            width: 55px;
            height: 55px;
            font-size: 22px;
            z-index: 99999 !important;
        }
        }
        
        /* 🎯 초소형 모바일에서 사이드바 내용 더 조정 */
        .session-item {
        padding: 8px 12px;
            margin: 0 6px 4px 6px;
        }
        
        .session-title {
            font-size: 12px;
        }
        
        .session-preview {
            font-size: 10px;
        }
        
        .session-time {
            font-size: 9px;
        }
        
        .session-date-header {
            padding: 4px 12px;
            font-size: 10px;
        }
        
        .chat-history-footer {
            padding: 10px 12px;
            background: #f8fafc;
        }
        
        .new-chat-btn {
            padding: 10px;
            font-size: 13px;
    }

    /* 현재 세션 정보 */
    .current-session-info {
        margin-bottom: 15px;
        padding: 10px 15px;
        background: #f0f9ff;
        border: 1px solid #bae6fd;
        border-radius: 8px;
    }

    .session-indicator {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 14px;
        color: #0369a1;
    }

    .session-menu-btn {
        background: none;
        border: none;
        color: #0369a1;
        cursor: pointer;
        padding: 2px 6px;
        border-radius: 3px;
        margin-left: auto;
    }

    .session-menu-btn:hover {
        background: #bae6fd;
    }

    /* 채팅 메시지 스타일 */
    .chat-messages-container {
        max-width: 100%;
    }

    .chat-message {
        margin-bottom: 20px;
        padding: 15px;
        border-radius: 12px;
        max-width: 85%;
    }

    .chat-message.user-message {
        background: #eff6ff;
        border: 1px solid #bae6fd;
        margin-left: auto;
    }

    .chat-message.ai-message {
        background: #f8fafc;
        border: 1px solid #e2e8f0;
    }

    .message-header {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 8px;
        font-size: 12px;
        color: #6b7280;
    }

    .message-content {
        font-size: 14px;
        line-height: 1.6;
        color: #1f2937;
    }

    .no-sessions {
        text-align: center;
        padding: 40px 20px;
        color: #6b7280;
    }

    .no-sessions i {
        font-size: 48px;
        margin-bottom: 15px;
        opacity: 0.5;
    }

    .chat-welcome {
        text-align: center;
        padding: 40px 20px;
        color: #6b7280;
    }

    /* 사이드바 열렸을 때 메인 컨텐츠 이동 (데스크톱만) */
    @media (min-width: 769px) {
        body.chat-history-open .ai-search-container {
            margin-left: 350px;
            transition: margin-left 0.3s ease;
        }
    }

    /* 검색 이력 아이템 스타일 */
    .search-history-item {
        padding: 12px 20px;
        cursor: pointer;
        border-left: 3px solid transparent;
        transition: all 0.2s ease;
        position: relative;
        border-radius: 0 8px 8px 0;
        margin: 2px 0;
    }

    .search-history-item:hover {
        background: #f0f9ff;
        border-left-color: #3b82f6;
    }

    .search-history-item.active {
        background: #eff6ff;
        border-left-color: #2563eb;
        box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.1);
    }

    .search-query {
        font-size: 14px;
        font-weight: 500;
        color: #1f2937;
        margin-bottom: 6px;
        line-height: 1.3;
    
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        line-clamp: 2; /* 표준 속성 추가 */

        overflow: hidden;
        text-overflow: ellipsis;
        word-break: break-word;
        white-space: normal;
    }

    .search-meta {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 11px;
        color: #6b7280;
        flex-wrap: wrap;
    }

    .search-mode {
        background: #e0e7ff;
        color: #3730a3;
        padding: 2px 6px;
        border-radius: 4px;
        font-weight: 500;
    }

    .search-time {
        background: #ecfdf5;
        color: #065f46;
        padding: 2px 6px;
        border-radius: 4px;
        font-weight: 500;
    }

    .search-timestamp {
        color: #9ca3af;
    }

    .search-actions {
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        opacity: 0;
        transition: opacity 0.2s ease;
    }

    .search-history-item:hover .search-actions {
        opacity: 1;
    }

    .search-actions button {
        background: none;
        border: none;
        color: #ef4444;
        cursor: pointer;
        padding: 4px;
        border-radius: 3px;
        font-size: 12px;
    }

    .search-actions button:hover {
        background: #fee2e2;
    }

    /* 이전 검색 결과 헤더 */
    .previous-search-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 16px 20px;
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        margin-bottom: 16px;
    }

    .previous-search-info {
        display: flex;
        align-items: center;
        gap: 8px;
        flex: 1;
    }

    .previous-search-info i {
        color: #6b7280;
        font-size: 16px;
    }

    .previous-query {
        font-weight: 600;
        color: #1f2937;
        font-size: 14px;
    }

    .previous-meta {
        font-size: 12px;
        color: #6b7280;
    }

    .new-search-btn-inline {
        padding: 8px 16px;
        background: #3b82f6;
        color: white;
        border: none;
        border-radius: 6px;
        font-size: 13px;
        font-weight: 500;
        cursor: pointer;
        transition: background 0.2s ease;
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .new-search-btn-inline:hover {
        background: #2563eb;
    }

    /* 이전 검색 결과 스타일 */
    .ai-search-result-section.previous-result {
        background: linear-gradient(135deg, #fefce8, #fef3c7);
        border: 2px solid #fbbf24;
    }

    /* 빠른 알림 애니메이션 */
    @keyframes slideInRight {
        from {
            transform: translateX(100%);
            opacity: 0;
        }
        to {
            transform: translateX(0);
            opacity: 1;
        }
    }

    @keyframes fadeOut {
        from {
            opacity: 1;
        }
        to {
            opacity: 0;
        }
    }

    /* 모바일 반응형 */
    @media (max-width: 768px) {
        .previous-search-header {
            flex-direction: column;
            gap: 12px;
            align-items: flex-start;
        }
        
        .previous-search-info {
            flex-direction: column;
            align-items: flex-start;
            gap: 4px;
        }
        
        .new-search-btn-inline {
            align-self: stretch;
        justify-content: center;
        }
        
        .search-meta {
        font-size: 10px;
            gap: 6px;
        }
        
        .search-mode,
        .search-time {
            padding: 1px 4px;
            font-size: 10px;
        }
    }

    /* 검색 결과 카드 스타일 개선 */
    .search-result {
        background: white;
        border-radius: 12px;
        padding: 24px;
        margin-bottom: 20px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
        border: 1px solid #f0f0f0;
        transition: all 0.3s ease;
        position: relative;
        overflow: hidden;
        display: flex;
        gap: 16px;
    }

    .search-result:hover {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
        transform: translateY(-2px);
        border-color: #e0e0e0;
    }

    /* 썸네일 이미지 스타일 */
    .result-thumbnail {
        flex-shrink: 0;
        width: 120px;
        height: 90px;
        border-radius: 8px;
        overflow: hidden;
        background: #f8f9fa;
        border: 1px solid #e9ecef;
    }

    .result-thumbnail img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.3s ease;
    }

    .result-thumbnail img:hover {
        transform: scale(1.05);
    }

    .result-thumbnail.no-image {
        display: flex;
        align-items: center;
        justify-content: center;
        color: #6c757d;
        font-size: 12px;
        background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    }

    .result-thumbnail.no-image::before {
        content: "🖼️";
        font-size: 24px;
        opacity: 0.5;
    }

    /* 결과 콘텐츠 영역 */
    .result-content {
        flex: 1;
        min-width: 0; /* flexbox에서 텍스트 오버플로우 방지 */
    }

    .result-title {
        font-size: 18px;
        font-weight: 600;
        color: #1a73e8;
        margin: 0 0 8px 0;
        line-height: 1.4;
        text-decoration: none;
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .result-title:hover {
        color: #1557b0;
        text-decoration: underline;
    }

    .result-snippet {
        color: #5f6368;
        line-height: 1.6;
        margin: 8px 0 12px 0;
        font-size: 14px;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .result-meta {
        display: flex;
        align-items: center;
        gap: 12px;
        flex-wrap: wrap;
        margin-top: 12px;
    }

    /* 도서 검색 특화 스타일 */
    .search-result.book-result {
        border-left: 4px solid #34a853;
    }

    .book-result .result-thumbnail {
        width: 80px;
        height: 120px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }

    .book-info {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
        margin-top: 8px;
        font-size: 13px;
        color: #5f6368;
    }

    .book-author, .book-publisher, .book-price {
        background: #f8f9fa;
        padding: 4px 8px;
        border-radius: 4px;
        border: 1px solid #e9ecef;
    }

    .book-price {
        color: #d73527;
        font-weight: 600;
    }

    /* 반응형 디자인 */
    @media (max-width: 768px) {
        .search-result {
            padding: 16px;
            flex-direction: column;
            gap: 12px;
        }
        
        .result-thumbnail {
            align-self: center;
            width: 100px;
            height: 75px;
        }
        
        .book-result .result-thumbnail {
            width: 60px;
            height: 90px;
        }
        
        .result-title {
            font-size: 16px;
            white-space: normal;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            display: -webkit-box;
            overflow: hidden;
        }
    }