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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: #f0f2f5;
    color: #1a1a2e;
}

a { text-decoration: none; color: inherit; }

/* ───── Landing Page ───── */

.landing {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
    color: white;
}

.landing-container {
    text-align: center;
    max-width: 800px;
    padding: 40px 20px;
}

.landing-header h1 {
    font-size: 3.5em;
    font-weight: 800;
    letter-spacing: -1px;
}

.subtitle {
    font-size: 1.4em;
    opacity: 0.9;
    margin-top: 8px;
}

.tagline {
    font-size: 1.2em;
    opacity: 0.85;
    margin: 30px 0;
    line-height: 1.6;
}

.landing-actions { margin: 40px 0; }

.btn {
    display: inline-block;
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-primary {
    background: #2563eb;
    color: white;
}
.btn-primary:hover { background: #1d4ed8; }
.btn-primary.btn-loading, .btn.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}
.btn-primary.btn-loading::before, .btn.btn-loading::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 6px;
    vertical-align: middle;
}

.btn-large {
    padding: 16px 48px;
    font-size: 1.2em;
    border-radius: 12px;
    background: white;
    color: #2563eb;
    font-weight: 600;
}
.btn-large:hover { background: #f0f7ff; }

.btn-sm { padding: 6px 16px; font-size: 0.85em; }

.btn-add-url {
    background: #10b981;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
}
.btn-add-url:hover { background: #059669; }

.hint {
    display: block;
    font-size: 0.85em;
    color: #9ca3af;
    margin-top: 4px;
}

.landing-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 50px;
}

.step-card {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    padding: 30px 20px;
    border-radius: 16px;
}

.step-num {
    width: 40px;
    height: 40px;
    background: white;
    color: #2563eb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin: 0 auto 16px;
}

.step-card h3 { margin-bottom: 8px; }
.step-card p { font-size: 0.9em; opacity: 0.85; }

/* ───── App Layout ───── */

.app-container { display: flex; min-height: 100vh; }

.sidebar {
    width: 240px;
    background: #1e3a5f;
    color: white;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h2 { font-size: 1.3em; }

.session-badge {
    font-size: 0.75em;
    opacity: 0.6;
    margin-top: 4px;
    display: inline-block;
}

.user-badge {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    padding: 6px 10px;
    border-radius: 8px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
}

.user-badge .user-name {
    font-size: 0.85em;
    color: #e2e8f0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-badge .user-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.user-badge .user-actions .btn {
    line-height: 1.4;
}

/* ─── Sidebar Client List ─── */

.sidebar-client-list {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    max-height: 300px;
    overflow-y: auto;
}

.client-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 20px 8px;
    font-size: 0.8em;
    opacity: 0.7;
}

.btn-xs {
    padding: 2px 8px;
    font-size: 0.75em;
    background: rgba(255,255,255,0.15);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
.btn-xs:hover { background: rgba(255,255,255,0.25); }

.client-list {
    padding: 0 12px;
}

.client-list .empty-hint {
    display: block;
    text-align: center;
    padding: 12px;
    font-size: 0.75em;
    opacity: 0.5;
}

.client-list-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.75em;
    transition: background 0.2s;
    flex-wrap: wrap;
}
.client-list-item:hover { background: rgba(255,255,255,0.1); }

.client-list-name {
    font-weight: 600;
    flex: 1 1 60%;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

.client-list-industry {
    font-size: 0.85em;
    opacity: 0.6;
}

.client-list-score {
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 600;
}
.client-list-score.high { background: rgba(16,185,129,0.3); color: #6ee7b7; }
.client-list-score.medium { background: rgba(245,158,11,0.3); color: #fcd34d; }
.client-list-score.low { background: rgba(239,68,68,0.3); color: #fca5a5; }

.client-list-meta {
    font-size: 0.8em;
    opacity: 0.5;
    width: 100%;
    padding-left: 0;
}

.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }

.nav-group-label {
    padding: 12px 20px 4px 20px;
    font-size: 0.72em;
    letter-spacing: 0.05em;
    color: rgba(255,255,255,0.45);
    text-transform: uppercase;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    cursor: pointer;
    transition: background 0.2s;
    opacity: 0.7;
}

.nav-item:hover { background: rgba(255,255,255,0.1); opacity: 1; }
.nav-item.active {
    background: rgba(255,255,255,0.15);
    opacity: 1;
    border-right: 3px solid white;
}

.nav-icon { font-size: 1.1em; }

.sidebar-footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.1); }
.sidebar-footer .btn { background: rgba(255,255,255,0.15); color: white; width: 100%; }

.llm-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    margin-bottom: 12px;
    background: rgba(255,255,255,0.08);
    border-radius: 8px;
    font-size: 0.8em;
    color: rgba(255,255,255,0.7);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.status-dot.connected { background: #10b981; box-shadow: 0 0 6px rgba(16,185,129,0.6); }
.status-dot.disconnected { background: #ef4444; }
.model-name { font-size: 0.85em; opacity: 0.7; }

.llm-provider-select {
    flex: 1;
    background: rgba(255,255,255,0.1);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.85em;
    font-family: inherit;
    cursor: pointer;
    min-width: 0;
}
.llm-provider-select option {
    background: #1e3a5f;
    color: white;
}

.main-content {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
}

.step-panel { display: none; }
.step-panel.active { display: block; }

.panel-header { margin-bottom: 32px; }
.panel-header h2 { font-size: 1.8em; color: #1e3a5f; }
.panel-desc { color: #666; margin-top: 8px; }

/* ───── Form Elements ───── */

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #333;
}

.input-group input[type="text"],
.input-group input[type="url"],
.input-group textarea,
.input-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
    transition: border-color 0.2s;
}

.input-group input[type="text"]:focus,
.input-group input[type="url"]:focus,
.input-group textarea:focus,
.input-group select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.url-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}
.url-row input { flex: 1; }

.result-box {
    margin-top: 24px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    white-space: pre-wrap;
    font-size: 0.95em;
    line-height: 1.7;
}

/* ───── Loading ───── */

.loading-spinner {
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #2563eb;
    font-size: 0.95em;
}

.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #2563eb;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ───── Insight Result ───── */

.insight-result {
    margin-top: 32px;
}

.insight-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #2563eb;
}

.insight-header h3 {
    font-size: 1.6em;
    color: #1e3a5f;
}

.industry-badge {
    display: inline-block;
    padding: 4px 14px;
    background: #dbeafe;
    color: #1d4ed8;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
}

.insight-sources {
    margin-bottom: 24px;
}

.source-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.source-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    font-size: 0.85em;
    color: #555;
    text-decoration: none;
    transition: all 0.2s;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.source-tag:hover {
    background: #eff6ff;
    border-color: #2563eb;
    color: #1d4ed8;
}

.source-tag .source-type {
    font-weight: 600;
    color: #2563eb;
    flex-shrink: 0;
}

.source-tag .source-title {
    overflow: hidden;
    text-overflow: ellipsis;
}

.source-tag.failed {
    opacity: 0.5;
    text-decoration: line-through;
}

.source-tag.filtered {
    opacity: 0.4;
    background: #f3f4f6;
    border-color: #d1d5db;
    font-size: 0.8em;
}

#llm-source-values {
    margin-top: 12px;
}

.llm-source-value {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 8px;
}

.llm-source-header {
    font-weight: 600;
    font-size: 0.9em;
    color: #166534;
}

.llm-source-cats {
    font-size: 0.75em;
    color: #16a34a;
    margin: 2px 0 6px;
}

.llm-source-desc {
    font-size: 0.85em;
    color: #374151;
    line-height: 1.5;
}

.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.cat-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}

.cat-card.cat-empty {
    opacity: 0.6;
}

.src-badge {
    font-size: 0.78em;
    padding: 2px 8px;
    border-radius: 10px;
    display: inline-block;
}
.src-badge-web {
    background: #dbeafe;
    color: #1d4ed8;
}
.src-badge-llm {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

.cat-card.cat-incident {
    border-color: #fde68a;
    background: #fffbeb;
}

.cat-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    font-size: 0.9em;
    font-weight: 600;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.cat-icon {
    font-size: 1.1em;
}

.cat-label {
    color: #374151;
}

.cat-body {
    padding: 12px 14px;
    font-size: 0.85em;
    line-height: 1.6;
    color: #4b5563;
}

.cat-placeholder {
    color: #9ca3af;
    font-style: italic;
}

.cat-empty .cat-body {
    color: #9ca3af;
}

.profile-summary {
    font-size: 0.85em;
    line-height: 1.6;
    color: #4b5563;
    padding: 8px 12px;
    background: #f9fafb;
    border-radius: 6px;
    margin: 8px 0;
    max-height: 200px;
    overflow-y: auto;
}

.gap-label {
    color: #dc2626;
    font-weight: 600;
}

.gap-tag {
    display: inline-block;
    background: #fef2f2;
    color: #dc2626;
    padding: 1px 8px;
    border-radius: 8px;
    font-size: 0.8em;
    margin: 2px 3px;
}

.profile-meta {
    display: flex;
    justify-content: space-between;
    padding: 6px 12px;
    font-size: 0.8em;
    color: #9ca3af;
    border-top: 1px solid #e5e7eb;
}

.strategy-basis-block {
    background: #f0fdf4;
    border-left: 3px solid #22c55e;
    margin-bottom: 12px;
    border-radius: 6px;
}

.profile-gaps {
    padding: 6px 12px;
    font-size: 0.82em;
}

.gap-row {
    padding: 4px 0;
    border-bottom: 1px solid #f3f4f6;
}

.gap-row:last-child {
    border-bottom: none;
}

.gap-sev {
    margin-right: 4px;
}

.gap-reason {
    color: #6b7280;
    font-size: 0.9em;
    margin-left: 4px;
}

.gap-guide {
    color: #6b7280;
    font-size: 0.88em;
    padding: 2px 0 2px 20px;
    font-style: italic;
}

.interview-block {
    border-left: 3px solid #8b5cf6;
    background: #faf5ff;
}

.interview-subhead {
    color: #9ca3af;
    font-size: 0.82em;
    margin: -6px 0 8px;
    padding: 0 12px;
}

.intv-item {
    padding: 8px 12px;
    border-bottom: 1px solid #e5e7eb;
    position: relative;
}

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

.intv-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.intv-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 600;
}

.badge-info {
    background: #e0f2fe;
    color: #0369a1;
}

.badge-pain {
    background: #fce7f3;
    color: #be185d;
}

.badge-other {
    background: #fef3c7;
    color: #b45309;
}

.intv-category {
    color: #6b7280;
    font-size: 0.8em;
}

.intv-sev {
    margin-left: auto;
}

.intv-item .q-text {
    font-size: 0.88em;
    line-height: 1.5;
    padding-right: 60px;
}

.intv-item .btn-copy-sm {
    position: absolute;
    right: 12px;
    bottom: 10px;
}

.timeline-container {
    max-height: 600px;
    overflow-y: auto;
    padding: 4px 0;
}

.timeline-date-group {
    margin-bottom: 16px;
}

.timeline-date-label {
    font-size: 0.78em;
    color: #9ca3af;
    font-weight: 600;
    padding: 4px 12px;
    background: #f3f4f6;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 8px;
}

.timeline-items {
    padding-left: 8px;
}

.timeline-item {
    display: flex;
    gap: 10px;
    padding: 6px 0;
    border-left: 2px solid #e5e7eb;
    margin-left: 12px;
    padding-left: 16px;
    position: relative;
}

.timeline-item:last-child {
    border-left-color: transparent;
}

.timeline-dot {
    position: absolute;
    left: -14px;
    top: 6px;
    font-size: 0.85em;
    background: #fff;
    padding: 0 2px;
}

.timeline-body {
    flex: 1;
    min-width: 0;
}

.timeline-time {
    font-size: 0.72em;
    color: #9ca3af;
    margin-bottom: 2px;
}

.timeline-summary {
    font-size: 0.85em;
    color: #374151;
    line-height: 1.5;
}

.timeline-detail {
    font-size: 0.78em;
    color: #6b7280;
    margin-top: 2px;
}

.cat-item {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #e5e7eb;
}

.cat-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.cat-item-text {
    display: inline;
}

.cat-source-link {
    font-size: 0.8em;
    color: #6b7280;
    text-decoration: none;
    margin-left: 4px;
    white-space: nowrap;
}

.cat-source-link:hover {
    color: #2563eb;
    text-decoration: underline;
}

.insight-assessment-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    padding: 12px 16px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
}

.insight-manual-input {
    margin-bottom: 16px;
}

.incident-item {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 4px 0;
    font-size: 0.85em;
}

.incident-nature {
    flex-shrink: 0;
}

/* ═══ Streaming progress UI ═══ */
#insight-progress {
    margin: 12px 0;
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.stream-progress-bar {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.stream-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0%;
}

.stream-status {
    font-size: 0.85em;
    color: #64748b;
    margin-bottom: 10px;
    min-height: 1.4em;
}

.stream-sources {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.stream-source-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.78em;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #475569;
    animation: fadeSlideIn 0.3s ease;
}

.stream-source-tag.fetched {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}

.stream-source-tag.failed {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.stream-source-tag .src-icon {
    font-size: 0.9em;
}

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.stream-pulse {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #3b82f6;
    border-radius: 50%;
    margin-right: 6px;
    animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.7); }
}

/* Step indicators for streaming progress */
.step-indicators {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.step-dot {
    font-size: 0.75em;
    padding: 3px 8px;
    border-radius: 12px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #94a3b8;
    transition: all 0.3s ease;
    white-space: nowrap;
}
.step-dot.active {
    background: #dbeafe;
    border-color: #3b82f6;
    color: #1d4ed8;
    font-weight: 600;
    box-shadow: 0 0 0 2px rgba(59,130,246,0.2);
}
.step-dot.done {
    background: #ecfdf5;
    border-color: #86efac;
    color: #065f46;
}
.step-arrow {
    font-size: 0.7em;
    color: #cbd5e1;
    margin: 0 2px;
}

/* ═══ Solution goal panel ═══ */
.goal-panel {
    margin: 8px 0 14px;
    padding: 12px 16px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
}

.goal-header {
    font-size: 0.9em;
    font-weight: 600;
    color: #92400e;
    margin-bottom: 8px;
}

.goal-body {
    font-size: 0.85em;
    line-height: 1.6;
}

.goal-row {
    margin: 4px 0;
}

.goal-label {
    font-weight: 600;
    color: #374151;
    margin-right: 6px;
}

.goal-value {
    color: #1f2937;
}

.goal-edit {
    font-size: 0.8em;
    text-decoration: none;
    color: #6b7280;
}

.goal-pain-list {
    padding-left: 4px;
    margin: 4px 0 8px;
}

.goal-pain-item {
    color: #dc2626;
    font-size: 0.88em;
    padding: 2px 0;
}

.goal-warning {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    padding: 8px 10px;
    margin: 8px 0;
    font-size: 0.85em;
    color: #991b1b;
}

.goal-hint {
    color: #6b7280;
    font-size: 0.82em;
    margin-top: 4px;
}

.goal-ready {
    color: #16a34a;
    font-size: 0.85em;
    font-weight: 500;
    margin-top: 6px;
}

.goal-placeholder {
    color: #9ca3af;
    font-style: italic;
    margin-bottom: 6px;
}

.goal-footer {
    margin-top: 6px;
    font-size: 0.8em;
}

#goal-needs-link {
    color: #2563eb;
    text-decoration: underline;
}

/* ═══ Needs recording page enhancements ═══ */
.needs-result-container {
    margin-top: 12px;
}

.needs-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    margin-bottom: 8px;
}

.needs-label {
    font-weight: 600;
    font-size: 0.85em;
    color: #374151;
}

.needs-value {
    font-size: 0.88em;
    color: #1f2937;
}

.needs-list,
.needs-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.needs-item {
    font-size: 0.85em;
    color: #4b5563;
    padding: 2px 0;
    width: 100%;
}

.needs-tag {
    display: inline-block;
    padding: 2px 8px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    font-size: 0.8em;
    color: #1d4ed8;
}

.needs-detail {
    font-size: 0.85em;
    color: #4b5563;
    line-height: 1.5;
}

/* ═══ Structure panel (always visible, right below dropdown) ═══ */
.structure-panel {
    margin: 8px 0 14px;
    padding: 10px 14px;
    background: #f0f5ff;
    border: 1px solid #dbeafe;
    border-radius: 8px;
}

.structure-display {
    min-height: 40px;
}

.structure-display .hint {
    font-size: 0.85em;
    color: #6b7280;
    margin: 8px 0;
}

/* ═══ Structure block chain display ═══ */
.structure-chain {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
}

.struct-block-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 80px;
    padding: 8px 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    text-align: center;
}

.struct-block-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: #fff;
    font-weight: 700;
    font-size: 0.85em;
}

.struct-block-label {
    font-size: 0.75em;
    color: #374151;
    line-height: 1.3;
}

.struct-block-note {
    font-size: 0.7em;
    color: #9ca3af;
    line-height: 1.2;
}

.struct-arrow {
    font-size: 1.1em;
    color: #d1d5db;
    font-weight: 300;
}

.structure-header {
    font-size: 0.95em;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.col-strategy { background: #ecfdf5; }
.col-strategy h4 { color: #059669; }

.column-body {
    padding: 12px 18px;
    max-height: 400px;
    overflow-y: auto;
}

.research-block {
    padding: 10px 12px;
    margin-bottom: 8px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.2s;
}
.research-block:hover {
    border-color: #bfdbfe;
    box-shadow: 0 1px 4px rgba(37,99,235,0.1);
}
.research-block.selected {
    background: #f0fdf4;
    border-color: #86efac;
}
.research-block.dismissed {
    display: none;
}

.research-block-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.research-block-dims {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.dim-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 0.65em;
    font-weight: 600;
    letter-spacing: 0.3px;
}
.dim-badge.dim-strong {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}
.dim-badge.dim-weak {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.source-link {
    font-size: 0.7em;
    color: #2563eb;
    text-decoration: none;
    padding: 1px 6px;
    background: #eff6ff;
    border-radius: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
    flex-shrink: 0;
}
.source-link:hover {
    background: #dbeafe;
    text-decoration: underline;
}

.research-block-summary {
    font-size: 0.8em;
    line-height: 1.5;
    color: #6b7280;
    margin-bottom: 6px;
}

.research-block-text {
    font-size: 0.9em;
    line-height: 1.7;
    color: #374151;
    margin-bottom: 8px;
}

.research-block-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.btn-rb {
    padding: 4px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.8em;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}
.btn-rb:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-rb-select {
    color: #059669;
    border-color: #6ee7b7;
}
.btn-rb-select:hover:not(:disabled) {
    background: #d1fae5;
    border-color: #34d399;
}

.btn-rb-dismiss {
    color: #9ca3af;
    border-color: #e5e7eb;
}
.btn-rb-dismiss:hover:not(:disabled) {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
}

.column-body .empty-hint {
    color: #9ca3af;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.column-body .empty-hint {
    color: #9ca3af;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.insight-pains {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
}

.insight-pains h4 {
    font-size: 1em;
    color: #374151;
    margin-bottom: 12px;
}

.pain-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pain-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    font-size: 0.9em;
    color: #dc2626;
    font-weight: 500;
}

/* ───── Strategy Result ───── */

.strategy-result {
    margin-top: 24px;
}

.strategy-section {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

.strategy-section h4 {
    font-size: 1em;
    color: #374151;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.question-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.question-item {
    padding: 12px 16px;
    background: #f0f7ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    font-size: 0.95em;
    color: #1e40af;
    line-height: 1.6;
}

.case-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.case-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    font-size: 0.9em;
    color: #15803d;
    font-weight: 500;
}

/* ───── Assessment ───── */

.assessment-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.file-upload-area {
    display: flex;
    align-items: center;
    gap: 8px;
}

.assessment-score-bar {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
}

/* ── 大象拼图图例（信息完整度） ── */
.elephant-legend {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #e2e8f0;
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 20px;
}
.elephant-headline { font-size: 1.05em; font-weight: 700; margin-bottom: 12px; }
.elephant-headline #elephant-progress { color: #fbbf24; }
.elephant-parts {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.elephant-part {
    flex: 1;
    min-width: 96px;
    text-align: center;
    padding: 10px 6px;
    border-radius: 10px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    cursor: default;
    transition: background 0.2s, border 0.2s, transform 0.2s;
    font-size: 0.85em;
    line-height: 1.4;
}
.elephant-part b { font-size: 1em; }
.elephant-part span { color: rgba(255,255,255,0.65); font-size: 0.9em; }
.elephant-part.dim-known { background: rgba(34,197,94,0.18); border-color: rgba(34,197,94,0.5); }
.elephant-part.dim-partial { background: rgba(245,158,11,0.16); border-color: rgba(245,158,11,0.45); }
.elephant-part.dim-missing { background: rgba(239,68,68,0.14); border-color: rgba(239,68,68,0.4); }
.elephant-part.dim-known span, .elephant-part.dim-known b { color: #86efac; }
.elephant-part.dim-partial span, .elephant-part.dim-partial b { color: #fde68a; }
.elephant-part.dim-missing span, .elephant-part.dim-missing b { color: #fca5a5; }
.elephant-tip {
    margin-top: 10px;
    font-size: 0.78em;
    color: rgba(255,255,255,0.55);
    line-height: 1.5;
}
.gaps-cta {
    margin-top: 12px;
    padding: 12px;
    background: #eff6ff;
    border: 1px dashed #93c5fd;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* ── 步骤引导条 ── */
.step-guide {
    margin: 0 0 16px 0;
    padding: 10px 14px;
    background: #f0fdf4;
    border-left: 4px solid #22c55e;
    border-radius: 6px;
    font-size: 0.85em;
    color: #14532d;
    line-height: 1.5;
}
.step-guide.guide-warn {
    background: #fffbeb;
    border-left-color: #f59e0b;
    color: #78350f;
}

.score-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.score-header h3 { font-size: 1.1em; color: #1e3a5f; }

.score-total {
    font-size: 1.8em;
    font-weight: 800;
    color: #2563eb;
}

.score-bar-track {
    height: 10px;
    background: #e5e7eb;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 8px;
}

.score-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #ef4444, #f59e0b, #10b981);
    border-radius: 5px;
    transition: width 0.8s ease;
}

.score-level {
    font-size: 0.9em;
    color: #6b7280;
}

.dimension-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.dimension-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px;
    transition: box-shadow 0.2s;
}
.dimension-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }

.dim-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.dim-name { font-weight: 600; font-size: 0.95em; }
.dim-part-tag {
    display: inline-block;
    margin-left: 4px;
    padding: 1px 8px;
    border-radius: 8px;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 0.7em;
    font-weight: 500;
    vertical-align: 1px;
}
.dim-score { font-weight: 700; font-size: 1.1em; }
.dim-score.high { color: #10b981; }
.dim-score.medium { color: #f59e0b; }
.dim-score.low { color: #ef4444; }

.dim-summary { font-size: 0.85em; color: #4b5563; line-height: 1.5; margin-bottom: 8px; }
.dim-status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 0.75em;
    font-weight: 600;
}
.dim-status-badge.complete { background: #d1fae5; color: #065f46; }
.dim-status-badge.basic { background: #fef3c7; color: #92400e; }
.dim-status-badge.missing { background: #fee2e2; color: #991b1b; }

.dim-quotes {
    margin-top: 8px;
    padding: 8px;
    background: #f9fafb;
    border-radius: 6px;
    font-size: 0.8em;
    color: #6b7280;
}
.dim-quote-item {
    padding: 3px 0;
    line-height: 1.4;
    word-break: break-all;
}
.dim-quotes-toggle {
    font-size: 0.8em;
    color: #3b82f6;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 0 0 0;
    margin-top: 4px;
}
.dim-quotes-toggle:hover {
    color: #1d4ed8;
}

.dim-gaps {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.dim-gap-tag {
    font-size: 0.7em;
    padding: 2px 8px;
    background: #fef2f2;
    color: #dc2626;
    border-radius: 4px;
}

.data-gaps-section, .match-section {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}
.data-gaps-section h4, .match-section h4 {
    font-size: 1em;
    margin-bottom: 12px;
    color: #374151;
}

.gap-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
    align-items: flex-start;
}
.gap-item:last-child { border-bottom: none; }
.gap-priority {
    flex-shrink: 0;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 600;
}
.gap-priority.high { background: #fee2e2; color: #dc2626; }
.gap-priority.medium { background: #fef3c7; color: #d97706; }
.gap-priority.low { background: #dbeafe; color: #2563eb; }

.gap-content { flex: 1; }
.gap-desc { font-size: 0.9em; color: #374151; }
.gap-action { font-size: 0.8em; color: #6b7280; margin-top: 2px; }
.gap-ask {
    margin-top: 8px;
    padding: 8px 12px;
    background: #fdf8ef;
    border: 1px dashed #fbbf24;
    border-radius: 8px;
    font-size: 0.85em;
    color: #78350f;
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.match-info {
    font-size: 0.95em;
    padding: 12px 16px;
    background: #f0f7ff;
    border-radius: 8px;
    margin-bottom: 12px;
    color: #1e40af;
    line-height: 1.6;
}

.match-ability-item {
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
}
.match-ability-item:last-child { border-bottom: none; }
.match-ability-pain { font-weight: 600; font-size: 0.9em; }
.match-ability-list { font-size: 0.85em; color: #6b7280; margin-top: 4px; }

/* ───── Material Selection Panel ───── */

.material-select-panel {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin-bottom: 14px;
    overflow: hidden;
}

.material-select-summary {
    padding: 12px 16px;
    font-weight: 600;
    font-size: 0.95em;
    color: #374151;
    cursor: pointer;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    user-select: none;
}
.material-select-summary:hover {
    background: #f3f4f6;
}

.material-select-body {
    padding: 12px 16px;
}

.material-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 20px;
    color: #6b7280;
    font-size: 0.9em;
}

.material-section {
    margin-bottom: 14px;
}
.material-section h4 {
    font-size: 0.85em;
    color: #374151;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #f3f4f6;
}

.material-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.material-checkbox {
    display: inline-flex;
    align-items: flex-start;
    gap: 6px;
    padding: 8px 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.82em;
    cursor: pointer;
    transition: all 0.2s;
    max-width: 280px;
}
.material-checkbox:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
}
.material-checkbox input[type="checkbox"] {
    accent-color: #2563eb;
    margin-top: 2px;
    flex-shrink: 0;
}
.material-checkbox.selected {
    background: #f0fdf4;
    border-color: #86efac;
}
.material-checkbox-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.material-checkbox-name {
    font-weight: 600;
    color: #1e3a5f;
}
.material-checkbox-desc {
    font-size: 0.85em;
    color: #9ca3af;
}

.material-policy-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.material-policy-item {
    font-size: 0.82em;
    color: #6b7280;
    padding: 4px 8px;
    background: #f9fafb;
    border-radius: 4px;
}

/* ─── Strategy Select ─── */

.strategy-select {
    margin-bottom: 16px;
    padding: 14px 16px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
}
.strategy-select > label {
    display: block;
    font-weight: 600;
    font-size: 0.9em;
    color: #374151;
    margin-bottom: 10px;
}

.strategy-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.strategy-option {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
    min-width: 180px;
}
.strategy-option:hover {
    background: #f9fafb;
    border-color: #bfdbfe;
}
.strategy-option input[type="radio"] {
    accent-color: #2563eb;
    margin-top: 3px;
    flex-shrink: 0;
}
.strategy-label {
    font-weight: 600;
    font-size: 0.85em;
    color: #1e3a5f;
    display: block;
}
.strategy-desc {
    font-size: 0.75em;
    color: #9ca3af;
    display: block;
}

.generate-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

/* ───── Preview ───── */

#preview-area {
    margin-top: 24px;
}

#preview-frame {
    width: 100%;
    height: 600px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: white;
}

/* ───── Archive Bar ───── */

.archive-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: linear-gradient(135deg, #1e3a5f, #2563eb);
    color: white;
    border-radius: 12px;
    margin-bottom: 24px;
}

.archive-bar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.archive-name {
    font-size: 1.1em;
    font-weight: 700;
}

.archive-badge {
    display: inline-block;
    padding: 3px 12px;
    background: rgba(255,255,255,0.2);
    border-radius: 12px;
    font-size: 0.8em;
}

.archive-bar-right {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.8em;
    opacity: 0.9;
}

.archive-meta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ───── Manual Input ───── */

.manual-input-area {
    margin-bottom: 20px;
}

.manual-input-area details {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px 20px;
}

.manual-input-area summary {
    cursor: pointer;
    font-weight: 600;
    color: #374151;
    font-size: 0.95em;
}

.manual-input-form {
    margin-top: 16px;
}

.manual-input-form .btn-sm {
    background: #2563eb;
    color: white;
    margin-top: 8px;
}

/* ───── Source Timeline ───── */

.source-timeline {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.source-timeline h4 {
    font-size: 1em;
    margin-bottom: 12px;
    color: #374151;
}

.timeline {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.timeline-entry {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #f9fafb;
    border-radius: 8px;
    font-size: 0.85em;
}

.timeline-type {
    font-weight: 600;
    color: #2563eb;
    flex-shrink: 0;
}

.timeline-url {
    font-size: 0.75em;
    color: #10b981;
    text-decoration: none;
    padding: 1px 6px;
    background: #d1fae5;
    border-radius: 3px;
    flex-shrink: 0;
}
.timeline-url:hover {
    background: #a7f3d0;
    text-decoration: underline;
}

.timeline-dim {
    padding: 2px 8px;
    background: #dbeafe;
    color: #1d4ed8;
    border-radius: 4px;
    font-size: 0.8em;
    flex-shrink: 0;
}

.timeline-content {
    color: #6b7280;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

/* ───── Strategy Layout (Template-based) ───── */

.strategy-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.strategy-type-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
}
.strategy-type-selector select {
    padding: 6px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9em;
    background: white;
    min-width: 220px;
}

.strategy-role-tabs {
    display: flex;
    gap: 4px;
    background: #f3f4f6;
    padding: 3px;
    border-radius: 8px;
}
.strategy-role-tabs .tab-btn {
    padding: 6px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.85em;
    cursor: pointer;
    background: transparent;
    color: #6b7280;
    transition: all 0.15s;
}
.strategy-role-tabs .tab-btn:hover { color: #374151; }
.strategy-role-tabs .tab-btn.active {
    background: white;
    color: #1e3a5f;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.strategy-main-layout {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

/* Profile card */
.strategy-profile { width: 260px; flex-shrink: 0; }
.profile-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px;
    position: sticky;
    top: 20px;
}
.profile-title {
    font-size: 0.95em;
    font-weight: 700;
    color: #1e3a5f;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f3f4f6;
}
.profile-table { width: 100%; border-collapse: collapse; }
.profile-table td { padding: 5px 0; font-size: 0.82em; vertical-align: top; }
.profile-key {
    color: #6b7280;
    width: 70px;
    white-space: nowrap;
    font-weight: 500;
}
.profile-val { color: #1f2937; line-height: 1.5; }

/* Strategy content */
.strategy-content { flex: 1; min-width: 0; }

.strategy-section-header {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 14px;
}
.strategy-role-badge {
    display: inline-block;
    font-weight: 700;
    font-size: 0.9em;
    color: #1e3a5f;
    margin-bottom: 6px;
}
.role-concern, .role-logic, .role-taboo {
    font-size: 0.82em;
    color: #6b7280;
    line-height: 1.6;
}
.role-taboo { color: #dc2626; }

.strategy-block {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 12px;
}
.block-label {
    font-size: 0.85em;
    font-weight: 700;
    color: #6b7280;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.block-content {
    font-size: 0.92em;
    line-height: 1.7;
    color: #1f2937;
}
.goal-text {
    font-weight: 600;
    color: #1e3a5f;
}
.entry-text {
    color: #374151;
    font-style: italic;
    border-left: 3px solid #2563eb;
    padding-left: 12px;
    margin-bottom: 8px;
}

/* Hook cards */
.hook-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 8px;
}
.hook-type-badge {
    display: inline-block;
    font-size: 0.75em;
    font-weight: 600;
    color: #2563eb;
    background: #eff6ff;
    padding: 2px 10px;
    border-radius: 10px;
    margin-bottom: 5px;
}
.hook-text {
    font-size: 0.9em;
    line-height: 1.6;
    color: #374151;
    margin-bottom: 6px;
}

/* Question items */
.q-item {
    background: #f9fafb;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 6px;
}
.q-text {
    font-size: 0.9em;
    line-height: 1.6;
    color: #374151;
    margin-bottom: 4px;
}

/* Material list */
.strategy-block .material-list {
    margin: 0;
    padding-left: 20px;
}
.strategy-block .material-list li {
    font-size: 0.9em;
    line-height: 1.7;
    color: #374151;
    margin-bottom: 3px;
}

/* Taboo block */
.taboo-block { border-left: 3px solid #ef4444; }
.taboo-list {
    margin: 0;
    padding-left: 0;
    list-style: none;
}
.taboo-list li {
    font-size: 0.9em;
    line-height: 1.6;
    color: #dc2626;
    margin-bottom: 4px;
}

/* Copy button small */
.btn-copy-sm {
    font-size: 0.78em;
    padding: 3px 12px;
    background: #eff6ff;
    border: none;
    border-radius: 5px;
    color: #2563eb;
    cursor: pointer;
    transition: all 0.15s;
}
.btn-copy-sm:hover { background: #dbeafe; }

/* Prep steps & quick ref panels */
.strategy-common-panel {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 12px;
}
.strategy-common-panel summary {
    font-weight: 600;
    font-size: 0.9em;
    cursor: pointer;
    color: #1e3a5f;
    padding: 4px 0;
}
.prep-steps {
    margin: 10px 0 0 0;
    padding-left: 20px;
}
.prep-steps li {
    font-size: 0.88em;
    line-height: 1.7;
    color: #374151;
    margin-bottom: 4px;
}

.quick-ref-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 0.82em;
}
.quick-ref-table th {
    background: #f3f4f6;
    color: #374151;
    font-weight: 600;
    padding: 8px 10px;
    text-align: left;
    border-bottom: 2px solid #d1d5db;
}
.quick-ref-table td {
    padding: 7px 10px;
    border-bottom: 1px solid #e5e7eb;
    color: #1f2937;
    vertical-align: top;
}
.quick-ref-table tr:hover td { background: #f9fafb; }

/* ───── Meeting Notes ───── */

.meeting-notes-section {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px 24px;
    margin-top: 20px;
}

.notes-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 16px;
}

.notes-header h4 {
    font-size: 1em;
    color: #374151;
}

.meeting-form .form-group {
    margin-bottom: 14px;
}

.meeting-form label {
    display: block;
    font-weight: 600;
    font-size: 0.85em;
    color: #374151;
    margin-bottom: 6px;
}

.meeting-form textarea,
.meeting-form input[type="text"],
.meeting-form select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.9em;
    font-family: inherit;
    transition: border-color 0.2s;
}

.meeting-form textarea:focus,
.meeting-form input[type="text"]:focus,
.meeting-form select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

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

.flex-row select {
    width: auto;
    min-width: 140px;
}

.pain-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pain-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.2s;
}

.pain-checkbox:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.pain-checkbox input[type="checkbox"] {
    accent-color: #2563eb;
}

.meeting-form .btn-primary {
    margin-top: 8px;
}

/* ───── Archive Contacts ───── */

.archive-contacts {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: rgba(255,255,255,0.15);
    border-radius: 12px;
    font-size: 0.8em;
    white-space: nowrap;
}

/* ───── Failed Sources Manual Paste ───── */

.failed-sources-header {
    padding: 12px 16px;
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 8px;
    margin-bottom: 12px;
}

.failed-sources-header h4 {
    font-size: 0.9em;
    color: #92400e;
    margin-bottom: 4px;
}

.failed-source-item {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 10px;
}

.failed-source-url {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 0.85em;
}

.failed-source-url a {
    color: #2563eb;
    text-decoration: underline;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 300px;
}

.error-msg {
    color: #dc2626;
    font-size: 0.85em;
}

.failed-source-item textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.85em;
    font-family: inherit;
    resize: vertical;
}

.failed-source-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.failed-source-actions .btn-sm {
    background: #2563eb;
    color: white;
}

/* ───── Reference Upload / Imitation ───── */

.ref-upload-area {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ref-upload-btn {
    background: #6366f1;
    color: white;
    cursor: pointer;
}
.ref-upload-btn:hover { background: #4f46e5; }

.ref-analysis-card {
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.85em;
}

.ref-analysis-header {
    font-weight: 600;
    color: #065f46;
    margin-bottom: 6px;
}

.ref-analysis-body {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.ref-tag {
    display: inline-block;
    padding: 2px 8px;
    background: #d1fae5;
    color: #065f46;
    border-radius: 4px;
    font-size: 0.82em;
}

.ref-llm-style {
    width: 100%;
    margin-top: 6px;
    padding: 6px 10px;
    background: #ecfdf5;
    border-radius: 4px;
    font-size: 0.9em;
    color: #374151;
    line-height: 1.5;
}

/* ───── 国企格式 Toggle ───── */

.guoqi-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.82em;
    user-select: none;
    transition: all 0.2s;
}
.guoqi-toggle:hover {
    background: #fef3c7;
}
.guoqi-toggle input[type="checkbox"] {
    accent-color: #d97706;
}

/* ───── 国企公文格式预览 ───── */

.format-guoqi {
    font-family: "仿宋", "FangSong", "STFangsong", serif !important;
    font-size: 16pt !important;
    line-height: 28pt !important;
    color: #000 !important;
    padding: 37mm 28mm 35mm 26mm !important;
    background: #fff !important;
}
.format-guoqi h1 {
    font-family: "小标宋体", "SimSun", "STSong", serif !important;
    font-size: 22pt !important;
    font-weight: normal !important;
    text-align: center !important;
    margin: 28pt 0 !important;
    border-bottom: none !important;
}
.format-guoqi h2 {
    font-family: "黑体", "SimHei", sans-serif !important;
    font-size: 16pt !important;
    font-weight: bold !important;
    margin: 14pt 0 7pt !important;
    border-bottom: none !important;
}
.format-guoqi h3 {
    font-family: "楷体", "KaiTi", "STKaiti", serif !important;
    font-size: 16pt !important;
    font-weight: normal !important;
    margin: 10pt 0 6pt !important;
}
.format-guoqi h4 {
    font-family: "仿宋", "FangSong", serif !important;
    font-size: 16pt !important;
    font-weight: bold !important;
}
.format-guoqi p {
    text-indent: 2em !important;
    margin: 0 !important;
    line-height: 28pt !important;
    font-size: 16pt !important;
}
.format-guoqi table {
    border-collapse: collapse !important;
    width: 100% !important;
    margin: 14pt 0 !important;
    font-size: 14pt !important;
}
.format-guoqi th, .format-guoqi td {
    border: 1px solid #000 !important;
    padding: 4pt 8pt !important;
    text-align: left !important;
}
.format-guoqi th {
    font-family: "黑体", "SimHei", sans-serif !important;
}
.format-guoqi ul, .format-guoqi ol {
    padding-left: 3em !important;
    margin: 7pt 0 !important;
}
.format-guoqi li {
    line-height: 28pt !important;
    font-size: 16pt !important;
}
.format-guoqi blockquote {
    border-left: 3px solid #000 !important;
    padding: 4pt 14pt !important;
    margin: 14pt 0 !important;
    background: #fafafa !important;
}

/* ───── 方案校正 MD Editor ───── */

.correct-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.correct-toolbar .btn-sm {
    background: #2563eb;
    color: white;
    font-size: 0.85em;
}
.correct-toolbar .btn-sm:hover {
    background: #1d4ed8;
}

.correct-editor-area {
    display: flex;
    gap: 16px;
    min-height: 500px;
}

.correct-editor-pane, .correct-preview-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}

.correct-pane-label {
    padding: 8px 14px;
    font-size: 0.8em;
    font-weight: 600;
    color: #6b7280;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.correct-textarea {
    flex: 1;
    width: 100%;
    min-height: 450px;
    padding: 16px;
    border: none;
    font-family: "SF Mono", "Fira Code", "Consolas", monospace;
    font-size: 0.85em;
    line-height: 1.7;
    resize: vertical;
    outline: none;
    color: #1a1a2e;
    background: #fafbfc;
}

.correct-preview {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    line-height: 1.8;
    font-size: 0.9em;
    color: #374151;
}

.correct-preview h1 { font-size: 1.6em; border-bottom: 2px solid #2563eb; padding-bottom: 6px; margin-bottom: 16px; color: #1e3a5f; }
.correct-preview h2 { font-size: 1.3em; margin-top: 20px; margin-bottom: 10px; color: #1e3a5f; }
.correct-preview h3 { font-size: 1.1em; margin-top: 16px; margin-bottom: 8px; }
.correct-preview p { margin-bottom: 12px; }
.correct-preview table { border-collapse: collapse; width: 100%; margin: 12px 0; }
.correct-preview th, .correct-preview td { border: 1px solid #d1d5db; padding: 8px 12px; text-align: left; }
.correct-preview th { background: #f3f4f6; font-weight: 600; }
.correct-preview code { background: #f3f4f6; padding: 2px 6px; border-radius: 3px; font-size: 0.9em; }
.correct-preview pre { background: #f9fafb; border: 1px solid #e5e7eb; padding: 12px 16px; border-radius: 6px; overflow-x: auto; margin: 12px 0; }
.correct-preview blockquote { border-left: 4px solid #2563eb; padding: 8px 16px; margin: 12px 0; background: #f0f7ff; }
.correct-preview ul, .correct-preview ol { padding-left: 24px; margin: 8px 0; }
.correct-preview li { margin-bottom: 4px; }

/* Uploaded files list */
#uploaded-files-list { display:flex; flex-wrap:wrap; gap:6px; }
.uploaded-file-item {
    display:flex; align-items:center; gap:6px;
    padding:6px 10px; background:#f9fafb; border:1px solid #e5e7eb;
    border-radius:6px; cursor:pointer; font-size:0.82em; transition:all 0.15s;
}
.uploaded-file-item:hover { background:#eff6ff; border-color:#93c5fd; }
.uploaded-file-icon { font-size:1.1em; }
.uploaded-file-name { color:#1f2937; max-width:180px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.uploaded-file-size { color:#9ca3af; font-size:0.85em; }

/* ───── Materials Dashboard ───── */
.dashboard-panel {
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    margin-bottom: 24px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #f3f4f6;
    border-bottom: 1px solid #e5e7eb;
}
.dashboard-header h4 { margin:0; font-size:0.95em; }
.dashboard-body { padding: 16px 20px; }
.dash-summary { display:flex; gap:16px; margin-bottom:16px; flex-wrap:wrap; }
.dash-stat { font-size:0.85em; color:#4b5563; background:#f3f4f6; padding:4px 12px; border-radius:8px; }
.dash-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); gap:10px; margin-bottom:12px; }
.dash-card {
    border:1px solid #e5e7eb; border-radius:8px; padding:12px;
    background:#fafafa; font-size:0.82em;
}
.dash-card.dash-known { border-left:3px solid #22c55e; }
.dash-card.dash-missing { border-left:3px solid #d1d5db; opacity:0.7; }
.dash-card-header { display:flex; align-items:center; gap:6px; margin-bottom:6px; font-weight:600; }
.dash-icon { font-size:0.9em; }
.dash-label { color:#1f2937; }
.dash-items { display:flex; flex-direction:column; gap:3px; }
.dash-item { color:#6b7280; font-size:0.85em; padding:2px 0; border-bottom:1px dashed #f3f4f6; }
.dash-item:last-child { border-bottom:none; }
.dash-contacts { font-size:0.85em; color:#2563eb; padding-top:8px; border-top:1px solid #e5e7eb; }

/* ───── Needs Result ───── */
#needs-result { margin-top:16px; padding:16px 20px; background:#f9fafb; border:1px solid #e5e7eb; border-radius:12px; display:none; }
.needs-section { display:flex; flex-direction:column; gap:4px; margin-bottom:14px; }
.needs-section:last-child { margin-bottom:0; }
.needs-label { font-weight:600; font-size:0.85em; color:#374151; }
.needs-value { font-size:0.9em; color:#1f2937; line-height:1.5; }
.needs-list { display:flex; flex-direction:column; gap:4px; }
.needs-item { padding:6px 10px; background:white; border:1px solid #e5e7eb; border-radius:6px; font-size:0.85em; color:#374151; }
.needs-tags { display:flex; flex-wrap:wrap; gap:6px; }
.needs-tag { padding:3px 10px; background:#eff6ff; border:1px solid #bfdbfe; border-radius:12px; font-size:0.82em; color:#1d4ed8; }
.needs-detail { padding:10px 12px; background:white; border:1px solid #e5e7eb; border-radius:8px; font-size:0.85em; color:#374151; line-height:1.6; white-space:pre-wrap; }
.needs-refs-list { display:flex; flex-direction:column; gap:6px; }
.needs-ref-item { padding:6px 10px; background:#fffbeb; border:1px solid #fde68a; border-radius:6px; font-size:0.82em; color:#92400e; line-height:1.4; }
.needs-ref-item .ref-tag { display:inline-block; padding:1px 6px; background:#7c3aed; color:white; border-radius:4px; font-size:0.75em; margin-right:4px; }

/* ───── Major Incidents Column ───── */
.incident-item {
    display:flex; align-items:flex-start; gap:6px;
    padding:8px 10px; border-radius:6px; margin-bottom:4px;
    font-size:0.85em; line-height:1.4; border-left:3px solid transparent;
}
.incident-positive { background:#f0fdf4; border-left-color:#22c55e; }
.incident-negative { background:#fef2f2; border-left-color:#ef4444; }
.incident-neutral { background:#f9fafb; border-left-color:#9ca3af; }
.incident-nature { font-size:0.8em; white-space:nowrap; flex-shrink:0; }
.incident-text { color:#374151; }

/* ───── Research Summary ───── */
.research-summary-toolbar {
    display:flex; gap:8px; margin-top:16px; padding-top:12px;
    border-top:1px solid #e5e7eb;
}
.research-summary-box {
    margin-top:12px; padding:16px 20px;
    background:#f9fafb; border:1px solid #e5e7eb; border-radius:12px;
    font-size:0.88em; line-height:1.7;
}
.summary-content h1, .summary-content h2, .summary-content h3 {
    color:#1f2937; margin:0.8em 0 0.4em;
}
.summary-content h2 { border-bottom:1px solid #e5e7eb; padding-bottom:4px; }
.summary-content p { margin:0.5em 0; }
.summary-content ul { padding-left:1.5em; }

/* ───── Reference Category ───── */
.ref-upload-row { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-bottom:6px; }
.ref-category-select {
    padding:4px 8px; border:1px solid #d1d5db; border-radius:6px;
    font-size:0.82em; background:white;
}
.ref-cat-tag { display:inline-block; padding:1px 8px; background:#e0e7ff; color:#4338ca; border-radius:8px; font-size:0.8em; margin-left:8px; }

/* ───── Uploaded File Groups ───── */
.uploaded-file-group { margin-bottom:8px; }
.uploaded-file-group-label { font-size:0.8em; font-weight:600; color:#4b5563; margin-bottom:4px; padding:2px 0; border-bottom:1px dashed #e5e7eb; }

/* ───── Structure Display ───── */
.structure-header { font-weight:600; font-size:0.85em; color:#1f2937; margin-bottom:8px; }
.structure-list { display:flex; flex-direction:column; gap:4px; }
.structure-item {
    display:flex; align-items:center; gap:8px;
    padding:6px 10px; background:#f9fafb; border:1px solid #e5e7eb;
    border-radius:6px; font-size:0.85em; color:#374151;
}
.structure-num {
    display:inline-flex; align-items:center; justify-content:center;
    width:20px; height:20px; border-radius:50%;
    background:#2563eb; color:white; font-size:0.75em; font-weight:600; flex-shrink:0;
}

/* ───── col-incident header ───── */
.col-incident { background: linear-gradient(135deg, #7c3aed, #a855f7); }

/* ───── Reference Section Tags ───── */
.ref-section-tags { display:flex; flex-wrap:wrap; gap:4px; margin-top:6px; }
.ref-section-tag {
    display:inline-block; padding:2px 8px;
    background:#fef3c7; border:1px solid #f59e0b; border-radius:10px;
    font-size:0.75em; color:#92400e; font-weight:500;
}

/* ───── Reference Delete Button ───── */
.ref-delete-btn {
    background:transparent; border:none; color:#ef4444; cursor:pointer;
    font-size:0.85em; padding:2px 6px; border-radius:4px; line-height:1;
}
.ref-delete-btn:hover { background:#fef2f2; }
.ref-delete-btn-sm {
    background:transparent; border:none; color:#9ca3af; cursor:pointer;
    font-size:0.75em; padding:0 4px; line-height:1; margin-left:auto; flex-shrink:0;
}
.ref-delete-btn-sm:hover { color:#ef4444; }
.ref-analysis-header { display:flex; justify-content:space-between; align-items:center; }
.uploaded-file-item { display:flex; align-items:center; gap:6px; }

/* ═══ Client Profile Page ═══ */

.profile-input-section {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
}

.profile-input-tabs {
    display: flex;
    background: #f3f4f6;
    border-bottom: 1px solid #e5e7eb;
}

.profile-tab {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: transparent;
    font-size: 0.9em;
    font-family: inherit;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

.profile-tab:hover { color: #374151; background: rgba(255,255,255,0.5); }

.profile-tab.active {
    color: #2563eb;
    font-weight: 600;
    border-bottom-color: #2563eb;
    background: white;
}

.profile-input-body {
    padding: 16px 20px;
}

.profile-input-pane { display: none; }
.profile-input-pane.active { display: block; }

.ai-link-row {
    display: flex;
    gap: 8px;
}

.ai-link-row .url-input { flex: 1; }
.ai-link-row .btn { flex-shrink: 0; }

.profile-input-result {
    margin-top: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
}

.profile-link-result {
    padding: 12px;
    background: white;
    border-radius: 8px;
}

.profile-link-header {
    font-weight: 600;
    color: #16a34a;
    margin-bottom: 8px;
}

.profile-link-analysis-section {
    margin-bottom: 8px;
    padding: 8px 10px;
    background: #f3f4f6;
    border-radius: 6px;
}

.profile-link-analysis-section strong {
    display: block;
    font-size: 0.85em;
    color: #374151;
    margin-bottom: 4px;
}

.profile-link-analysis-section ul {
    margin: 0;
    padding-left: 16px;
    font-size: 0.82em;
    color: #4b5563;
    line-height: 1.6;
}

.profile-link-manual-suggestion {
    margin-top: 10px;
    padding: 12px 16px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    font-size: 0.85em;
    color: #92400e;
    line-height: 1.7;
}

.profile-link-manual-suggestion ol {
    margin: 6px 0;
    padding-left: 20px;
}

.profile-link-manual-suggestion li {
    margin-bottom: 3px;
}

.profile-link-meta-preview {
    margin-top: 8px;
    padding: 8px 10px;
    background: #f3f4f6;
    border-radius: 6px;
    font-size: 0.82em;
    color: #6b7280;
    max-height: 100px;
    overflow-y: auto;
}

.profile-link-client-badge {
    display: inline-block;
    margin: 6px 0 10px 0;
    padding: 4px 12px;
    background: #dbeafe;
    color: #1e40af;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 500;
}

/* Profile Content Area */
.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, #1e3a5f, #2563eb);
    color: white;
    border-radius: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}

.profile-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-header-left h3 {
    font-size: 1.2em;
    font-weight: 700;
}

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

.profile-stat {
    font-size: 0.78em;
    opacity: 0.85;
    background: rgba(255,255,255,0.15);
    padding: 3px 10px;
    border-radius: 10px;
}

.profile-header-right .btn-sm {
    font-size: 0.75em;
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
}
.profile-header-right .btn-sm:hover {
    background: rgba(255,255,255,0.3);
}

.profile-type-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.profile-type-tag {
    display: inline-block;
    padding: 4px 12px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    font-size: 0.78em;
    color: #6b7280;
}

.profile-dimensions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.profile-dim-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}

.profile-dim-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    font-weight: 600;
    font-size: 0.9em;
    color: #374151;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.profile-dim-count {
    font-size: 0.75em;
    font-weight: 400;
    color: #9ca3af;
    margin-left: auto;
}

.profile-dim-body {
    padding: 8px 12px;
}

.profile-source-item {
    padding: 8px 10px;
    margin-bottom: 6px;
    background: #f9fafb;
    border: 1px solid #f3f4f6;
    border-radius: 8px;
    transition: border-color 0.2s;
}

.profile-source-item:hover {
    border-color: #d1d5db;
}

.profile-source-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78em;
    color: #9ca3af;
    margin-bottom: 4px;
}

.profile-source-url {
    text-decoration: none;
    font-size: 0.9em;
}
.profile-source-url:hover { opacity: 0.7; }

.profile-source-time {
    margin-left: auto;
}

.profile-source-delete {
    background: transparent;
    border: none;
    color: #d1d5db;
    cursor: pointer;
    font-size: 0.8em;
    padding: 0 2px;
}
.profile-source-delete:hover { color: #ef4444; }

.profile-source-content {
    font-size: 0.82em;
    color: #4b5563;
    line-height: 1.5;
    max-height: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    word-break: break-all;
    transition: max-height 0.3s ease;
}
.profile-source-content.expanded {
    max-height: 600px;
    white-space: normal;
    overflow-y: auto;
    text-overflow: clip;
}
.profile-source-expand {
    font-size: 0.75em;
    color: #3b82f6;
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 4px;
    margin-top: 2px;
}
.profile-source-expand:hover {
    color: #1d4ed8;
}

.profile-source-kps {
    font-size: 0.75em;
    color: #6b7280;
    margin-top: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-empty {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
    font-size: 0.95em;
    line-height: 1.8;
}

.profile-empty-dim {
    text-align: center;
    padding: 20px;
    color: #9ca3af;
    font-size: 0.85em;
}

/* Client list item actions */
.client-list-item {
    position: relative;
}

.client-list-actions {
    display: flex;
    gap: 2px;
    margin-left: auto;
}

.client-list-actions .btn-xs {
    font-size: 0.7em;
    padding: 0 4px;
    background: transparent;
    color: rgba(255,255,255,0.5);
}
.client-list-actions .btn-xs:hover {
    background: rgba(255,255,255,0.15);
    color: white;
}

/* ═══ AI Research Prompt Generator ═══ */

.profile-prompt-section {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
}

.profile-prompt-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f0f7ff, #e8f4f8);
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
    font-size: 0.9em;
    color: #1e3a5f;
}

.profile-prompt-icon {
    font-size: 1.2em;
}

.profile-prompt-hint {
    font-size: 0.78em;
    font-weight: 400;
    color: #6b7280;
    margin-left: auto;
}

.profile-prompt-body {
    padding: 14px 16px;
}

.prompt-input-row {
    display: flex;
    gap: 8px;
}

.prompt-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.9em;
    font-family: inherit;
    transition: border-color 0.2s;
}

.prompt-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.prompt-result {
    margin-top: 12px;
    padding: 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.prompt-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.85em;
    font-weight: 600;
    color: #374151;
}

.prompt-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.8em;
    font-family: "PingFang SC","Microsoft YaHei",monospace;
    line-height: 1.6;
    color: #1f2937;
    background: white;
    resize: vertical;
    min-height: 200px;
}

.prompt-hint {
    margin-top: 8px;
    font-size: 0.78em;
    color: #6b7280;
    line-height: 1.5;
}

/* ─── Client Confirm Modal ─── */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-dialog {
    background: white;
    border-radius: 12px;
    width: 480px;
    max-width: 90vw;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
}

.modal-lg {
    width: 640px;
    max-width: 94vw;
}

.btn-secondary {
    background: #e5e7eb;
    color: #374151;
}
.btn-secondary:hover { background: #d1d5db; }

.btn-danger {
    background: #ef4444;
    color: white;
}
.btn-danger:hover { background: #dc2626; }

.form-input {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.9em;
    font-family: inherit;
    background: white;
    color: #111827;
}
.form-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37,99,235,0.15);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    margin: 0;
    font-size: 1em;
}

.modal-close {
    cursor: pointer;
    color: #9ca3af;
    font-size: 1.2em;
    padding: 4px;
}

.modal-close:hover { color: #374151; }

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 20px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

/* ─── Client Selector ─── */
.client-selector-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.client-selector-wrapper label {
    font-size: 0.85em;
    color: #6b7280;
    white-space: nowrap;
}

.client-selector {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.85em;
    background: white;
    color: #1f2937;
    max-width: 300px;
}

.client-selector:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37,99,235,0.15);
}

/* ─── Profile Export ─── */
.profile-export-btn {
    margin-left: 6px;
}
