/* 店铺表格分析 — 四步向导 */
.tas-page { max-width: 960px; margin: 0 auto; padding: var(--spacing-lg) 0 var(--spacing-2xl); }

.tas-hero { margin-bottom: var(--spacing-lg); }
.tas-hero h1 { font-size: 1.45rem; font-weight: 800; margin: 0 0 6px; color: var(--text-primary); }
.tas-hero p { font-size: 0.88rem; color: var(--text-muted); margin: 0; }

/* 步骤条 */
.tas-steps {
    display: flex; align-items: center; gap: 0; margin-bottom: var(--spacing-lg);
    background: white; border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 12px 16px;
}
.tas-step {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
    border: none; background: transparent; cursor: pointer; padding: 8px 4px;
    font-family: inherit; color: var(--text-muted); transition: color 0.15s;
}
.tas-step:disabled { cursor: not-allowed; opacity: 0.45; }
.tas-step.is-active { color: #4f46e5; font-weight: 700; }
.tas-step.is-done { color: #059669; }
.tas-step-num {
    width: 24px; height: 24px; border-radius: 50%; font-size: 0.72rem; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--bg-secondary); border: 1px solid var(--border-color);
}
.tas-step.is-active .tas-step-num { background: #6366f1; color: white; border-color: #6366f1; }
.tas-step.is-done .tas-step-num { background: #d1fae5; color: #059669; border-color: #a7f3d0; }
.tas-step-line { flex: 0 0 24px; height: 1px; background: var(--border-color); }

.tas-panel { display: none; }
.tas-panel.is-active { display: block; }

.tas-card {
    background: white; border: 1px solid var(--border-color);
    border-radius: var(--radius-lg); padding: 20px; margin-bottom: var(--spacing-md);
}
.tas-card-title {
    font-size: 0.95rem; font-weight: 700; margin-bottom: 14px;
    display: flex; align-items: center; gap: 6px; color: var(--text-primary);
}

/* 上传 */
.tas-upload {
    border: 2px dashed var(--border-color); border-radius: var(--radius-lg);
    padding: 32px 20px; text-align: center; cursor: pointer;
    background: var(--bg-secondary); transition: border-color 0.2s;
}
.tas-upload:hover, .tas-upload.drag-over { border-color: #6366f1; background: rgba(99,102,241,0.04); }
.tas-upload-icon { font-size: 2.4rem; color: var(--text-muted); display: block; margin-bottom: 8px; }
.tas-upload-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }
.tas-sample-ref {
    margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border-color);
    display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 12px;
}
.tas-sample-link {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 0.84rem; font-weight: 600; color: #6366f1; text-decoration: none;
    padding: 6px 12px; border-radius: var(--radius-md);
    border: 1px solid rgba(99, 102, 241, 0.35); background: rgba(99, 102, 241, 0.06);
}
.tas-sample-link:hover { background: rgba(99, 102, 241, 0.12); color: #4f46e5; }
.tas-sample-desc { font-size: 0.74rem; color: var(--text-muted); max-width: 280px; line-height: 1.4; }
.tas-type-row { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 0.84rem; }
.tas-type-row select { padding: 6px 10px; border-radius: var(--radius-md); border: 1px solid var(--border-color); }

.tas-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.tas-nav-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: var(--spacing-md); flex-wrap: wrap; }

.tas-btn {
    padding: 10px 18px; border-radius: var(--radius-md); font-size: 0.88rem; font-weight: 600;
    cursor: pointer; border: none; display: inline-flex; align-items: center; gap: 6px;
    font-family: inherit; transition: all 0.15s;
}
.tas-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.tas-btn-primary { background: #6366f1; color: white; }
.tas-btn-primary:hover:not(:disabled) { background: #4f46e5; }
.tas-btn-block { width: 100%; justify-content: center; }
.tas-btn-ghost { background: transparent; color: #6366f1; border: 1px dashed #6366f1; }
.tas-btn-ghost:hover:not(:disabled) { background: rgba(99,102,241,0.06); }
.tas-btn-ai { background: linear-gradient(135deg, #6366f1, #8b5cf6); color: white; width: 100%; justify-content: center; margin-top: 12px; }
.tas-btn-lg { padding: 14px 24px; font-size: 0.95rem; }
.tas-btn-inline {
    background: none; border: none; color: #6366f1; font-size: 0.82rem; font-weight: 600;
    cursor: pointer; padding: 4px 0; margin-bottom: 10px; font-family: inherit;
}

/* 映射表 */
.tas-mapping-meta { font-size: 0.84rem; color: var(--text-secondary); margin-bottom: 12px; }
.tas-mapping-table-wrap { overflow-x: auto; }
.tas-mapping-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.tas-mapping-table th, .tas-mapping-table td {
    padding: 8px 10px; border-bottom: 1px solid var(--border-color); text-align: left;
}
.tas-preview-block { margin-top: 4px; }
.tas-preview-wrap { overflow-x: auto; }
.tas-preview-table { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
.tas-preview-table th, .tas-preview-table td {
    padding: 7px 10px; border-bottom: 1px solid var(--border-color);
    text-align: left; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tas-preview-table th { background: var(--bg-secondary); font-weight: 600; color: var(--text-secondary); }
.tas-preview-meta { font-size: 0.74rem; color: var(--text-muted); margin-top: 8px; }
.tas-mapping-table select { max-width: 180px; padding: 4px 8px; font-size: 0.82rem; }


/* 看懂 */
.tas-headline {
    padding: 16px 18px; border-radius: var(--radius-lg); margin-bottom: var(--spacing-md);
    border: 1px solid var(--border-color); background: white;
}
.tas-headline.tone-danger { border-left: 4px solid #dc2626; }
.tas-headline.tone-warning { border-left: 4px solid #f59e0b; }
.tas-headline.tone-success { border-left: 4px solid #059669; }
.tas-headline-main { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.tas-headline-sub { font-size: 0.8rem; color: var(--text-muted); }

.tas-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: var(--spacing-md); }
.tas-metric {
    background: white; border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 14px;
}
.tas-metric-label { font-size: 0.72rem; color: var(--text-muted); margin-bottom: 4px; }
.tas-metric-value { font-size: 1.25rem; font-weight: 800; color: var(--text-primary); }

.tas-charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: var(--spacing-md); }
.tas-chart-box {
    background: white; border: 1px solid var(--border-color); border-radius: var(--radius-lg);
    height: 260px; padding: 8px;
}
.tas-chart-inner { width: 100%; height: 100%; }

.tas-diag-list { display: flex; flex-direction: column; gap: 10px; }
.tas-diag {
    padding: 12px 14px; border-radius: var(--radius-md); border: 1px solid var(--border-color);
    background: var(--bg-secondary);
}
.tas-diag.level-danger { border-left: 3px solid #dc2626; }
.tas-diag.level-warning { border-left: 3px solid #f59e0b; }
.tas-diag.level-success { border-left: 3px solid #059669; }
.tas-diag.level-info { border-left: 3px solid #6366f1; }
.tas-diag-title { font-weight: 700; font-size: 0.88rem; margin-bottom: 4px; }
.tas-diag-msg { font-size: 0.82rem; color: var(--text-secondary); margin-bottom: 4px; }
.tas-diag-action { font-size: 0.78rem; color: var(--text-muted); }

/* 改稿 */
.tas-edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--spacing-md); margin-bottom: var(--spacing-md); }
.tas-field-label { display: block; font-size: 0.78rem; font-weight: 600; color: var(--text-muted); margin: 12px 0 6px; }
.tas-input, .tas-textarea {
    width: 100%; box-sizing: border-box; padding: 10px 12px;
    border: 1px solid var(--border-color); border-radius: var(--radius-md);
    font-size: 0.86rem; font-family: inherit; color: var(--text-primary); background: var(--bg-color);
}
.tas-textarea { resize: vertical; line-height: 1.6; }

.tas-finding-row, .tas-backlog-item {
    display: flex; gap: 8px; align-items: flex-start; margin-bottom: 8px;
    padding: 10px; background: var(--bg-secondary); border-radius: var(--radius-md);
}
.tas-finding-row input[type=text], .tas-backlog-item input[type=text], .tas-backlog-item textarea {
    flex: 1; padding: 6px 8px; border: 1px solid var(--border-color); border-radius: var(--radius-sm);
    font-size: 0.82rem; font-family: inherit;
}
.tas-backlog-item textarea { min-height: 48px; resize: vertical; }

/* 行动项优先级：胶囊下拉，替代默认 select 外观 */
.tas-priority-select {
    flex-shrink: 0;
    width: auto;
    min-width: 54px;
    height: 32px;
    margin-top: 2px;
    padding: 0 26px 0 11px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    font-family: inherit;
    letter-spacing: 0.04em;
    line-height: 1;
    color: #4338ca;
    background-color: rgba(99, 102, 241, 0.1);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%234338ca' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}
.tas-priority-select:hover {
    box-shadow: 0 1px 4px rgba(30, 32, 72, 0.08);
}
.tas-priority-select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}
.tas-priority-select.priority-p0 {
    color: #b91c1c;
    background-color: #fef2f2;
    border-color: rgba(220, 38, 38, 0.22);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23b91c1c' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}
.tas-priority-select.priority-p1 {
    color: #b45309;
    background-color: #fffbeb;
    border-color: rgba(217, 119, 6, 0.22);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23b45309' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}
.tas-priority-select.priority-p2 {
    color: #475569;
    background-color: #f1f5f9;
    border-color: rgba(100, 116, 139, 0.22);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}
.tas-remove-btn {
    border: none; background: none; color: #94a3b8; cursor: pointer; padding: 4px; flex-shrink: 0;
}
.tas-remove-btn:hover { color: #dc2626; }
.tas-backlog-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.tas-ai-hint { font-size: 0.74rem; color: var(--text-muted); display: block; text-align: center; margin-top: 6px; }

/* 带走 */
.tas-preview-doc {
    white-space: pre-wrap; font-size: 0.86rem; line-height: 1.75;
    color: var(--text-primary); background: var(--bg-secondary);
    padding: 18px; border-radius: var(--radius-md); border: 1px solid var(--border-color);
}
.tas-copy-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: var(--spacing-md); }

.tas-toast {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
    background: #1e293b; color: white; padding: 10px 20px; border-radius: 999px;
    font-size: 0.84rem; z-index: 9999; opacity: 0; transition: opacity 0.25s; pointer-events: none;
}
.tas-toast.show { opacity: 1; }

/* 列名 chips */
.tas-column-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.tas-chip {
    font-size: 0.78rem; padding: 4px 10px; border-radius: 999px;
    background: rgba(99, 102, 241, 0.08); color: #4338ca; border: 1px solid rgba(99, 102, 241, 0.2);
}
.tas-parse-meta { font-size: 0.84rem; color: var(--text-muted); margin-bottom: 8px; }

/* 提示词 */
.tas-prompt-hint { font-size: 0.84rem; color: var(--text-muted); margin: 0 0 12px; line-height: 1.5; }
.tas-prompt-summary { font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 10px; line-height: 1.5; }
.tas-prompt-textarea {
    width: 100%; min-height: 200px; padding: 12px 14px; font-size: 0.88rem; line-height: 1.6;
    border: 1px solid var(--border-color); border-radius: var(--radius-md);
    font-family: inherit; resize: vertical; box-sizing: border-box;
}
.tas-prompt-textarea:focus { outline: none; border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12); }
.tas-prompt-actions {
    margin-top: 12px;
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px 14px;
}
.tas-prompt-actions .tas-btn-ai { width: auto; margin-top: 0; flex-shrink: 0; }
.tas-prompt-hint-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: min(100%, 260px);
}
.tas-prompt-actions .tas-ai-hint { display: block; margin: 0; text-align: left; }
.tas-ai-cooldown-hint {
    font-size: 0.74rem;
    color: var(--text-muted);
    line-height: 1.45;
}
.tas-ai-cooldown-hint.is-waiting { color: #b45309; }
.tas-report-toolbar {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px 14px;
    margin-bottom: var(--spacing-md);
}
.tas-report-toolbar .tas-ai-cooldown-hint { flex: 1; min-width: min(100%, 200px); }
.tas-report-empty {
    text-align: center;
    padding: 28px 20px;
    margin-bottom: var(--spacing-md);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    border: 1px dashed var(--border-color);
    color: var(--text-muted);
    font-size: 0.86rem;
    line-height: 1.55;
}
.tas-report-empty p { margin: 0; }

@media (max-width: 768px) {
    .tas-metrics { grid-template-columns: repeat(2, 1fr); }
    .tas-charts-grid, .tas-edit-grid { grid-template-columns: 1fr; }
    .tas-steps { flex-wrap: wrap; }
    .tas-step-line { display: none; }
}
