/* =====================================================
   AI市场分析 - 样式表
   ===================================================== */

/* ---- CSS 变量 ---- */
:root {
    --ama-primary: #2563eb;
    --ama-primary-hover: #1d4ed8;
    --ama-primary-light: #eff6ff;
    --ama-success: #059669;
    --ama-warning: #d97706;
    --ama-danger: #dc2626;
    --ama-bg: #f8fafc;
    --ama-surface: #ffffff;
    --ama-border: #e2e8f0;
    --ama-text: #1e293b;
    --ama-text-muted: #64748b;
    --ama-text-light: #94a3b8;
    --ama-shadow-sm: 0 1px 3px rgba(0,0,0,.08);
    --ama-shadow-md: 0 4px 12px rgba(0,0,0,.10);
    --ama-shadow-lg: 0 8px 24px rgba(0,0,0,.12);
    --ama-radius: 10px;
    --ama-radius-sm: 6px;
    --ama-toolbar-h: 48px;
    --ama-transition: 0.2s ease;
    /* SWOT 颜色 */
    --swot-s: #059669;
    --swot-w: #dc2626;
    --swot-o: #2563eb;
    --swot-t: #d97706;
}

/* 暗色主题 */
.ama-dark {
    --ama-primary: #3b82f6;
    --ama-primary-hover: #2563eb;
    --ama-primary-light: #1e3a5f;
    --ama-bg: #0f172a;
    --ama-surface: #1e293b;
    --ama-border: #334155;
    --ama-text: #e2e8f0;
    --ama-text-muted: #94a3b8;
    --ama-text-light: #64748b;
    --ama-shadow-sm: 0 1px 3px rgba(0,0,0,.30);
    --ama-shadow-md: 0 4px 12px rgba(0,0,0,.35);
    --ama-shadow-lg: 0 8px 24px rgba(0,0,0,.40);
    --swot-s: #10b981;
    --swot-w: #f87171;
    --swot-o: #60a5fa;
    --swot-t: #fbbf24;
}

/* ---- 全局容器 ---- */
.ama-container {
    display: flex;
    flex-direction: column;
    background: var(--ama-bg);
    border-radius: var(--ama-radius);
    overflow: hidden;
    box-shadow: var(--ama-shadow-lg);
    min-height: 640px;
    border: 1px solid var(--ama-border);
    transition: background var(--ama-transition), border-color var(--ama-transition);
}

/* ---- 工具栏 ---- */
.ama-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 12px;
    height: var(--ama-toolbar-h);
    background: var(--ama-surface);
    border-bottom: 1px solid var(--ama-border);
    flex-wrap: wrap;
    min-height: var(--ama-toolbar-h);
    transition: background var(--ama-transition), border-color var(--ama-transition);
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 2px;
}

.toolbar-group--right {
    margin-left: auto;
}

.ama-toolbar-btn {
    padding: 5px 11px;
    border: 1px solid var(--ama-border);
    border-radius: var(--ama-radius-sm);
    background: var(--ama-surface);
    color: var(--ama-text);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--ama-transition);
    white-space: nowrap;
}

.ama-toolbar-btn:hover {
    background: var(--ama-primary-light);
    border-color: var(--ama-primary);
    color: var(--ama-primary);
}

.ama-toolbar-btn--ai {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #fff;
    border-color: transparent;
    font-weight: 600;
}

.ama-toolbar-btn--ai:hover {
    background: linear-gradient(135deg, #1d4ed8, #6d28d9);
    color: #fff;
    border-color: transparent;
}

/* ---- 主内容区三列布局 ---- */
.ama-main-content {
    display: grid;
    grid-template-columns: 220px 1fr 1fr;
    min-height: 600px;
    overflow: hidden;
}

/* ---- 历史记录面板 ---- */
.ama-history-panel {
    border-right: 1px solid var(--ama-border);
    display: flex;
    flex-direction: column;
    background: var(--ama-surface);
    overflow: hidden;
    transition: background var(--ama-transition), border-color var(--ama-transition);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px 8px;
    border-bottom: 1px solid var(--ama-border);
    flex-shrink: 0;
}

.panel-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--ama-text);
}

.history-clear-btn {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid var(--ama-border);
    background: transparent;
    color: var(--ama-text-muted);
    cursor: pointer;
    transition: all var(--ama-transition);
}

.history-clear-btn:hover {
    border-color: var(--ama-danger);
    color: var(--ama-danger);
}

.history-search {
    padding: 8px 10px;
    flex-shrink: 0;
}

.history-search input {
    width: 100%;
    padding: 5px 10px;
    border: 1px solid var(--ama-border);
    border-radius: var(--ama-radius-sm);
    font-size: 12px;
    background: var(--ama-bg);
    color: var(--ama-text);
    box-sizing: border-box;
    outline: none;
    transition: border-color var(--ama-transition);
}

.history-search input:focus {
    border-color: var(--ama-primary);
}

.history-search-wrap {
    position: relative;
}

.history-search-wrap input {
    padding-right: 28px;
}

.history-search-clear {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 11px;
    color: var(--ama-text-light);
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    display: none;
    line-height: 1;
    transition: color var(--ama-transition);
}

.history-search-clear:hover {
    color: var(--ama-danger);
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 8px;
}

.history-list::-webkit-scrollbar { width: 4px; }
.history-list::-webkit-scrollbar-track { background: transparent; }
.history-list::-webkit-scrollbar-thumb { background: var(--ama-border); border-radius: 4px; }

.history-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 12px;
    color: var(--ama-text-light);
    font-size: 12px;
    text-align: center;
    gap: 6px;
}

.history-empty-icon { font-size: 32px; }
.history-empty-sub { font-size: 11px; color: var(--ama-text-light); }

.history-item {
    padding: 8px 10px;
    border-radius: var(--ama-radius-sm);
    cursor: pointer;
    border: 1px solid transparent;
    margin-bottom: 4px;
    transition: all var(--ama-transition);
}

.history-item:hover, .history-item.active {
    background: var(--ama-primary-light);
    border-color: var(--ama-primary);
}

.history-item-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--ama-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}

.history-item-meta {
    font-size: 11px;
    color: var(--ama-text-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.history-item-del {
    background: none;
    border: none;
    font-size: 11px;
    color: var(--ama-text-light);
    cursor: pointer;
    padding: 0 2px;
    opacity: 0;
    transition: opacity var(--ama-transition);
}

.history-item:hover .history-item-del {
    opacity: 1;
}

.history-item-del:hover {
    color: var(--ama-danger);
}

/* ---- 编辑器面板 ---- */
.ama-editor-panel {
    border-right: 1px solid var(--ama-border);
    display: flex;
    flex-direction: column;
    background: var(--ama-surface);
    overflow: hidden;
    transition: background var(--ama-transition), border-color var(--ama-transition);
}

.editor-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px 8px;
    border-bottom: 1px solid var(--ama-border);
    flex-shrink: 0;
}

.editor-panel-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--ama-text);
}

.editor-panel-meta {
    font-size: 11px;
    color: var(--ama-text-light);
}

.ama-form {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px;
}

.ama-form::-webkit-scrollbar { width: 5px; }
.ama-form::-webkit-scrollbar-track { background: transparent; }
.ama-form::-webkit-scrollbar-thumb { background: var(--ama-border); border-radius: 4px; }

/* ---- 表单元素 ---- */
.ama-form-group {
    margin-bottom: 14px;
}

.ama-form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 14px;
}

.ama-form-group--half {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
}

.ama-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--ama-text);
    margin-bottom: 5px;
}

.ama-label-hint {
    font-size: 11px;
    font-weight: 400;
    color: var(--ama-text-light);
}

.required-mark {
    color: var(--ama-danger);
}

.ama-input, .ama-select, .ama-textarea {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid var(--ama-border);
    border-radius: var(--ama-radius-sm);
    font-size: 13px;
    color: var(--ama-text);
    background: var(--ama-bg);
    box-sizing: border-box;
    outline: none;
    transition: border-color var(--ama-transition), box-shadow var(--ama-transition);
    font-family: inherit;
}

.ama-input:focus, .ama-select:focus, .ama-textarea:focus {
    border-color: var(--ama-primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.ama-textarea {
    resize: vertical;
    min-height: 72px;
}

.ama-char-counter {
    font-size: 11px;
    color: var(--ama-text-light);
    text-align: right;
    margin-top: 3px;
}

.ama-char-warning { color: var(--ama-warning) !important; }

/* ---- 分析深度选择器 ---- */
.ama-depth-selector {
    display: flex;
    gap: 8px;
}

.ama-depth-item {
    flex: 1;
    cursor: pointer;
}

.ama-depth-item input[type="radio"] {
    display: none;
}

.ama-depth-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 6px;
    border: 2px solid var(--ama-border);
    border-radius: var(--ama-radius-sm);
    background: var(--ama-bg);
    text-align: center;
    transition: all var(--ama-transition);
    gap: 4px;
}

.ama-depth-item input:checked + .ama-depth-card {
    border-color: var(--ama-primary);
    background: var(--ama-primary-light);
}

.ama-depth-item:hover .ama-depth-card {
    border-color: var(--ama-primary);
}

.depth-icon { font-size: 20px; }
.depth-name { font-size: 12px; font-weight: 600; color: var(--ama-text); }
.depth-desc { font-size: 10px; color: var(--ama-text-muted); line-height: 1.4; }

/* ---- 复选框 ---- */
.ama-checkbox-quick {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    font-size: 11px;
    color: var(--ama-text-muted);
}

.ama-checkbox-quick-btn {
    background: none;
    border: none;
    color: var(--ama-primary);
    font-size: 11px;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.ama-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ama-checkbox-item {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
    color: var(--ama-text);
    user-select: none;
}

.ama-checkbox-item input[type="checkbox"] {
    display: none;
}

.ama-checkbox-mark {
    width: 16px;
    height: 16px;
    border: 2px solid var(--ama-border);
    border-radius: 3px;
    background: var(--ama-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--ama-transition);
    flex-shrink: 0;
}

.ama-checkbox-item input:checked + .ama-checkbox-mark {
    background: var(--ama-primary);
    border-color: var(--ama-primary);
}

.ama-checkbox-item input:checked + .ama-checkbox-mark::after {
    content: '✓';
    color: #fff;
    font-size: 10px;
    font-weight: 700;
}

/* ---- 快捷键提示 ---- */
.shortcut-hint {
    font-size: 0.8em;
    opacity: 0.7;
    color: var(--ama-text-muted);
    white-space: nowrap;
    transition: transform 0.15s ease;
    align-self: center;
    letter-spacing: 0.02em;
}

.shortcut-hint:hover {
    transform: scale(1.05);
    opacity: 1;
}

/* ---- 历史条目行业 badge ---- */
.history-item-industry {
    display: inline-block;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 8px;
    background: var(--ama-primary-light);
    color: var(--ama-primary);
    margin-top: 3px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border: 1px solid var(--ama-border);
}

/* ---- 按钮 ---- */
.ama-form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
}

.ama-btn {
    padding: 9px 20px;
    border-radius: var(--ama-radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all var(--ama-transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.ama-btn--primary {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #fff;
    flex: 1;
    justify-content: center;
}

.ama-btn--primary:hover {
    background: linear-gradient(135deg, #1d4ed8, #6d28d9);
    transform: translateY(-1px);
    box-shadow: var(--ama-shadow-md);
}

.ama-btn--primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.ama-btn--secondary {
    background: var(--ama-bg);
    color: var(--ama-text-muted);
    border: 1px solid var(--ama-border);
}

.ama-btn--secondary:hover {
    border-color: var(--ama-primary);
    color: var(--ama-primary);
}

/* ---- 预览面板 ---- */
.ama-preview-panel {
    display: flex;
    flex-direction: column;
    background: var(--ama-bg);
    overflow: hidden;
    transition: background var(--ama-transition);
    position: relative;
}

.preview-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px 8px;
    border-bottom: 1px solid var(--ama-border);
    background: var(--ama-surface);
    flex-shrink: 0;
}

.preview-panel-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--ama-text);
}

.preview-panel-actions {
    display: flex;
    gap: 6px;
}

.preview-action-btn {
    padding: 4px 10px;
    font-size: 12px;
    border: 1px solid var(--ama-border);
    border-radius: 4px;
    background: var(--ama-surface);
    color: var(--ama-text-muted);
    cursor: pointer;
    transition: all var(--ama-transition);
}

.preview-action-btn:hover {
    border-color: var(--ama-primary);
    color: var(--ama-primary);
}

.preview-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.preview-content::-webkit-scrollbar { width: 5px; }
.preview-content::-webkit-scrollbar-track { background: transparent; }
.preview-content::-webkit-scrollbar-thumb { background: var(--ama-border); border-radius: 4px; }

/* 空状态 */
.preview-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    color: var(--ama-text-light);
    text-align: center;
    gap: 10px;
}

.preview-empty-icon { font-size: 52px; opacity: 0.4; }
.preview-empty-title { font-size: 16px; font-weight: 600; color: var(--ama-text-muted); }
.preview-empty-hint { font-size: 13px; color: var(--ama-text-light); line-height: 1.6; }

/* 加载状态 */
.preview-loading {
    position: absolute;
    inset: 0;
    background: rgba(248,250,252,.92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    z-index: 10;
    border-radius: var(--ama-radius);
}

.ama-dark .preview-loading {
    background: rgba(15,23,42,.92);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--ama-border);
    border-top-color: var(--ama-primary);
    border-radius: 50%;
    animation: ama-spin 0.8s linear infinite;
}

@keyframes ama-spin { to { transform: rotate(360deg); } }

.loading-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--ama-text);
}

.loading-hint {
    font-size: 12px;
    color: var(--ama-text-muted);
    text-align: center;
    max-width: 240px;
}

.cancel-generate-btn {
    padding: 6px 18px;
    border: 1px solid var(--ama-border);
    border-radius: var(--ama-radius-sm);
    background: var(--ama-surface);
    color: var(--ama-text-muted);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--ama-transition);
    margin-top: 4px;
}

.cancel-generate-btn:hover {
    border-color: var(--ama-danger);
    color: var(--ama-danger);
}

/* ---- 报告渲染区块 ---- */
.report-section {
    background: var(--ama-surface);
    border-radius: var(--ama-radius);
    padding: 16px 18px;
    margin-bottom: 14px;
    border: 1px solid var(--ama-border);
    box-shadow: var(--ama-shadow-sm);
    transition: box-shadow var(--ama-transition);
}

.report-section:hover {
    box-shadow: var(--ama-shadow-md);
}

.report-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.report-section-header h4 { cursor: pointer; }

.section-title-bar {
    width: 4px;
    height: 20px;
    border-radius: 2px;
    background: var(--ama-primary);
    flex-shrink: 0;
}

.section-overview .section-title-bar { background: #2563eb; }
.section-trends .section-title-bar   { background: #059669; }
.section-competitors .section-title-bar { background: #d97706; }
.section-swot .section-title-bar     { background: #7c3aed; }
.section-opportunities .section-title-bar { background: #0891b2; }
.section-suggestions .section-title-bar  { background: #dc2626; }

.report-section-header h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--ama-text);
    flex: 1;
}

.section-collapse-btn {
    font-size: 12px;
    color: var(--ama-text-light);
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all var(--ama-transition);
}

.section-collapse-btn:hover {
    background: var(--ama-primary-light);
    color: var(--ama-primary);
}

.section-copy-btn {
    font-size: 11px;
    padding: 2px 8px;
    border: 1px solid var(--ama-border);
    border-radius: 4px;
    background: transparent;
    color: var(--ama-text-muted);
    cursor: pointer;
    transition: all var(--ama-transition);
}

.section-copy-btn:hover {
    border-color: var(--ama-primary);
    color: var(--ama-primary);
}

.section-copy-btn--done {
    border-color: var(--ama-success);
    color: var(--ama-success);
    background: rgba(5,150,105,.07);
}

.report-section-desc {
    font-size: 13px;
    color: var(--ama-text-muted);
    line-height: 1.7;
    margin-bottom: 10px;
    padding: 10px 12px;
    background: var(--ama-bg);
    border-radius: var(--ama-radius-sm);
    border-left: 3px solid var(--ama-border);
}

.section-overview .report-section-desc      { border-left-color: #2563eb; }
.section-trends .report-section-desc        { border-left-color: #059669; }
.section-competitors .report-section-desc   { border-left-color: #d97706; }
.section-swot .report-section-desc          { border-left-color: #7c3aed; }
.section-opportunities .report-section-desc { border-left-color: #0891b2; }
.section-suggestions .report-section-desc   { border-left-color: #dc2626; }

.raw-report-pre {
    white-space: pre-wrap;
    font-size: 12px;
    line-height: 1.7;
    color: var(--ama-text);
    margin: 0;
    font-family: inherit;
}

/* 关键点列表 */
.key-points-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.key-points-list li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: var(--ama-text);
    padding: 6px 10px;
    border-radius: var(--ama-radius-sm);
    background: var(--ama-primary-light);
}

.key-points-list li::before {
    content: '📌';
    flex-shrink: 0;
    font-size: 12px;
    margin-top: 1px;
}

/* 趋势/机会列表 */
.items-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.item-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--ama-radius-sm);
    background: var(--ama-bg);
    border: 1px solid var(--ama-border);
    transition: border-color var(--ama-transition);
}

.item-card:hover {
    border-color: var(--ama-primary);
}

.item-card-icon {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.item-card-body { flex: 1; min-width: 0; }

.item-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--ama-text);
    margin-bottom: 3px;
}

.item-card-desc {
    font-size: 12px;
    color: var(--ama-text-muted);
    line-height: 1.6;
}

.item-card-badge {
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 600;
    flex-shrink: 0;
    align-self: flex-start;
}

.badge-high   { background: #dcfce7; color: #15803d; }
.badge-medium { background: #fef9c3; color: #92400e; }
.badge-low    { background: #f3f4f6; color: #6b7280; }
.ama-dark .badge-high   { background: #14532d; color: #4ade80; }
.ama-dark .badge-medium { background: #451a03; color: #fbbf24; }
.ama-dark .badge-low    { background: #374151; color: #9ca3af; }

/* 竞争格局 */
.competitor-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-top: 8px;
}

.competitor-table th {
    padding: 8px 12px;
    text-align: left;
    background: var(--ama-primary-light);
    color: var(--ama-primary);
    font-weight: 600;
    border-bottom: 2px solid var(--ama-primary);
    white-space: nowrap;
}

.competitor-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--ama-border);
    color: var(--ama-text);
    line-height: 1.5;
    vertical-align: top;
}

.competitor-table tr:last-child td {
    border-bottom: none;
}

.competitor-table tr:hover td {
    background: var(--ama-bg);
}

/* SWOT 四象限 */
.swot-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 4px;
}

.swot-quad {
    border-radius: var(--ama-radius-sm);
    padding: 12px 14px;
    border: 1px solid;
}

.swot-quad--s { background: rgba(5,150,105,.07); border-color: var(--swot-s); }
.swot-quad--w { background: rgba(220,38,38,.07); border-color: var(--swot-w); }
.swot-quad--o { background: rgba(37,99,235,.07); border-color: var(--swot-o); }
.swot-quad--t { background: rgba(217,119,6,.07); border-color: var(--swot-t); }

.swot-quad-title {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.swot-quad--s .swot-quad-title { color: var(--swot-s); }
.swot-quad--w .swot-quad-title { color: var(--swot-w); }
.swot-quad--o .swot-quad-title { color: var(--swot-o); }
.swot-quad--t .swot-quad-title { color: var(--swot-t); }

.swot-items {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.swot-items li {
    font-size: 12px;
    color: var(--ama-text);
    padding: 3px 0;
    display: flex;
    align-items: flex-start;
    gap: 5px;
    line-height: 1.5;
}

.swot-items li::before {
    content: '•';
    flex-shrink: 0;
    font-weight: 700;
}

.swot-quad--s .swot-items li::before { color: var(--swot-s); }
.swot-quad--w .swot-items li::before { color: var(--swot-w); }
.swot-quad--o .swot-items li::before { color: var(--swot-o); }
.swot-quad--t .swot-items li::before { color: var(--swot-t); }

/* 优先级标签 */
.priority-badge {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 700;
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 2px;
}

.priority-urgent   { background: #fee2e2; color: #dc2626; }
.priority-important { background: #fef9c3; color: #92400e; }
.priority-longterm { background: #dbeafe; color: #1d4ed8; }
.ama-dark .priority-urgent    { background: #7f1d1d; color: #fca5a5; }
.ama-dark .priority-important { background: #451a03; color: #fbbf24; }
.ama-dark .priority-longterm  { background: #1e3a5f; color: #93c5fd; }

/* ---- Toast ---- */
.ama-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(60px);
    background: #1e293b;
    color: #fff;
    padding: 10px 20px;
    border-radius: 24px;
    font-size: 13px;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: var(--ama-shadow-lg);
}

.ama-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.ama-toast.toast-success { background: #059669; }
.ama-toast.toast-error   { background: #dc2626; }
.ama-toast.toast-info    { background: #2563eb; }

/* ---- 模态框 ---- */
.ama-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.ama-modal.open {
    display: flex;
}

.ama-modal-content {
    background: var(--ama-surface);
    border-radius: var(--ama-radius);
    box-shadow: var(--ama-shadow-lg);
    width: 90%;
    max-width: 620px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ama-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--ama-border);
}

.ama-modal-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--ama-text);
}

.ama-modal-close {
    background: none;
    border: none;
    font-size: 16px;
    color: var(--ama-text-light);
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all var(--ama-transition);
}

.ama-modal-close:hover {
    background: var(--ama-bg);
    color: var(--ama-text);
}

.ama-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 18px;
}

.template-modal-hint {
    font-size: 12px;
    color: var(--ama-text-muted);
    margin-bottom: 14px;
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.template-card {
    padding: 14px;
    border: 2px solid var(--ama-border);
    border-radius: var(--ama-radius-sm);
    cursor: pointer;
    transition: all var(--ama-transition);
    background: var(--ama-bg);
}

.template-card:hover {
    border-color: var(--ama-primary);
    background: var(--ama-primary-light);
}

.template-card-icon { font-size: 24px; margin-bottom: 6px; }

.template-card-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--ama-text);
    margin-bottom: 4px;
}

.template-card-desc {
    font-size: 11px;
    color: var(--ama-text-muted);
    line-height: 1.5;
}

/* ---- 全屏模式 ---- */
.ama-fullscreen .ama-container {
    position: fixed;
    inset: 0;
    z-index: 900;
    border-radius: 0;
    margin: 0;
}

.ama-fullscreen .ama-main-content {
    height: calc(100vh - var(--ama-toolbar-h));
}

/* ---- 响应式 ---- */
@media (max-width: 768px) {
    .ama-main-content {
        grid-template-columns: 160px 1fr 1fr;
    }
    .panel-header h3 { font-size: 12px; }
}

@media (max-width: 640px) {
    .ama-main-content {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }
    .ama-history-panel {
        border-right: none;
        border-bottom: 1px solid var(--ama-border);
        max-height: 180px;
    }
    .ama-editor-panel {
        border-right: none;
        border-bottom: 1px solid var(--ama-border);
    }
    .ama-depth-selector { flex-direction: column; }
    .swot-grid { grid-template-columns: 1fr; }
    .ama-form-row { flex-direction: column; gap: 0; }
    .ama-form-group--half { margin-bottom: 14px; }
    .template-grid { grid-template-columns: 1fr; }
    .ama-toolbar { gap: 2px; }
    .ama-toolbar-btn { padding: 4px 8px; font-size: 12px; }
    .shortcut-hint { display: none; }
}
