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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: linear-gradient(135deg, #e8f4fc 0%, #d4e9f7 100%);
    min-height: 100vh;
    color: #333;
}

/* SVG图标样式 */
.icon {
    width: 18px;
    height: 18px;
    display: inline-block;
    vertical-align: middle;
}

.icon-sm {
    width: 14px;
    height: 14px;
    display: inline-block;
    vertical-align: middle;
}

.app-container {
    display: flex;
    min-height: 100vh;
    max-width: 1920px;
    margin: 0 auto;
}

/* 左侧边栏 */
.sidebar-left {
    width: 240px;
    background: #fff;
    border-right: 1px solid #e0e6ed;
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    padding: 0 20px 20px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 15px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: linear-gradient(135deg, #4A90D9, #5BA3E8);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    margin-right: 10px;
}

.logo span {
    font-size: 14px;
    font-weight: 600;
    color: #4A90D9;
}

.btn-new-chat {
    margin: 0 15px 20px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #4A90D9 0%, #5BA3E8 100%);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-new-chat:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(74, 144, 217, 0.3);
}

.history-section {
    padding: 0 20px;
    flex: 1;
    overflow-y: auto;
}

.history-group {
    margin-bottom: 15px;
}

.history-group h4 {
    font-size: 12px;
    color: #999;
    font-weight: normal;
    margin-bottom: 8px;
}

.history-item {
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-item:hover {
    background: #f5f7fa;
    color: #4A90D9;
}

.nav-menu {
    padding: 15px 0;
    border-top: 1px solid #f0f0f0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
    position: relative;
}

.nav-item i,
.nav-item svg.icon {
    width: 18px;
    height: 18px;
    margin-right: 12px;
    flex-shrink: 0;
}

.nav-item:hover,
.nav-item.active {
    color: #4A90D9;
    background: linear-gradient(90deg, rgba(74,144,217,0.1) 0%, transparent 100%);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #4A90D9;
}

/* 中间主区域 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px 40px;
    min-width: 500px;
}

.chat-header {
    margin-bottom: 20px;
}

.ai-welcome {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    color: #333;
}

.ai-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4A90D9, #5BA3E8);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
}

.chat-body {
    flex: 1;
    overflow-y: auto;
    padding-right: 10px;
}

/* 搜索结果区域 */
.search-results {
    display: none;
}

.search-results.active {
    display: block;
}

.result-section {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    margin-bottom: 16px;
    overflow: hidden;
}

.result-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(90deg, #f8fbfe 0%, #fff 100%);
    border-bottom: 1px solid #e8edf2;
}

.result-section-header h3 {
    font-size: 14px;
    color: #4A90D9;
    font-weight: 600;
}

.result-section-header .badge {
    background: #4A90D9;
    color: white;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 12px;
}

.result-list {
    max-height: 400px;
    overflow-y: auto;
}

.result-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f3f5;
    transition: background 0.15s;
    cursor: pointer;
}

.result-item:last-child {
    border-bottom: none;
}

.result-item:hover {
    background: #f5f9fd;
}

.result-item-title {
    font-size: 14px;
    color: #333;
    margin-bottom: 6px;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.result-item-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: #999;
    flex-wrap: wrap;
}

.result-item-meta .tag {
    background: #eef4fa;
    color: #4A90D9;
    padding: 1px 8px;
    border-radius: 4px;
}

.result-item-meta .tag.green {
    background: #e8f8ee;
    color: #52c41a;
}

.result-item-meta .tag.orange {
    background: #fff7e6;
    color: #fa8c16;
}

.load-more {
    text-align: center;
    padding: 10px;
}

.load-more button {
    background: transparent;
    border: 1px solid #d0d8e0;
    color: #4A90D9;
    padding: 6px 20px;
    border-radius: 16px;
    cursor: pointer;
    font-size: 13px;
}

.load-more button:hover {
    background: #4A90D9;
    color: white;
    border-color: #4A90D9;
}

/* 示例问题区域 */
.suggestions-section {
    background: rgba(255, 255, 255, 0.6);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 20px;
}

.suggestions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.suggestions-header span {
    font-size: 14px;
    color: #666;
}

.btn-refresh {
    background: transparent;
    border: none;
    color: #4A90D9;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.subscriptions h5 {
    font-size: 14px;
    color: #333;
    margin-bottom: 15px;
    font-weight: 600;
}

.subscription-tags {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tag-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tag {
    background: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    color: #666;
    border: 1px solid #e0e6ed;
    cursor: pointer;
    transition: all 0.2s;
}

.tag:hover {
    border-color: #4A90D9;
    color: #4A90D9;
}

.quick-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.action-btn {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid #d0d8e0;
    border-radius: 20px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    background: #fff;
    border-color: #4A90D9;
    color: #4A90D9;
}

/* 搜索中 loading */
.loading {
    text-align: center;
    padding: 40px;
    color: #999;
    display: none;
}

.loading.active {
    display: block;
}

.loading-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 2px solid #e0e6ed;
    border-top-color: #4A90D9;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 10px;
}

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

/* SVG旋转动画 */
@keyframes svg-spin {
    to { transform: rotate(360deg); }
}

svg.fa-spin,
svg[class*="fa-spin"] {
    animation: svg-spin 1s linear infinite;
}

/* 输入区域 - 固定在底部 */
.chat-input-area {
    position: sticky;
    bottom: 0;
    margin-top: auto;
    padding: 16px 0;
    background: linear-gradient(to top, #fff 85%, transparent);
    z-index: 10;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: #f7f8fa;
    border-radius: 28px;
    padding: 8px 8px 8px 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 2px solid #e8eef5;
    gap: 10px;
    transition: all 0.3s;
}

.input-wrapper:focus-within {
    border-color: #4A90D9;
    box-shadow: 0 4px 20px rgba(74, 144, 217, 0.15);
}

.chat-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    padding: 14px 0;
    color: #333;
    background: transparent;
    line-height: 1.4;
}

.chat-input::placeholder {
    color: #999;
}

.btn-send {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #4A90D9, #5BA3E8);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(74, 144, 217, 0.3);
}

.btn-send:hover {
    background: linear-gradient(135deg, #3a7bc8, #4A90D9);
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(74, 144, 217, 0.4);
}

.btn-send:disabled {
    background: #d0d8e8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-reset {
    background: #fff;
    color: #4A90D9;
    border: 1px solid #4A90D9;
    border-radius: 20px;
    padding: 10px 18px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-reset:hover {
    background: #4A90D9;
    color: #fff;
}
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}

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

.chat-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    padding: 12px 0;
    color: #333;
    background: transparent;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 12px;
    padding-bottom: 4px;
}

.footer-links a {
    font-size: 12px;
    color: #999;
    text-decoration: none;
}

.footer-links a:hover {
    color: #4A90D9;
}

/* 搜索状态头部 */
.search-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 14px;
}

.footer-links a {
    font-size: 12px;
    color: #999;
    text-decoration: none;
}

.footer-links a:hover {
    color: #4A90D9;
}

/* 右侧边栏 */
.sidebar-right {
    width: 280px;
    background: #fff;
    border-left: 1px solid #e0e6ed;
    padding: 20px;
    flex-shrink: 0;
    overflow-y: auto;
}

.auth-section {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.auth-link {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #07C160;
    text-decoration: none;
}

.auth-link svg.icon,
.auth-link i {
    width: 18px;
    height: 18px;
}

.members-section h4 {
    font-size: 14px;
    color: #333;
    margin-bottom: 15px;
    font-weight: 600;
}

.members-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.member-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s;
}

.member-item:hover {
    background: #f5f7fa;
}

.member-item img,
.member-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.member-avatar {
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

.member-item span {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #c0c8d0;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a0a8b0;
}

/* 响应式 */
@media (max-width: 1200px) {
    .sidebar-right {
        display: none;
    }
}

@media (max-width: 768px) {
    .sidebar-left {
        display: none;
    }
    
    .main-content {
        padding: 12px;
        min-width: auto;
    }
    
    .chat-header {
        margin-bottom: 12px;
    }
    
    .ai-welcome {
        font-size: 14px;
    }
    
    .ai-avatar {
        width: 40px;
        height: 40px;
        font-size: 15px;
    }
    
    .suggestions-section {
        padding: 16px;
        border-radius: 12px;
        margin-bottom: 12px;
    }
    
    .tag {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .tag-row {
        gap: 8px;
    }
    
    .quick-actions {
        gap: 8px;
    }
    
    .action-btn {
        padding: 8px 14px;
        font-size: 12px;
    }
    
    .chat-input {
        font-size: 16px; /* 防止iOS自动缩放 */
    }
    
    .input-wrapper {
        padding: 4px 4px 4px 16px;
    }
    
    .footer-links {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .footer-links a {
        font-size: 11px;
    }
    
    .result-section {
        border-radius: 8px;
    }
    
    .result-section-header {
        padding: 10px 12px;
    }
    
    .result-section-header h3 {
        font-size: 13px;
    }
    
    .result-item {
        padding: 10px 12px;
    }
    
    .result-item-title {
        font-size: 13px;
    }
    
    .result-list {
        max-height: 300px;
    }
}

/* 超小屏幕 */
@media (max-width: 380px) {
    .main-content {
        padding: 8px;
    }
    
    .tag-row .tag {
        padding: 5px 10px;
        font-size: 11px;
    }
    
    .quick-actions .action-btn {
        padding: 6px 10px;
        font-size: 11px;
    }
}

/* 商机报告标签页样式 */
.opp-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 16px;
}

.opp-tab {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #e0e0e0;
    white-space: nowrap;
}

.opp-tab:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.opp-tab.active {
    color: #fff;
    border-color: transparent;
}

.opp-tab .tab-icon {
    font-size: 14px;
}

.opp-tab .tab-count {
    background: rgba(0,0,0,0.1);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}

.opp-tab.active .tab-count {
    background: rgba(255,255,255,0.3);
}

/* 标签分类颜色 */
.opp-tab-intention { border-color: #9b59b6; }
.opp-tab-intention.active { background: linear-gradient(135deg, #9b59b6, #8e44ad); }

.opp-tab-tender { border-color: #e67e22; }
.opp-tab-tender.active { background: linear-gradient(135deg, #e67e22, #d35400); }

.opp-tab-award { border-color: #27ae60; }
.opp-tab-award.active { background: linear-gradient(135deg, #27ae60, #2ecc71); }

.opp-tab-front { border-color: #e53935; }
.opp-tab-front.active { background: linear-gradient(135deg, #e53935, #c62828); }

.opp-tab-contract { border-color: #3498db; }
.opp-tab-contract.active { background: linear-gradient(135deg, #3498db, #2980b9); }

.opp-tab-budget_detail { border-color: #f39c12; }
.opp-tab-budget_detail.active { background: linear-gradient(135deg, #f39c12, #e67e22); }

.opp-tab-budget { border-color: #009688; }
.opp-tab-budget.active { background: linear-gradient(135deg, #009688, #00796b); }

.opp-tab-card { border-color: #c62828; }
.opp-tab-card.active { background: linear-gradient(135deg, #c62828, #b71c1c); }

/* 商机报告头部样式 */
.opportunity-header {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.opportunity-header-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.opportunity-header h3 {
    font-size: 16px;
    color: #333;
    margin: 0;
}

.opportunity-header .badge {
    background: #e8f4fc;
    color: #4A90D9;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
}

.opportunity-total {
    display: flex;
    align-items: center;
    gap: 8px;
}

.opportunity-total-label {
    font-size: 13px;
    color: #666;
}

.opportunity-total-amount {
    font-size: 18px;
    font-weight: 700;
    color: #e67e22;
}

/* 生成详细报告按钮 */
.opp-report-btn {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.opp-report-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .opp-tabs {
        gap: 6px;
        padding: 10px;
    }
    
    .opp-tab {
        padding: 6px 10px;
        font-size: 12px;
        border-radius: 16px;
    }
    
    .opp-tab .tab-icon {
        font-size: 12px;
    }
    
    .opp-tab .tab-count {
        padding: 1px 6px;
        font-size: 11px;
    }
    
    .opportunity-header {
        padding: 12px;
    }
    
    .opportunity-header h3 {
        font-size: 14px;
    }
    
    .opportunity-header-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .opportunity-header-row:last-child {
        width: 100%;
        justify-content: space-between;
        flex-direction: row;
    }
    
    .opp-report-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .opportunity-total-amount {
        font-size: 16px;
    }
}

/* ========== 分类统计标签栏优化 ========== */
.result-stats-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 0;
    margin-bottom: 16px;
    border-bottom: 1px solid #eee;
}

.result-stats-bar > div {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.result-stats-bar > div:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.result-stats-bar > div strong {
    font-size: 16px;
    margin-left: 4px;
}

/* ========== 列表项卡片优化 ========== */
.result-section {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 16px;
    overflow: hidden;
}

.result-section-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
    padding: 14px 16px;
    border-bottom: 1px solid #eee;
}

.result-section-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-list {
    padding: 8px 0;
}

.result-item {
    padding: 14px 16px;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    transition: all 0.2s ease;
}

.result-item:hover {
    background: linear-gradient(135deg, #f0f7ff 0%, #fff 100%);
    transform: translateX(4px);
}

.result-item:last-child {
    border-bottom: none;
}

.result-item-title {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.5;
}

.result-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.result-item-meta .tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.result-item-meta .tag.green {
    background: #e8f8f0;
    color: #27ae60;
}

.result-item-meta .tag.orange {
    background: #fef5e7;
    color: #e67e22;
}

/* ========== 加载更多按钮优化 ========== */
.load-more {
    padding: 16px;
    text-align: center;
}

.load-more button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(102,126,234,0.3);
}

.load-more button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102,126,234,0.4);
}

/* ========== 空状态优化 ========== */
.empty-message {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-message svg {
    width: 48px;
    height: 48px;
    opacity: 0.5;
}

/* ========== 二维码样式 ========== */
.auth-section {
    padding: 20px;
    text-align: center;
}

.qr-code-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.qr-code-img {
    width: 180px;
    height: 180px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border: 3px solid #fff;
    transition: transform 0.2s ease;
}

.qr-code-img:hover {
    transform: scale(1.05);
}

.qr-code-text {
    font-size: 14px;
    color: #666;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.qr-code-text::before {
    content: "📱";
    font-size: 16px;
}
