/**
 * D3 看板 AI 解读 — 样式表
 *
 * CSS 前缀: adi- (acquisition dashboard insight)
 * 架构基线: .workbuddy/specs/acquisition-ai-capabilities/03-system-architecture.md
 */

/* ═══════════════════════════════════════════════════
   面板容器
   ═══════════════════════════════════════════════════ */

.adi-panel {
    margin-top: 24px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ═══════════════════════════════════════════════════
   头部区域
   ═══════════════════════════════════════════════════ */

.adi-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.adi-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.adi-header-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.adi-header-title .adi-icon {
    width: 18px;
    height: 18px;
}

.adi-header-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.adi-generated-at {
    font-size: 12px;
    color: #9ca3af;
}

/* ═══════════════════════════════════════════════════
   来源标签
   ═══════════════════════════════════════════════════ */

.adi-source-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
    line-height: 18px;
}

.adi-source-ai {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.adi-source-rule {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #e5e7eb;
}

/* ═══════════════════════════════════════════════════
   刷新按钮
   ═══════════════════════════════════════════════════ */

.adi-refresh-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 12px;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.5;
}

.adi-refresh-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    color: #111827;
}

.adi-refresh-btn:active {
    background: #e5e7eb;
}

.adi-refresh-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.adi-refresh-btn .adi-refresh-icon {
    display: inline-block;
    width: 14px;
    height: 14px;
    transition: transform 0.3s ease;
}

.adi-refresh-btn.is-spinning .adi-refresh-icon {
    animation: adi-spin 0.8s linear infinite;
}

@keyframes adi-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════════════
   摘要区域
   ═══════════════════════════════════════════════════ */

.adi-summary {
    font-size: 15px;
    line-height: 1.7;
    color: #1f2937;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    margin-bottom: 16px;
}

/* ═══════════════════════════════════════════════════
   列表区域（亮点 & 警告）
   ═══════════════════════════════════════════════════ */

.adi-section {
    margin-bottom: 14px;
}

.adi-section-title {
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.adi-item-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.adi-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 0;
    font-size: 13px;
    line-height: 1.5;
    color: #374151;
}

/* 亮点 */
.adi-highlights {
    /* container */
}

.adi-highlights .adi-item {
    padding-left: 12px;
    border-left: 3px solid #22c55e;
    margin-bottom: 4px;
}

.adi-highlights .adi-item-icon {
    color: #22c55e;
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 1px;
}

/* 警告 */
.adi-warnings {
    /* container */
}

.adi-warnings .adi-item {
    padding-left: 12px;
    border-left: 3px solid #f59e0b;
    margin-bottom: 4px;
}

.adi-warnings .adi-item-icon {
    color: #f59e0b;
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ═══════════════════════════════════════════════════
   建议卡片
   ═══════════════════════════════════════════════════ */

.adi-suggestions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.adi-suggestion-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    transition: border-color 0.2s ease;
}

.adi-suggestion-card:hover {
    border-color: #93c5fd;
}

.adi-suggestion-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #eff6ff;
    color: #2563eb;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
}

.adi-suggestion-text {
    font-size: 13px;
    line-height: 1.5;
    color: #374151;
}

/* ═══════════════════════════════════════════════════
   数据故事
   ═══════════════════════════════════════════════════ */

.adi-data-story {
    font-style: italic;
    font-size: 13px;
    line-height: 1.7;
    color: #6b7280;
    padding: 10px 16px;
    border-left: 3px solid #d1d5db;
    background: #fff;
    border-radius: 0 6px 6px 0;
    margin-bottom: 0;
}

/* ═══════════════════════════════════════════════════
   加载态 — 骨架屏
   ═══════════════════════════════════════════════════ */

.adi-loading {
    padding: 12px 0;
}

.adi-skeleton {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.adi-skeleton-line {
    height: 14px;
    background: #e5e7eb;
    border-radius: 4px;
    animation: adi-pulse 1.5s ease-in-out infinite;
}

.adi-skeleton-line:nth-child(1) {
    width: 65%;
    height: 16px;
}

.adi-skeleton-line:nth-child(2) {
    width: 80%;
    height: 12px;
}

.adi-skeleton-line:nth-child(3) {
    width: 50%;
    height: 12px;
}

.adi-skeleton-line:nth-child(4) {
    width: 72%;
    height: 12px;
}

.adi-skeleton-line:nth-child(5) {
    width: 40%;
    height: 14px;
}

.adi-skeleton-block {
    height: 60px;
    background: #e5e7eb;
    border-radius: 6px;
    animation: adi-pulse 1.5s ease-in-out infinite;
    margin-top: 4px;
}

@keyframes adi-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.4;
    }
}

/* ═══════════════════════════════════════════════════
   空态
   ═══════════════════════════════════════════════════ */

.adi-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    text-align: center;
}

.adi-empty-icon {
    font-size: 36px;
    color: #d1d5db;
    margin-bottom: 12px;
}

.adi-empty-text {
    font-size: 14px;
    color: #9ca3af;
    margin-bottom: 12px;
}

/* ═══════════════════════════════════════════════════
   错误态
   ═══════════════════════════════════════════════════ */

.adi-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 20px;
    text-align: center;
}

.adi-error-icon {
    font-size: 32px;
    color: #f87171;
    margin-bottom: 10px;
}

.adi-error-text {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 12px;
}

.adi-error-retry-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
}

.adi-error-retry-btn:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
}

/* ═══════════════════════════════════════════════════
   响应式 — 768px 断点
   ═══════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .adi-panel {
        padding: 16px;
        margin-top: 16px;
    }

    .adi-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .adi-header-meta {
        width: 100%;
        justify-content: space-between;
    }

    .adi-summary {
        font-size: 14px;
        padding: 10px 12px;
    }

    .adi-suggestion-card {
        padding: 8px 12px;
    }

    .adi-data-story {
        font-size: 12px;
        padding: 8px 12px;
    }
}

/* ═══════════════════════════════════════════════════
   响应式 — 480px 断点
   ═══════════════════════════════════════════════════ */

@media (max-width: 480px) {
    .adi-panel {
        padding: 12px;
        border-radius: 6px;
        margin-top: 12px;
    }

    .adi-header-title {
        font-size: 14px;
    }

    .adi-header-meta {
        flex-wrap: wrap;
        gap: 6px;
    }

    .adi-source-badge {
        font-size: 10px;
        padding: 1px 6px;
    }

    .adi-refresh-btn {
        font-size: 11px;
        padding: 3px 8px;
    }

    .adi-generated-at {
        font-size: 11px;
    }

    .adi-summary {
        font-size: 13px;
    }

    .adi-item {
        font-size: 12px;
    }

    .adi-suggestion-card {
        padding: 6px 10px;
    }

    .adi-suggestion-text {
        font-size: 12px;
    }

    .adi-data-story {
        font-size: 12px;
    }

    .adi-empty {
        padding: 20px 12px;
    }

    .adi-error {
        padding: 20px 12px;
    }
}
