/* ============================================================
   店铺规划PPT（进阶版）— 页面专用样式（前缀 stp-）
   依赖全站变量：base.css / components.css / layout.css
   ============================================================ */

/* ---- 6模块概览卡片行 ---- */
.stp-overview {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin-bottom: var(--spacing-xl);
}
.stp-ov-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 14px 10px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    border-top: 3px solid var(--stp-accent, #2563eb);
    position: relative;
}
.stp-ov-card:hover   { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stp-ov-card.done    { border-top-color: var(--color-success); }
.stp-ov-card.done::after {
    content: '✓';
    position: absolute; top: 6px; right: 8px;
    font-size: 0.65rem; font-weight: 700;
    color: var(--color-success);
}
.stp-ov-icon  { font-size: 1.4rem; margin-bottom: 6px; color: var(--stp-accent, #2563eb); }
.stp-ov-name  { font-size: 0.72rem; font-weight: 600; color: var(--text-primary); line-height: 1.3; }

/* 每张卡片主题色 */
.stp-ov-card:nth-child(1) { --stp-accent: #2563eb; } .stp-ov-card:nth-child(1) .stp-ov-icon { color: #2563eb; }
.stp-ov-card:nth-child(2) { --stp-accent: #059669; } .stp-ov-card:nth-child(2) .stp-ov-icon { color: #059669; }
.stp-ov-card:nth-child(3) { --stp-accent: #d97706; } .stp-ov-card:nth-child(3) .stp-ov-icon { color: #d97706; }
.stp-ov-card:nth-child(4) { --stp-accent: #dc2626; } .stp-ov-card:nth-child(4) .stp-ov-icon { color: #dc2626; }
.stp-ov-card:nth-child(5) { --stp-accent: #7c3aed; } .stp-ov-card:nth-child(5) .stp-ov-icon { color: #7c3aed; }
.stp-ov-card:nth-child(6) { --stp-accent: #0891b2; } .stp-ov-card:nth-child(6) .stp-ov-icon { color: #0891b2; }

/* ---- 模块区块（可折叠） ---- */
.stp-module {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-lg);
    overflow: hidden;
    transition: box-shadow var(--transition-fast);
}
.stp-module:target, .stp-module.active { box-shadow: var(--shadow-md); }

.stp-module-hd {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid transparent;
    transition: background var(--transition-fast);
}
.stp-module-hd:hover { background: var(--border-light); }
.stp-module.open .stp-module-hd { border-bottom-color: var(--border-color); }

.stp-module-num {
    width: 28px; height: 28px;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.8rem; font-weight: 700; color: white;
    flex-shrink: 0;
    background: var(--stp-mod-color, #2563eb);
}
.stp-module-title {
    flex: 1;
    font-size: 0.97rem; font-weight: 700; color: var(--text-primary);
}
.stp-module-sub {
    font-size: 0.78rem; color: var(--text-muted);
    font-weight: 400; margin-left: 4px;
}
.stp-module-badge {
    font-size: 0.68rem; font-weight: 600;
    padding: 2px 8px; border-radius: var(--radius-full);
    background: var(--stp-badge-bg, #dbeafe);
    color: var(--stp-badge-color, #1d4ed8);
}
.stp-module-done-tag {
    font-size: 0.68rem; font-weight: 600;
    padding: 2px 8px; border-radius: var(--radius-full);
    background: var(--color-success-light); color: var(--color-success-dark);
    display: none;
}
.stp-module.done .stp-module-done-tag { display: inline-block; }
.stp-chevron {
    font-size: 1rem; color: var(--text-muted);
    transition: transform var(--transition-fast);
}
.stp-module.open .stp-chevron { transform: rotate(180deg); }

.stp-module-bd {
    display: none;
    padding: 20px;
}
.stp-module.open .stp-module-bd { display: block; }

/* ---- 两栏布局（表格 + 图表） ---- */
.stp-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}
.stp-panel-title {
    font-size: 0.85rem; font-weight: 700; color: var(--text-secondary);
    margin-bottom: 10px;
    display: flex; align-items: center; gap: 6px;
}

/* ---- 内联可编辑表格 ---- */
.stp-tbl-wrap { overflow-x: auto; }
.stp-tbl {
    width: 100%; border-collapse: collapse;
    font-size: 0.8rem;
}
.stp-tbl th {
    background: var(--border-light);
    color: var(--text-secondary);
    font-weight: 600; font-size: 0.75rem;
    padding: 7px 8px; text-align: left;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}
.stp-tbl td {
    padding: 4px 4px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}
.stp-tbl td input, .stp-tbl td select {
    width: 100%; padding: 5px 6px;
    border: 1px solid transparent; border-radius: var(--radius-sm);
    font-size: 0.8rem; background: transparent;
    color: var(--text-primary);
    transition: border-color var(--transition-fast), background var(--transition-fast);
    outline: none;
}
.stp-tbl td input:focus, .stp-tbl td select:focus {
    border-color: var(--action-color);
    background: white;
}
.stp-tbl tr:hover td { background: var(--border-light); }
.stp-tbl tr:hover td input, .stp-tbl tr:hover td select { background: white; }

.stp-del-row {
    padding: 3px 8px; border: none; border-radius: var(--radius-sm);
    background: var(--color-danger-light); color: var(--color-danger-dark);
    font-size: 0.75rem; cursor: pointer; transition: all var(--transition-fast);
}
.stp-del-row:hover { background: var(--color-danger); color: white; }

.stp-tbl-actions {
    display: flex; align-items: center; gap: 8px;
    margin-top: 8px;
}
.stp-add-row {
    padding: 5px 12px; border: 1px dashed var(--action-color);
    border-radius: var(--radius-md); background: transparent;
    color: var(--action-color); font-size: 0.8rem;
    cursor: pointer; transition: all var(--transition-fast);
    display: inline-flex; align-items: center; gap: 4px;
}
.stp-add-row:hover { background: var(--action-color); color: white; }
.stp-dl-tpl {
    padding: 5px 12px; border: 1px dashed var(--border-color);
    border-radius: var(--radius-md); background: transparent;
    color: var(--text-muted); font-size: 0.8rem;
    cursor: pointer; transition: all var(--transition-fast);
    text-decoration: none;
    display: inline-flex; align-items: center; gap: 4px;
}
.stp-dl-tpl:hover { border-color: var(--action-color); color: var(--action-color); }

/* ---- 图表区 ---- */
.stp-chart-wrap {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.stp-chart-hd {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    background: var(--border-light);
}
.stp-chart-label { font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); }
.stp-chart-box {
    height: 320px;
    background: white;
}
.stp-chart-placeholder {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    height: 100%; color: var(--text-muted);
    font-size: 0.85rem; gap: 8px;
}
.stp-chart-placeholder i { font-size: 2rem; opacity: 0.4; }

/* ---- 操作按钮行 ---- */
.stp-module-actions {
    display: flex; align-items: center; gap: 10px;
    flex-wrap: wrap; margin-bottom: var(--spacing-lg);
}
.stp-btn {
    padding: 9px 18px; border: none; border-radius: var(--radius-md);
    font-size: 0.88rem; font-weight: 600; cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
    transition: all var(--transition-fast); white-space: nowrap;
}
.stp-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.stp-btn-primary { background: var(--action-color); color: white; }
.stp-btn-primary:hover:not(:disabled) { background: var(--action-hover); transform: translateY(-1px); }
.stp-btn-ai { background: #7c3aed; color: white; }
.stp-btn-ai:hover:not(:disabled) { background: #6d28d9; transform: translateY(-1px); }
.stp-btn-demo {
    background: transparent; color: var(--action-color);
    border: 1px dashed var(--action-color);
}
.stp-btn-demo:hover { background: var(--action-color); color: white; }
.stp-btn-sm { padding: 5px 12px; font-size: 0.78rem; }

/* ---- AI 文案区 ---- */
.stp-ai-area {
    background: #fefce8;
    border: 1px dashed #f59e0b;
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    margin-top: var(--spacing-md);
}
.stp-ai-area-hd {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 8px;
}
.stp-ai-area-title {
    font-size: 0.82rem; font-weight: 700; color: #92400e;
    display: flex; align-items: center; gap: 5px;
}
.stp-ai-placeholder {
    font-size: 0.82rem; color: #a16207; font-style: italic;
    line-height: 1.6;
}
.stp-ai-text {
    font-size: 0.85rem; color: var(--text-primary);
    line-height: 1.8; white-space: pre-wrap;
}
.stp-copy-btn {
    padding: 4px 10px; border: 1px solid #f59e0b;
    border-radius: var(--radius-sm); background: white;
    color: #92400e; font-size: 0.75rem; cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex; align-items: center; gap: 4px;
}
.stp-copy-btn:hover { background: #f59e0b; color: white; border-color: #f59e0b; }
.stp-copy-btn.copied { background: var(--color-success); color: white; border-color: var(--color-success); }

/* ---- 导出区 ---- */
.stp-export-bar {
    background: white; border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 14px; flex-wrap: wrap;
    margin-top: var(--spacing-xl);
    box-shadow: var(--shadow-md);
}
.stp-export-info { font-size: 0.85rem; color: var(--text-secondary); }
.stp-export-info strong { color: var(--text-primary); }
.stp-export-btn {
    padding: 11px 28px; border: none; border-radius: var(--radius-md);
    background: linear-gradient(135deg, #1d4ed8, #6d28d9);
    color: white; font-size: 0.95rem; font-weight: 700;
    cursor: pointer; transition: all var(--transition-fast);
    display: inline-flex; align-items: center; gap: 8px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
.stp-export-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(37, 99, 235, 0.4); }
.stp-export-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
.stp-progress-pills {
    display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
}
.stp-pill {
    font-size: 0.7rem; font-weight: 600;
    padding: 3px 9px; border-radius: var(--radius-full);
    background: var(--border-light); color: var(--text-muted);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}
.stp-pill.ready { background: var(--color-success-light); color: var(--color-success-dark); border-color: #86efac; }

/* ---- 字段提示框 ---- */
.stp-field-hint {
    padding: 10px 12px;
    background: var(--border-light); border: 1px solid var(--border-color);
    border-radius: var(--radius-md); font-size: 0.75rem;
    color: var(--text-secondary); margin-bottom: 10px;
    display: flex; flex-wrap: wrap; gap: 5px; align-items: flex-start;
}
.stp-field-hint strong { color: var(--text-primary); width: 100%; margin-bottom: 4px; }
.stp-tag-req {
    padding: 2px 7px; border-radius: var(--radius-sm);
    background: var(--color-danger-light); color: var(--color-danger-dark);
    font-weight: 600;
}
.stp-tag-opt {
    padding: 2px 7px; border-radius: var(--radius-sm);
    background: var(--color-success-light); color: var(--color-success-dark);
}

/* ---- 加载状态 ---- */
.stp-spin {
    display: inline-block;
    width: 14px; height: 14px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: white;
    border-radius: 50%;
    animation: stpSpin 0.7s linear infinite;
}
@keyframes stpSpin { to { transform: rotate(360deg); } }

/* ---- 响应式 ---- */
@media (max-width: 1024px) {
    .stp-overview { grid-template-columns: repeat(3, 1fr); }
    .stp-two-col  { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .stp-overview { grid-template-columns: repeat(2, 1fr); }
    .stp-module-hd { padding: 12px 14px; }
    .stp-module-bd { padding: 14px; }
    .stp-export-bar { flex-direction: column; align-items: stretch; }
    .stp-export-btn { justify-content: center; }
}

/* ---- 图表维度说明栏 ---- */
.stp-chart-dim-legend {
    display: flex; flex-wrap: wrap; gap: 10px 20px;
    padding: 8px 14px;
    background: var(--border-light);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.75rem; color: var(--text-secondary);
}
.stp-chart-dim-legend span { display: flex; align-items: center; gap: 4px; }
.stp-chart-dim-legend i { font-size: 0.82rem; color: var(--text-muted); }
.stp-chart-dim-legend strong { color: var(--text-primary); }

/* ---- 日期/月份选择器 ---- */
.stp-tbl td input[type="month"],
.stp-tbl td input[type="date"] {
    min-width: 120px;
    cursor: pointer;
    color-scheme: light;
}

/* ---- 暗色主题覆盖 ---- */
[data-theme="dark"] .stp-module {
    background: var(--bg-card);
    border-color: var(--border-color);
}
[data-theme="dark"] .stp-module-hd:hover {
    background: var(--border-light);
}
[data-theme="dark"] .stp-tbl td input,
[data-theme="dark"] .stp-tbl td select {
    color: var(--text-primary);
    background: transparent;
}
[data-theme="dark"] .stp-tbl td input[type="month"],
[data-theme="dark"] .stp-tbl td input[type="date"] {
    color-scheme: dark;
}
[data-theme="dark"] .stp-tbl td input:focus,
[data-theme="dark"] .stp-tbl td select:focus {
    background: var(--bg-secondary);
    border-color: var(--action-color);
}
[data-theme="dark"] .stp-tbl tr:hover td input,
[data-theme="dark"] .stp-tbl tr:hover td select {
    background: var(--bg-secondary);
}
[data-theme="dark"] .stp-chart-box {
    background: var(--bg-card);
}
[data-theme="dark"] .stp-chart-wrap {
    border-color: var(--border-color);
}
[data-theme="dark"] .stp-chart-hd {
    background: var(--border-light);
    border-color: var(--border-color);
}
[data-theme="dark"] .stp-ai-area {
    background: rgba(245, 158, 11, 0.06);
    border-color: rgba(245, 158, 11, 0.35);
}
[data-theme="dark"] .stp-ai-placeholder { color: rgba(251, 191, 36, 0.7); }
[data-theme="dark"] .stp-ai-text        { color: var(--text-primary); }
[data-theme="dark"] .stp-copy-btn {
    background: var(--bg-secondary);
    border-color: rgba(245, 158, 11, 0.5);
    color: #fbbf24;
}
[data-theme="dark"] .stp-copy-btn:hover {
    background: #f59e0b;
    color: white;
}
[data-theme="dark"] .stp-export-bar {
    background: var(--bg-card);
    border-color: var(--border-color);
}
