/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f0f2f5;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: row;
}

/* 侧边栏 - 固定定位不随页面滚动 */
.sidebar {
    width: 320px !important;
    height: 100vh !important;
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    z-index: 1000;
    display: flex !important;
    flex-direction: column;
    flex-shrink: 0;
    box-shadow: 4px 0 20px rgba(0,0,0,0.3);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.sidebar.collapsed {
    transform: translateX(-320px);
}

body.sidebar-open .main-container {
    margin-left: 320px !important;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.sidebar-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: white;
}

.toggle-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    font-size: 14px;
    cursor: pointer;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    transition: background 0.2s;
}

.toggle-btn:hover {
    background: rgba(255,255,255,0.3);
}

.expand-btn {
    position: fixed;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    padding: 12px 10px;
    cursor: pointer;
    z-index: 999;
    box-shadow: 2px 2px 10px rgba(102, 126, 234, 0.4);
    color: white;
    font-size: 12px;
}

.expand-btn:hover {
    box-shadow: 4px 4px 15px rgba(102, 126, 234, 0.5);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    overscroll-behavior: contain;
}

.sidebar-content::-webkit-scrollbar {
    width: 6px;
}

.sidebar-content::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
}

.sidebar-content::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
}

.sidebar-search {
    margin-bottom: 20px;
}

.sidebar-search input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    font-size: 14px;
    background: rgba(255,255,255,0.1);
    color: white;
    transition: all 0.3s ease;
}

.sidebar-search input::placeholder {
    color: rgba(255,255,255,0.5);
}

.sidebar-search input:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(255,255,255,0.15);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 12px;
}

.icon-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    padding: 4px 10px;
    color: white;
    transition: all 0.3s ease;
}

.icon-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.folder-list, .report-list {
    max-height: none;
    overflow-y: auto;
}

.folder-list {
    margin-bottom: 20px;
}

/* 树形文件夹 */
.tree-folder {
    margin-bottom: 5px;
}

.tree-folder-header {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: rgba(255,255,255,0.9);
    background: rgba(255,255,255,0.05);
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.tree-folder-header:hover {
    background: rgba(102, 126, 234, 0.3);
    border-color: rgba(102, 126, 234, 0.5);
}

.tree-folder.expanded > .tree-folder-header {
    background: rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.3);
}

.folder-toggle {
    font-size: 10px;
    margin-right: 8px;
    color: rgba(255,255,255,0.5);
    transition: transform 0.2s;
}

.folder-icon {
    margin-right: 8px;
    font-size: 14px;
}

.folder-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.folder-count {
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    background: rgba(255,255,255,0.1);
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
}

.tree-folder-content {
    padding-left: 20px;
    margin-top: 2px;
}

.tree-folder-content .report-item {
    margin-left: 10px;
}

/* 报告项 */
.report-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 4px;
    transition: all 0.3s ease;
    background: rgba(255,255,255,0.03);
    border: 1px solid transparent;
    color: rgba(255,255,255,0.8);
}

.report-item:hover {
    background: rgba(102, 126, 234, 0.25);
    border-color: rgba(102, 126, 234, 0.4);
}

.report-item::before {
    content: "📊";
    margin-right: 10px;
    font-size: 14px;
}

.report-item .report-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

.report-item .report-name:hover {
    color: #667eea;
}

.report-item .report-date {
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    margin-left: 10px;
    margin-right: 8px;
}

/* 三点菜单按钮 */
.report-item .menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255,255,255,0.5);
    font-size: 16px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
    position: relative;
}

.report-item .menu-btn:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

/* 下拉菜单 */
.report-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.25);
    z-index: 3000;
    min-width: 140px;
    padding: 6px 0;
    display: none;
}

.report-dropdown.show {
    display: block;
}

.report-dropdown-item {
    padding: 10px 16px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    transition: background 0.2s;
}

.report-dropdown-item:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.report-dropdown-item.danger {
    color: #dc3545;
}

.report-dropdown-item.danger:hover {
    background: #dc3545;
    color: white;
}

.report-dropdown-divider {
    height: 1px;
    background: #eee;
    margin: 6px 0;
}

/* 主容器 */
.main-container {
    flex: 1;
    min-width: 0;
    padding: 30px;
    width: 100%;
}

/* 模态框 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 16px;
    min-width: 360px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.modal-content h4 {
    margin-bottom: 20px;
    font-size: 18px;
    color: #333;
    font-weight: 600;
}

.modal-content input,
.modal-content select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
    transition: border-color 0.3s;
}

.modal-content input:focus,
.modal-content select:focus {
    outline: none;
    border-color: #667eea;
}

.topic-validation-modal-content {
    text-align: center;
    padding: 30px 40px;
}

.topic-validation-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.topic-validation-modal-content h4 {
    margin-bottom: 12px;
    font-size: 18px;
    color: #333;
}

.topic-validation-modal-content p {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.topic-validation-modal-content strong {
    color: #667eea;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Toast 通知 */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    animation: toastIn 0.3s ease;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.toast.success {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.toast.error {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    color: white;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
}

.toast.hiding {
    animation: toastOut 0.3s ease forwards;
}

.btn-cancel, .btn-confirm {
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    border: none;
    font-weight: 500;
}

.btn-cancel {
    background: #f0f0f0;
    color: #666;
}

.btn-cancel:hover {
    background: #e0e0e0;
}

.btn-confirm {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-confirm:hover {
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* 浮动编辑工具栏 */
.floating-edit-toolbar {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    z-index: 9999;
}

.floating-edit-toolbar .btn-cancel {
    background: rgba(255,255,255,0.2);
    color: white;
}

.floating-edit-toolbar .btn-cancel:hover {
    background: rgba(255,255,255,0.3);
}

/* 可编辑状态的报告容器 */
.report-container.editable {
    border: 2px solid #667eea;
}

.report-container.editable [contenteditable="true"]:focus {
    outline: 2px solid #667eea;
    background-color: rgba(102, 126, 234, 0.05);
}

/* 页面标题 */
.page-header {
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.page-header p {
    font-size: 14px;
    color: #666;
}

/* 选择器面板 */
.selector-panel {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #e8e8e8;
}

.selector-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
    margin-bottom: 15px;
}

.selector-row:last-child {
    margin-bottom: 0;
}

.selector-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.selector-item.full-width {
    width: 100%;
}

.selector-item label {
    font-size: 13px;
    color: #666;
}

.required {
    color: #dc3545;
}

.selector-item select,
.selector-item input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    width: 180px;
    min-width: 120px;
    max-width: 240px;
}

.selector-item select:focus,
.selector-item input:focus {
    border-color: #667eea;
    outline: none;
}

.selector-item select:disabled,
.selector-item input:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

/* 日期范围 */
.date-range {
    display: flex;
    align-items: center;
    gap: 10px;
}

.date-range span {
    color: #999;
}

/* 话题分析面板 */
.topic-analysis-panel {
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e8e8e8;
    padding: 12px;
}

.topic-input-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.topic-input-item {
    flex: 1;
    min-width: 150px;
}

.topic-input-item input,
.topic-input-item select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    color: #333;
    box-sizing: border-box;
}

.topic-input-item input::placeholder {
    color: #aaa;
}

.topic-input-item select {
    cursor: pointer;
}

.topic-label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 6px;
    font-weight: 500;
}

.help-btn {
    display: inline-block;
    width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    background: #667eea;
    color: white;
    border-radius: 50%;
    font-size: 11px;
    cursor: pointer;
    margin-left: 5px;
    vertical-align: middle;
    position: relative;
}

.help-btn:hover {
    background: #764ba2;
}

.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border: 1px solid #667eea;
    color: #667eea;
    border-radius: 50%;
    font-size: 10px;
    cursor: pointer;
    margin-left: 4px;
    vertical-align: middle;
    position: relative;
}

.help-icon::after {
    content: attr(data-tip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: pre-line;
    width: 280px;
    line-height: 1.5;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 100;
    pointer-events: none;
    margin-bottom: 8px;
}

.help-icon:hover::after {
    visibility: visible;
    opacity: 1;
}

/* 帮助提示框 */
.help-btn .help-tooltip {
    display: none;
    position: absolute;
    left: 20px;
    top: 0;
    background: #333;
    color: #fff;
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.6;
    max-width: 400px;
    width: 400px;
    z-index: 10000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    white-space: pre-wrap;
    text-align: left;
}

.help-btn:hover .help-tooltip {
    display: block;
}

/* 复选框组 */
.checkbox-group {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    align-items: flex-start;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    padding: 4px 10px;
    background: white;
    border-radius: 4px;
    border: 1px solid #ddd;
    transition: all 0.2s ease;
    white-space: nowrap;
    margin: 2px;
}

.checkbox-label:hover {
    border-color: #667eea;
}

.checkbox-label.checked {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
}

/* 可折叠复选框组 */
.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 8px 12px;
    background: #f0f2f5;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.collapsible-header:hover {
    background: #e6e9ef;
}

.collapsible-header label {
    margin: 0;
}

.collapsible-icon {
    font-size: 12px;
    color: #666;
    transition: transform 0.3s ease;
}

.collapsible-header.expanded .collapsible-icon {
    transform: rotate(180deg);
}

.collapsible-content {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    max-height: 500px;
    opacity: 1;
}

.collapsible-content.collapsed {
    max-height: 0;
    opacity: 0;
}

/* 嵌套复选框样式 */
.data-source-parent {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.data-source-parent .parent-checkbox {
    font-weight: 600;
    background: #eef2ff;
    border-color: #c7d2fe;
}

.data-source-parent .parent-checkbox:hover {
    border-color: #667eea;
}

.child-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-left: 24px;
}

.child-checkbox {
    background: white;
}

/* 生成按钮 */
.generate-btn {
    padding: 10px 24px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 140px;
    justify-content: center;
}

.generate-btn:hover:not(:disabled) {
    background: #5a70d6;
}

.generate-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-icon {
    font-size: 16px;
}

/* 加载状态 */
.loading-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    min-height: calc(100vh - 250px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

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

.loading-state p {
    color: #666;
    margin-bottom: 10px;
}

.loading-state .loading-tip {
    font-size: 13px;
    color: #999;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    min-height: calc(100vh - 250px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.empty-icon {
    font-size: 60px;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 20px;
    color: #333;
    margin-bottom: 10px;
}

.empty-state p {
    font-size: 14px;
    color: #666;
}

/* 报告容器 */
.report-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    padding: 30px;
    min-height: calc(100vh - 250px);
    width: 100%;
}

/* 错误提示 */

/* 错误提示 */
.error-message {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* 响应式 */
@media (max-width: 1400px) {
    .main-container {
        padding: 20px;
    }

    .selector-item select,
    .selector-item input {
        width: 160px;
        min-width: 100px;
        max-width: 200px;
    }

    .multi-select {
        width: 160px;
        min-width: 100px;
        max-width: 200px;
    }
}

@media (max-width: 1100px) {
    .main-container {
        padding: 15px;
    }

    .selector-row {
        flex-wrap: wrap;
    }

    .selector-item select,
    .selector-item input {
        width: 140px;
        min-width: 100px;
        max-width: 180px;
    }

    .multi-select {
        width: 140px;
        min-width: 100px;
        max-width: 180px;
    }
}

@media (max-width: 768px) {
    .main-container {
        padding: 10px;
    }

    .selector-panel {
        padding: 15px;
    }

    .selector-row {
        flex-direction: column;
        align-items: stretch;
    }

    .selector-item select,
    .selector-item input {
        width: 100%;
        min-width: unset;
        max-width: 100%;
    }

    .multi-select {
        width: 100%;
        min-width: unset;
        max-width: 100%;
    }

    .checkbox-group {
        flex-direction: column;
        gap: 10px;
    }
}

/* 右键菜单 */
.context-menu {
    position: fixed;
    background: white;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    z-index: 3000;
    min-width: 160px;
    padding: 8px 0;
    overflow: hidden;
}

.context-menu-item {
    padding: 10px 18px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: background 0.2s;
}

.context-menu-item:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.context-menu-item.danger {
    color: #dc3545;
}

.context-menu-item.danger:hover {
    background: #dc3545;
    color: white;
}

.context-menu-divider {
    height: 1px;
    background: #eee;
    margin: 6px 0;
}

/* Tab切换样式 */
.tab-container {
    display: flex;
    gap: 0;
    margin-bottom: 25px;
    background: white;
    border-radius: 12px;
    padding: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    width: fit-content;
}

.tab-btn {
    padding: 12px 30px;
    border: none;
    background: transparent;
    font-size: 15px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    background: #f5f5f5;
}

.tab-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* 打印样式 - 隐藏非报告内容 */
@media print {
    /* 隐藏侧边栏、按钮等非报告内容 */
    .sidebar,
    .expand-btn,
    .tab-container,
    .selector-panel,
    .main-container > .tab-container,
    #edit-toolbar,
    #open-edit-btn,
    #empty-state,
    #loading-state,
    .context-menu,
    .report-dropdown,
    .modal {
        display: none !important;
    }

    /* 重置报告容器样式 */
    #report-container {
        display: block !important;
        width: 100%;
        margin: 0;
        padding: 0;
        background: white;
    }

    /* 避免分页切断内容 */
    .section {
        page-break-inside: avoid;
    }

    /* 图表容器设置高度 */
    .chart-container {
        height: 300px !important;
        page-break-inside: avoid;
    }

    /* 设置打印字体 */
    body {
        font-family: 'Microsoft YaHei', 'PingFang SC', 'SimHei', sans-serif !important;
        font-size: 12px;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* 打印页面设置 */
    @page {
        size: A4 landscape;
        margin: 10mm;
    }
}

/* ============================================
   多选下拉框样式
   ============================================ */

.multi-select {
    position: relative;
    width: 180px;
    min-width: 120px;
    max-width: 240px;
    font-size: 14px;
}

/* 触发器 */
.multi-select-trigger {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;
    padding: 8px 12px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    min-height: 38px;
    transition: border-color 0.2s;
    overflow: hidden;
}

.multi-select-trigger:hover {
    border-color: #667eea;
}

.multi-select-trigger.active {
    border-color: #667eea;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.multi-select-placeholder {
    color: #999;
    font-size: 14px;
}

.multi-select-tags {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    flex: 1;
    overflow: hidden;
    min-width: 0;
}

.multi-select-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    background: #667eea;
    color: white;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
}

.multi-select-tag-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.multi-select-tag-remove {
    cursor: pointer;
    opacity: 0.8;
    font-size: 14px;
}

.multi-select-tag-remove:hover {
    opacity: 1;
}

.multi-select-arrow {
    font-size: 10px;
    color: #666;
    transition: transform 0.2s;
    margin-left: auto;
}

.multi-select-trigger.active .multi-select-arrow {
    transform: rotate(180deg);
}

/* 下拉面板 */
.multi-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #667eea;
    border-top: none;
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.multi-select-dropdown.show {
    display: block;
}

/* 选项容器 */
.multi-select-options {
    padding: 8px 0;
}

/* 选项 */
.multi-select-option {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.15s;
}

.multi-select-option:hover {
    background: #f5f7ff;
}

.multi-select-option.selected {
    background: #eef2ff;
    color: #667eea;
}

.multi-select-option-checkmark {
    width: 16px;
    height: 16px;
    border: 2px solid #ddd;
    border-radius: 3px;
    margin-right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
}

.multi-select-option.selected .multi-select-option-checkmark {
    background: #667eea;
    border-color: #667eea;
}

.multi-select-option.selected .multi-select-option-checkmark::after {
    content: '✓';
    color: white;
    font-size: 11px;
}

.multi-select-option-text {
    flex: 1;
    font-size: 14px;
}

/* 分组多选样式 - 用于数据来源 */
.multi-select-grouped .multi-select-options {
    padding: 0;
}

.multi-select-group {
    margin-bottom: 4px;
}

.multi-select-group-title {
    padding: 8px 12px 4px;
    font-size: 12px;
    font-weight: 600;
    color: #667eea;
    background: #f8f9ff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.multi-select-group-title:first-child {
    padding-top: 4px;
}

.multi-select-child-option {
    padding-left: 24px;
}

.multi-select-child-option .multi-select-option-text {
    font-size: 13px;
}

/* 无选中项时隐藏placeholder */
.multi-select.has-selected .multi-select-placeholder {
    display: none;
}

/* 话题分析情感洞察列表 - 纵向布局，与其他洞察风格一致 */
.topic-insight-list {
    list-style: none;
    padding: 0;
    margin: 15px 0;
}

.topic-insight-list li {
    padding: 12px 15px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 4px;
}

.topic-viewpoint-item.positive {
    border-left: 4px solid #4caf50;
}

.topic-viewpoint-item.neutral {
    border-left: 4px solid #ff9800;
}

.topic-viewpoint-item.negative {
    border-left: 4px solid #f44336;
}

.topic-viewpoint-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.topic-viewpoint-label {
    font-weight: 600;
    font-size: 13px;
    padding: 2px 8px;
    border-radius: 3px;
    color: white;
}

.topic-viewpoint-item.positive .topic-viewpoint-label {
    background: #4caf50;
}

.topic-viewpoint-item.neutral .topic-viewpoint-label {
    background: #ff9800;
}

.topic-viewpoint-item.negative .topic-viewpoint-label {
    background: #f44336;
}

.topic-viewpoint-title {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.topic-viewpoint-prop {
    color: #666;
    font-size: 13px;
}

.topic-viewpoint-comment {
    font-size: 13px;
    color: #555;
    line-height: 1.5;
    padding-left: 10px;
    border-left: 2px solid #e0e0e0;
    margin-top: 6px;
}

.topic-viewpoint-empty {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 15px;
}

.viewpoint-empty {
    font-size: 13px;
    color: #888;
    text-align: center;
    padding: 20px 0;
}
