/* 安索夫矩阵工具面板 */
.ansoff-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;
}

.ansoff-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;
}

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

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

.ansoff-title i { color: #6366f1; }

.ansoff-badge {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}

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

.ansoff-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;
}

.ansoff-btn:hover {
    border-color: #6366f1;
    color: #6366f1;
}

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

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

.ansoff-canvas-wrap {
    flex: 1;
    overflow: auto;
    padding: 16px;
    background-color: #eef1f5;
    background-image: radial-gradient(circle, #c5cdd8 1px, transparent 1px);
    background-size: 18px 18px;
    min-height: 480px;
}

.ansoff-board {
    max-width: 960px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
    padding: 24px 28px 20px;
    min-width: 680px;
}

.ansoff-map-header {
    margin-bottom: 20px;
}

.ansoff-map-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

.ansoff-map-subtitle {
    margin: 4px 0 0;
    font-size: 0.82rem;
    color: #64748b;
}

/* 矩阵布局：Y 轴 + 主区域 */
.ansoff-matrix-layout {
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 8px;
    align-items: stretch;
}

.ansoff-y-axis {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0 36px;
    position: relative;
}

.ansoff-y-axis::after {
    content: '';
    position: absolute;
    top: 28px;
    bottom: 44px;
    left: 50%;
    width: 2px;
    background: #cbd5e1;
    transform: translateX(-50%);
}

.ansoff-matrix-main {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ansoff-x-axis {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    position: relative;
    min-height: 28px;
}

.ansoff-x-axis::before {
    content: '';
    position: absolute;
    left: 12px;
    right: 12px;
    top: 50%;
    height: 2px;
    background: #cbd5e1;
    transform: translateY(-50%);
}

.ansoff-axis-name {
    position: relative;
    z-index: 1;
    font-size: 0.78rem;
    font-weight: 700;
    color: #475569;
    background: #fff;
    padding: 0 8px;
}

.ansoff-y-axis .ansoff-axis-name {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    letter-spacing: 0.15em;
    padding: 8px 0;
}

.ansoff-axis-tip {
    position: relative;
    z-index: 1;
    font-size: 0.72rem;
    font-weight: 600;
    color: #94a3b8;
    background: #f1f5f9;
    border-radius: 6px;
    padding: 2px 8px;
}

.ansoff-axis-new { color: #6366f1; background: rgba(99, 102, 241, 0.08); }
.ansoff-axis-old { color: #64748b; }

/* 2×2 象限 */
.ansoff-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 12px;
    min-height: 420px;
}

.ansoff-quadrant {
    position: relative;
    border-radius: 10px;
    border: 1.5px solid transparent;
    padding: 12px 14px 32px;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.ansoff-q-md {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.ansoff-q-d {
    background: #f5f3ff;
    border-color: #ddd6fe;
}

.ansoff-q-mp {
    background: #fffbeb;
    border-color: #fde68a;
}

.ansoff-q-pd {
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.ansoff-q-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.ansoff-q-tag {
    font-size: 0.65rem;
    font-weight: 500;
    color: #64748b;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 6px;
    padding: 2px 8px;
}

.ansoff-q-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 700;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.ansoff-q-head i {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.ansoff-q-head em {
    font-style: normal;
    font-weight: 500;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-left: 2px;
}

.ansoff-head-blue   { color: #2563eb; }
.ansoff-head-purple { color: #7c3aed; }
.ansoff-head-amber  { color: #d97706; }
.ansoff-head-teal   { color: #059669; }

.ansoff-notes {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-height: 0;
}

.ansoff-note {
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    line-height: 1.5;
    color: #1e293b;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.25);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    outline: none;
    cursor: text;
    word-break: break-word;
}

.ansoff-note:empty::before {
    content: '点击输入…';
    color: #94a3b8;
}

.ansoff-note:focus {
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.35);
    border-color: #a5b4fc;
}

.ansoff-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.85);
    color: #64748b;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.55;
    transition: opacity 0.15s;
}

.ansoff-quadrant:hover .ansoff-btn-add-note { opacity: 1; }

.ansoff-btn-add-note:hover {
    border-color: #6366f1;
    color: #6366f1;
}
@media (max-width: 768px) {
    .ansoff-board {
        min-width: 620px;
        padding: 16px 18px;
    }

    .ansoff-grid {
        min-height: 360px;
    }
}
