/* ==================== 核心指标卡片 ==================== */
.indicator-cards-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.indicator-card {
    flex: 1 1 calc(14.28% - 1rem);
    min-width: 140px;
    background: #fff;
    border-radius: 10px;
    padding: 1rem 0.75rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.indicator-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.indicator-card-name {
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.indicator-card-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #007bff;
    margin-bottom: 0.25rem;
}

.indicator-card-avg {
    font-size: 0.75rem;
    color: #adb5bd;
    margin-bottom: 0.25rem;
}

.indicator-card-diff {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
}

.indicator-card-diff.positive {
    background: #e6f7ed;
    color: #28a745;
}

.indicator-card-diff.negative {
    background: #fde8e8;
    color: #dc3545;
}

.indicator-card-diff.neutral {
    background: #f0f0f0;
    color: red;
}

/* ==================== 案例列表页 ==================== */
.case-list-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    min-height: 80vh;
}

.case-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.case-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.case-card-image-wrapper {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.case-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.case-card:hover .case-card-image {
    transform: scale(1.08);
}

.case-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.case-card:hover .case-card-overlay {
    opacity: 1;
}

.case-card-body {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.case-card-title {
    font-weight: 700;
    font-size: 1.15rem;
    margin-bottom: 0.25rem;
    color: #1a1a2e;
}

.case-card-company {
    margin-bottom: 0.75rem;
}

.case-card-metrics {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.metric-item {
    flex: 1;
    text-align: center;
}

.metric-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: #0066cc;
}

.metric-label {
    display: block;
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 2px;
}

.case-card-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: auto;
}

.keyword-tag {
    display: inline-block;
    padding: 3px 10px;
    background: #e7f1ff;
    color: #0066cc;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 500;
}

/* ==================== 案例详情页 ==================== */
.case-detail-section {
    background: #f5f7fa;
    min-height: 80vh;
    padding-bottom: 3rem;
}

.case-detail-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    padding: 2.5rem 0;
    margin-bottom: 2rem;
}

.case-detail-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.case-detail-header .brand {
    font-size: 1rem;
    opacity: 0.85;
}

.case-detail-header .keywords {
    margin-top: 0.75rem;
}

.case-detail-header .keyword-tag-light {
    display: inline-block;
    padding: 3px 12px;
    background: rgba(255,255,255,0.15);
    color: #fff;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-right: 6px;
}

.case-nav-tabs {
    border-bottom: 2px solid #dee2e6;
    margin-bottom: 1.5rem;
}

.case-nav-tabs .nav-link {
    font-weight: 600;
    color: #6c757d;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 0.75rem 1.5rem;
}

.case-nav-tabs .nav-link.active {
    color: #0066cc;
    border-bottom-color: #0066cc;
    background: none;
}

.chart-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.chart-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #1a1a2e;
    border-left: 4px solid #0066cc;
    padding-left: 0.75rem;
}

.chart-container {
    width: 100%;
    height: 320px;
}

.competitor-table {
    width: 100%;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.competitor-table th {
    background: #1a1a2e;
    color: #fff;
    font-weight: 600;
    padding: 0.875rem 1rem;
    font-size: 0.9rem;
}

.competitor-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.9rem;
}

.competitor-table tr:last-child td {
    border-bottom: none;
}

.competitor-table .highlight-row {
    background: #e7f1ff;
    font-weight: 600;
}

.platform-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px 5px 10px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-right: 6px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.2s;
    border: 0;
    outline: none;
}

.platform-badge .tab-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    border-radius: 4px;
}

.platform-badge.active {
    background: #0066cc;
    color: #fff;
}

.platform-badge:not(.active) {
    background: #e9ecef;
    color: #495057;
}

.platform-badge:not(.active):hover {
    background: #dee2e6;
}

.ranking-table {
    width: 100%;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.ranking-table th {
    background: #1a1a2e;
    color: #fff;
    font-weight: 600;
    padding: 0.75rem;
    font-size: 0.85rem;
}

.ranking-table td {
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.85rem;
    vertical-align: middle;
}

.ranking-table tr:hover td {
    background: #f8f9fa;
}

/* ==================== 聊天弹窗样式 ==================== */
.chat-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 10px;
}

/* 用户消息行（右侧） */
.chat-row.user-row {
    display: flex;
    justify-content: flex-end;
}

.chat-row.user-row .user-bubble {
    background: #e8e8e8;
    color: #333;
    padding: 10px 14px;
    border-radius: 12px;
    border-bottom-right-radius: 2px;
    font-size: 0.9rem;
    line-height: 1.5;
    word-break: break-word;
    max-width: 80%;
}

/* AI消息行（左侧，带头像） */
.chat-row.ai-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    object-fit: contain;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid #e9ecef;
    padding: 2px;
}

.chat-ai-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    max-width: 85%;
}

.chat-ai-content .ai-bubble {
    background: #fff;
    color: #333;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    border-bottom-left-radius: 2px;
    font-size: 0.9rem;
    line-height: 1.5;
    word-break: break-word;
}

/* 参考来源（AI回复左下侧） */
.chat-ref {
    margin-top: 6px;
    margin-left: 2px;
}

.chat-ref-toggle {
    color: #e60012;
    font-size: 0.85rem;
    text-decoration: none;
    cursor: pointer;
}

.chat-ref-toggle:hover {
    text-decoration: underline;
}

.chat-ref-list {
    margin-top: 6px;
    padding: 8px 12px;
    background: #fafafa;
    border-radius: 8px;
    border-left: 3px solid #e60012;
}

.chat-ref-item {
    font-size: 0.82rem;
    line-height: 1.8;
    color: #555;
}

.chat-ref-no {
    color: #999;
    margin-right: 4px;
}

.chat-ref-source {
    margin-right: 8px;
}

.chat-ref-link {
    color: #e60012;
    text-decoration: none;
}

.chat-ref-link:hover {
    text-decoration: underline;
}
