/* SWOT 分析工具面板 */
.swot-tool-panel {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
    min-height: 0;
}

.swot-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-muted, #f9fafb);
    flex-shrink: 0;
}

.swot-toolbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.swot-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.swot-title i { color: #3b82f6; }

.swot-badge {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.swot-toolbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.swot-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    font-size: 0.78rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.swot-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

.swot-btn-primary {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    border-color: transparent;
    color: #fff !important;
}

.swot-btn-primary:hover {
    opacity: 0.88;
    border-color: transparent !important;
}

.swot-canvas-wrap {
    flex: 1;
    overflow: auto;
    padding: 16px;
    background-color: #f8fafc;
    background-image: radial-gradient(circle, #e2e8f0 1px, transparent 1px);
    background-size: 24px 24px;
    min-height: 480px;
}

/* 3×3 矩阵 */
.swot-board {
    display: grid;
    grid-template-columns: minmax(100px, 120px) 1fr 1fr;
    grid-template-rows: minmax(140px, 1fr) minmax(160px, 1.1fr) minmax(160px, 1.1fr);
    gap: 3px;
    min-width: 720px;
    max-width: 1100px;
    margin: 0 auto;
    background: #e2e8f0;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.swot-cell {
    position: relative;
    background: #fff;
    padding: 10px 12px 28px;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* 内外因素轴 */
.swot-cell-axis {
    padding: 0;
    background: #fff;
    overflow: hidden;
}

.swot-axis-line {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom left,
        transparent calc(50% - 1px),
        #cbd5e1 calc(50% - 1px),
        #cbd5e1 calc(50% + 1px),
        transparent calc(50% + 1px)
    );
    pointer-events: none;
}

.swot-axis-ext {
    position: absolute;
    top: 14px;
    right: 12px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #10b981;
}

.swot-axis-int {
    position: absolute;
    bottom: 14px;
    left: 12px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #3b82f6;
}

/* 象限底色 */
.swot-cell-o { background: #ecfdf5; }
.swot-cell-t { background: #fdf2f8; }
.swot-cell-s { background: #eff6ff; }
.swot-cell-w { background: #fef2f2; }

.swot-cell-head {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    flex-shrink: 0;
}

.swot-head-en {
    font-weight: 500;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.swot-head-green { color: #059669; }
.swot-head-pink  { color: #db2777; }
.swot-head-blue  { color: #2563eb; }
.swot-head-red   { color: #dc2626; }

/* 策略格 */
.swot-cell-strategy {
    background: #fff;
}

.swot-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -55%);
    font-size: 4.5rem;
    font-weight: 800;
    color: rgba(148, 163, 184, 0.12);
    pointer-events: none;
    user-select: none;
    line-height: 1;
    z-index: 0;
}

.swot-cell-strategy .swot-cell-head,
.swot-cell-strategy .swot-notes,
.swot-cell-strategy .swot-strategy-hint {
    position: relative;
    z-index: 1;
}

.swot-strategy-hint {
    margin: auto 0 0;
    padding-top: 6px;
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.4;
    flex-shrink: 0;
}

/* 便签 */
.swot-notes {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-height: 0;
}

.swot-note {
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    line-height: 1.45;
    color: #1e293b;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    outline: none;
    cursor: text;
    word-break: break-word;
}

.swot-note:empty::before {
    content: attr(data-placeholder);
    color: #94a3b8;
}

.swot-note:focus {
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.35);
}

.swot-note-white  { background: #fff; border: 1px solid #e2e8f0; }
.swot-note-green  { background: #d1fae5; border: 1px solid #a7f3d0; }
.swot-note-yellow { background: #fef9c3; border: 1px solid #fde047; }

.swot-note-bullet {
    background: transparent;
    box-shadow: none;
    border: none;
    padding: 4px 4px 4px 18px;
    position: relative;
}

.swot-note-bullet::before {
    content: '•';
    position: absolute;
    left: 4px;
    color: #3b82f6;
    font-weight: 700;
}

.swot-notes-list .swot-note-bullet {
    color: #1d4ed8;
}

.swot-btn-add-note {
    position: absolute;
    right: 8px;
    bottom: 6px;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 1px dashed #cbd5e1;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.8);
    color: #64748b;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    transition: opacity 0.15s;
}

.swot-cell:hover .swot-btn-add-note { opacity: 1; }

.swot-btn-add-note:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}
@media (max-width: 768px) {
    .swot-board {
        min-width: 600px;
    }

    .swot-watermark {
        font-size: 3rem;
    }
}
