/* ===== A-M2 审方案 AI 策划页面样式 ===== */
/* 知音 · 艺学堂AI经营系统 */

/* ---------- 页面容器 ---------- */
.plan-review-page {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--navbar-height, 60px) - 40px);
    padding: 0;
}

/* ---------- 顶部栏 ---------- */
.plan-review-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    gap: 16px;
    flex-shrink: 0;
}

.plan-review-topbar .back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    background: #fff;
    color: #595959;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.plan-review-topbar .back-btn:hover {
    border-color: #1890ff;
    color: #1890ff;
}

.plan-review-intent {
    flex: 1;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.plan-review-intent .intent-icon {
    font-size: 20px;
    flex-shrink: 0;
}
.plan-review-intent .intent-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.plan-review-version-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 14px;
    background: #f0f5ff;
    color: #1890ff;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

/* ---------- 主体双栏布局 ---------- */
.plan-review-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    gap: 0;
}

/* 左侧预览区 */
.plan-review-preview {
    flex: 0 0 60%;
    overflow-y: auto;
    padding: 20px 24px;
    background: #fafbfc;
    border-right: 1px solid #f0f0f0;
}

/* 右侧编辑面板 */
.plan-review-panel {
    flex: 0 0 40%;
    overflow-y: auto;
    padding: 20px;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ---------- 模块卡片（左侧预览） ---------- */
.plan-module-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: var(--radius-md, 10px);
    margin-bottom: 12px;
    overflow: hidden;
    transition: border-color 0.2s;
}
.plan-module-card:hover {
    border-color: #d0e0ff;
}
.plan-module-card.expanded {
    border-color: #91d5ff;
    box-shadow: 0 2px 8px rgba(24,144,255,0.06);
}

.plan-module-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    cursor: pointer;
    background: #fafafa;
    border-bottom: 1px solid transparent;
    transition: background 0.2s;
    user-select: none;
}
.plan-module-header:hover {
    background: #f0f5ff;
}
.plan-module-card.expanded .plan-module-header {
    border-bottom-color: #f0f0f0;
    background: #f0f8ff;
}

.plan-module-icon {
    font-size: 18px;
    flex-shrink: 0;
}
.plan-module-name {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    flex: 1;
}
.plan-module-count {
    font-size: 12px;
    color: #8c8c8c;
}
.plan-module-arrow {
    font-size: 12px;
    color: #bfbfbf;
    transition: transform 0.2s;
}
.plan-module-card.expanded .plan-module-arrow {
    transform: rotate(180deg);
}

.plan-module-body {
    display: none;
    padding: 16px;
}
.plan-module-card.expanded .plan-module-body {
    display: block;
}

/* ---------- 预算模块 ---------- */
.plan-budget-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.plan-budget-table th {
    text-align: left;
    padding: 8px 10px;
    background: #fafafa;
    color: #595959;
    font-weight: 500;
    border-bottom: 2px solid #f0f0f0;
}
.plan-budget-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #f5f5f5;
    color: #333;
}
.plan-budget-table .amount-col {
    text-align: right;
    font-weight: 500;
    color: #fa8c16;
}
.plan-budget-total {
    display: flex;
    justify-content: flex-end;
    padding: 10px 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: #fa541c;
}

/* ---------- 任务模块 ---------- */
.plan-task-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.plan-task-item {
    padding: 12px 14px;
    border-left: 3px solid #e8e8e8;
    margin-bottom: 8px;
    background: #fafafa;
    border-radius: 0 6px 6px 0;
    position: relative;
}
.plan-task-item.priority-high {
    border-left-color: #ff4d4f;
}
.plan-task-item.priority-medium {
    border-left-color: #faad14;
}
.plan-task-item.priority-low {
    border-left-color: #52c41a;
}
.plan-task-title {
    font-weight: 600;
    font-size: 14px;
    color: #1a1a1a;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.plan-task-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: normal;
}
.plan-task-badge.high { background: #fff1f0; color: #ff4d4f; }
.plan-task-badge.medium { background: #fffbe6; color: #d48806; }
.plan-task-badge.low { background: #f6ffed; color: #389e0d; }
.plan-task-desc {
    font-size: 12px;
    color: #8c8c8c;
    margin-bottom: 4px;
}
.plan-task-meta {
    font-size: 11px;
    color: #bfbfbf;
    display: flex;
    gap: 16px;
}

/* ---------- 物料模块 ---------- */
.plan-material-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}
.plan-material-card {
    padding: 12px 14px;
    background: #fafafa;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
}
.plan-material-name {
    font-weight: 600;
    font-size: 13px;
    color: #1a1a1a;
    margin-bottom: 4px;
}
.plan-material-detail {
    font-size: 12px;
    color: #8c8c8c;
    display: flex;
    gap: 12px;
}
.plan-material-category {
    display: inline-block;
    padding: 1px 6px;
    background: #f0f5ff;
    color: #1890ff;
    border-radius: 4px;
    font-size: 11px;
    margin-top: 4px;
}

/* ---------- 阶段模块 ---------- */
.plan-phase-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.plan-phase-item {
    padding: 14px 16px;
    background: #fafafa;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    position: relative;
}
.plan-phase-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.plan-phase-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #1890ff;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}
.plan-phase-name {
    font-weight: 600;
    font-size: 14px;
    color: #1a1a1a;
}
.plan-phase-duration {
    font-size: 12px;
    color: #8c8c8c;
    margin-left: auto;
}
.plan-phase-bar {
    height: 6px;
    background: #f0f0f0;
    border-radius: 3px;
    margin: 8px 0;
    overflow: hidden;
}
.plan-phase-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #1890ff, #69c0ff);
    border-radius: 3px;
    transition: width 0.4s ease;
}
.plan-phase-goals {
    font-size: 12px;
    color: #595959;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.plan-phase-goal-tag {
    display: inline-block;
    padding: 2px 8px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    font-size: 11px;
}

/* ---------- 通知模块 ---------- */
.plan-notif-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.plan-notif-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
}
.plan-notif-item:last-child {
    border-bottom: none;
}
.plan-notif-channel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    font-size: 14px;
}
.plan-notif-channel.sms { background: #fff7e6; color: #fa8c16; }
.plan-notif-channel.wechat { background: #f6ffed; color: #52c41a; }
.plan-notif-channel.app { background: #f0f5ff; color: #1890ff; }
.plan-notif-channel.email { background: #f9f0ff; color: #722ed1; }
.plan-notif-info {
    flex: 1;
}
.plan-notif-audience {
    font-weight: 600;
    font-size: 13px;
    color: #1a1a1a;
}
.plan-notif-template {
    font-size: 12px;
    color: #8c8c8c;
    margin-top: 2px;
}
.plan-notif-offset {
    font-size: 11px;
    color: #bfbfbf;
    margin-top: 4px;
}

/* ---------- 空状态 ---------- */
.plan-module-empty {
    text-align: center;
    padding: 24px;
    color: #bfbfbf;
    font-size: 13px;
}
.plan-module-empty i {
    font-size: 32px;
    display: block;
    margin-bottom: 8px;
}

/* ---------- 右侧编辑面板 ---------- */
.plan-panel-section {
    background: #fff;
}

/* 三按钮决策区 */
.plan-decision-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 8px;
}

.plan-btn-confirm {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #52c41a, #73d13d);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(82,196,26,0.3);
}
.plan-btn-confirm:hover {
    background: linear-gradient(135deg, #49aa19, #66c72c);
    box-shadow: 0 4px 12px rgba(82,196,26,0.4);
    transform: translateY(-1px);
}
.plan-btn-confirm:disabled {
    background: #d9d9d9;
    color: #8c8c8c;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.plan-btn-regenerate {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: #fff;
    color: #fa8c16;
    border: 1px solid #ffd591;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}
.plan-btn-regenerate:hover {
    border-color: #fa8c16;
    background: #fff7e6;
}

.plan-btn-reroll {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: #fff;
    color: #595959;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}
.plan-btn-reroll:hover {
    border-color: #1890ff;
    color: #1890ff;
}

/* 反馈输入框 */
.plan-feedback-input {
    display: none;
    flex-direction: column;
    gap: 8px;
}
.plan-feedback-input.show {
    display: flex;
}
.plan-feedback-input textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    line-height: 1.6;
}
.plan-feedback-input textarea:focus {
    border-color: #fa8c16;
    outline: none;
    box-shadow: 0 0 0 2px rgba(250,140,22,0.1);
}
.plan-feedback-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}
.plan-feedback-actions button {
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
}
.plan-feedback-submit {
    background: #fa8c16;
    color: #fff;
    border: none;
}
.plan-feedback-submit:hover {
    background: #d87a0d;
}
.plan-feedback-cancel {
    background: #fff;
    color: #595959;
    border: 1px solid #d9d9d9;
}

/* 模块快速导航 */
.plan-quick-nav {
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}
.plan-quick-nav-title {
    font-size: 12px;
    color: #8c8c8c;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.plan-quick-nav-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.plan-quick-nav-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    background: #fafafa;
    border: 1px solid #f0f0f0;
    border-radius: 16px;
    font-size: 12px;
    color: #595959;
    cursor: pointer;
    transition: all 0.2s;
}
.plan-quick-nav-item:hover {
    border-color: #91d5ff;
    color: #1890ff;
    background: #f0f5ff;
}

/* 版本历史列表 */
.plan-version-history {
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}
.plan-version-title {
    font-size: 12px;
    color: #8c8c8c;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.plan-version-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 200px;
    overflow-y: auto;
}
.plan-version-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border: 1px solid #f0f0f0;
    border-radius: 6px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 12px;
}
.plan-version-item:hover {
    border-color: #91d5ff;
    background: #f0f5ff;
}
.plan-version-item.active {
    border-color: #1890ff;
    background: #e6f7ff;
}
.plan-version-num {
    font-weight: 600;
    color: #1a1a1a;
}
.plan-version-type {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 10px;
    background: #f0f0f0;
    color: #8c8c8c;
}
.plan-version-type.initial { background: #e6f7ff; color: #1890ff; }
.plan-version-type.regenerate_with_feedback { background: #fff7e6; color: #fa8c16; }
.plan-version-type.regenerate { background: #f6ffed; color: #52c41a; }
.plan-version-meta {
    color: #bfbfbf;
    font-size: 11px;
}

/* ---------- 底部信息栏 ---------- */
.plan-review-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 24px;
    background: #fff;
    border-top: 1px solid #f0f0f0;
    font-size: 12px;
    color: #8c8c8c;
    flex-shrink: 0;
}
.plan-review-footer .token-info {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ---------- Loading 状态 ---------- */
.plan-review-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 16px;
}
.plan-review-loading .spinner {
    font-size: 48px;
    color: #1890ff;
    animation: spin 1s linear infinite;
}
.plan-review-loading h3 {
    font-size: 18px;
    color: #333;
    margin: 0;
}
.plan-review-loading p {
    font-size: 14px;
    color: #8c8c8c;
    margin: 0;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
    .plan-review-body {
        flex-direction: column;
    }
    .plan-review-preview {
        flex: none;
        max-height: 55vh;
        border-right: none;
        border-bottom: 1px solid #f0f0f0;
    }
    .plan-review-panel {
        flex: none;
    }
}
