/**
 * A3 流失挽回自动化 — 样式表
 *
 * CSS 前缀: are-
 */

/* ═══════════════════════════════════════════════════
   布局容器
   ═══════════════════════════════════════════════════ */

.are-page {
    padding: 24px;
    max-width: 1440px;
    margin: 0 auto;
}

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

.are-title {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

.are-subtitle {
    font-size: 13px;
    color: #8c8c8c;
    margin-top: 4px;
    font-weight: normal;
}

/* ═══════════════════════════════════════════════════
   统计卡片
   ═══════════════════════════════════════════════════ */

.are-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.are-stats-card {
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.are-stats-card--total   { border-left: 4px solid #1890ff; }
.are-stats-card--pending { border-left: 4px solid #faad14; }
.are-stats-card--executed { border-left: 4px solid #52c41a; }
.are-stats-card--success { border-left: 4px solid #13c2c2; }

.are-stats-label {
    font-size: 12px;
    color: #8c8c8c;
}

.are-stats-value {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.2;
}

.are-stats-desc {
    font-size: 11px;
    color: #bfbfbf;
}

/* ═══════════════════════════════════════════════════
   筛选栏
   ═══════════════════════════════════════════════════ */

.are-filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 10px 16px;
    background: #fafafa;
    border-radius: 8px;
}

.are-filter-label {
    font-size: 13px;
    color: #595959;
    font-weight: 500;
}

.are-filter-select {
    padding: 6px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 13px;
    color: #1a1a1a;
    background: #fff;
    cursor: pointer;
    outline: none;
}

.are-filter-select:focus {
    border-color: #1890ff;
}

/* ═══════════════════════════════════════════════════
   任务卡片
   ═══════════════════════════════════════════════════ */

.are-task-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.are-task-card {
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow 0.2s;
}

.are-task-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}

.are-card--pending  { border-left: 4px solid #faad14; }
.are-card--executed { border-left: 4px solid #52c41a; }
.are-card--success  { border-left: 4px solid #13c2c2; }

.are-task-card--expanded {
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.are-card-main {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
}

.are-card-status {
    min-width: 70px;
}

.are-status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.are-card-info {
    flex: 1;
    min-width: 0;
}

.are-card-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.are-card-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: #8c8c8c;
}

.are-card-reason {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 90px;
}

.are-reason-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.are-reason-tag--price         { background: #fff2f0; color: #ff4d4f; }
.are-reason-tag--competitor    { background: #fff7e6; color: #d48806; }
.are-reason-tag--need_mismatch { background: #e6f7ff; color: #1890ff; }
.are-reason-tag--on_hold       { background: #f5f5f5; color: #8c8c8c; }
.are-reason-tag--other         { background: #f6ffed; color: #52c41a; }
.are-reason-tag--unknown       { background: #f5f5f5; color: #bfbfbf; }

.are-confidence {
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 3px;
    font-weight: 500;
}

.are-confidence--high   { background: #f6ffed; color: #52c41a; }
.are-confidence--medium { background: #fffbe6; color: #d48806; }
.are-confidence--low    { background: #fff2f0; color: #ff4d4f; }

.are-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    justify-content: flex-end;
}

/* ═══════════════════════════════════════════════════
   按钮
   ═══════════════════════════════════════════════════ */

.are-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    white-space: nowrap;
}

.are-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.are-btn--primary {
    background: #1890ff;
    color: #fff;
}

.are-btn--primary:hover:not(:disabled) {
    background: #1677cc;
}

.are-btn--text {
    background: none;
    color: #1890ff;
    border: 1px solid transparent;
}

.are-btn--text:hover:not(:disabled) {
    background: #e6f7ff;
}

.are-btn--loading {
    background: #f5f5f5;
    color: #8c8c8c;
}

/* ═══════════════════════════════════════════════════
   详情面板
   ═══════════════════════════════════════════════════ */

.are-detail-panel {
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
    padding: 16px 20px;
}

.are-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.are-detail-section {
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    padding: 12px 14px;
}

.are-detail-section--script {
    grid-column: 1 / -1;
}

.are-detail-section-title {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f5f5f5;
}

.are-detail-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 6px;
    font-size: 12px;
    line-height: 1.6;
}

.are-detail-label {
    color: #8c8c8c;
    min-width: 70px;
    flex-shrink: 0;
}

.are-detail-value {
    color: #1a1a1a;
}

.are-script-block {
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
}

.are-script-label {
    color: #8c8c8c;
    font-size: 12px;
    min-width: 60px;
    flex-shrink: 0;
    font-weight: 500;
}

.are-script-text {
    font-size: 13px;
    color: #1a1a1a;
    line-height: 1.6;
}

.are-selling-points {
    margin: 4px 0 0 0;
    padding-left: 18px;
    font-size: 12px;
    color: #595959;
    line-height: 1.7;
}

.are-result-label {
    font-size: 12px;
    color: #52c41a;
    font-weight: 500;
}

.are-error-msg {
    color: #ff4d4f;
    font-size: 13px;
    padding: 8px 0;
}

/* ═══════════════════════════════════════════════════
   分页
   ═══════════════════════════════════════════════════ */

.are-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 0;
}

.are-pagination-info {
    font-size: 12px;
    color: #8c8c8c;
}

/* ═══════════════════════════════════════════════════
   状态
   ═══════════════════════════════════════════════════ */

.are-loading {
    text-align: center;
    padding: 40px;
    color: #8c8c8c;
    font-size: 13px;
}

.are-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #f0f0f0;
    border-top-color: #1890ff;
    border-radius: 50%;
    margin: 0 auto 12px auto;
    animation: areSpin 0.8s linear infinite;
}

.are-spinner-small {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #e8e8e8;
    border-top-color: #1890ff;
    border-radius: 50%;
    animation: areSpin 0.8s linear infinite;
    margin-right: 4px;
}

.are-empty {
    text-align: center;
    padding: 80px 20px;
}

.are-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.are-empty-text {
    font-size: 15px;
    color: #bfbfbf;
}

.are-empty-desc {
    font-size: 13px;
    color: #d9d9d9;
    margin-top: 4px;
}

.are-error {
    text-align: center;
    padding: 80px 20px;
    color: #ff4d4f;
    font-size: 14px;
}

.are-error-icon {
    font-size: 36px;
    margin-bottom: 8px;
}

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