/* ========================================
   workbench.css - 三栏工作台样式
   ======================================== */

/* ========================================
   整体容器 - 三栏水平布局
   ======================================== */
.workbench-container {
    display: flex;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

/* ========================================
   左侧面板 - 导航 (220px)
   ======================================== */
.wb-left {
    width: var(--nav-width);
    flex-shrink: 0;
    border-right: 1px solid var(--hairline);
    background: var(--surface-soft);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 用户摘要 — 常驻顶部 */
.wb-user-summary {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--hairline);
    flex-shrink: 0;
}

.wb-user-name {
    font-size: var(--text-label-md);
    font-weight: 600;
    color: var(--ink);
    margin-bottom: var(--space-xs);
}

.wb-user-persona {
    font-size: var(--text-small);
    color: var(--text-secondary);
}

.wb-user-loading {
    font-size: var(--text-caption);
    color: var(--text-secondary);
    padding: var(--space-md) 0;
}

/* 技能导航 — 中间可滚动区域 */
.wb-nav {
    flex: 1;
    padding: var(--space-md);
    overflow-y: auto;
}

.wb-nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition-fast);
    font-size: var(--text-body-md);
    color: var(--body);
    margin-bottom: var(--space-xs);
}

.wb-nav-item:hover {
    background: var(--surface-strong);
}

.wb-nav-item.active {
    background: var(--primary);
    color: var(--on-primary);
    font-weight: 500;
}

.wb-nav-item.completed {
    color: var(--success);
}

.wb-nav-item.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.wb-nav-item .status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.wb-nav-item .status-indicator.active {
    background: var(--success-border);
}

.wb-nav-item .status-indicator.pending {
    background: var(--text-secondary);
}

.wb-nav-item .status-indicator.current {
    background: var(--info);
    box-shadow: 0 0 0 2px var(--info-bg);
}

/* Sub-nav items (Holland / BigFive under Assessment) */
.wb-nav-children {
    margin: 2px 0 2px 16px;
    border-left: 2px solid var(--hairline);
    padding-left: 4px;
}

.wb-nav-sub-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm, 8px);
    padding: 8px 12px;
    font-size: var(--text-small, 12px);
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm, 6px);
    transition: background 0.15s;
}

.wb-nav-sub-item:hover {
    background: var(--surface-strong);
}

.wb-nav-sub-item.active {
    background: var(--primary);
    color: var(--on-primary);
}

.wb-nav-sub-item.completed {
    color: var(--success);
}

.wb-nav-arrow {
    font-size: 10px;
    margin-left: auto;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.wb-nav-loading {
    font-size: var(--text-caption);
    color: var(--text-secondary);
    text-align: center;
    padding: var(--space-lg) 0;
}

/* 底部返回按钮 */
.wb-back {
    padding: var(--space-md);
    border-top: 1px solid var(--hairline);
    flex-shrink: 0;
}

.wb-back .btn {
    width: 100%;
    justify-content: flex-start;
}

/* ========================================
   中间面板 - Chat (flex: 1)
   ======================================== */
.wb-middle {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    position: relative;
}

/* 右侧面板切换按钮 — 居右边界，随面板展开左移 */
.wb-toggle-right-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    width: 32px;
    height: 48px;
    border: 1px solid var(--hairline);
    border-radius: 6px 0 0 6px;
    background: var(--canvas);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, background 0.2s;
}
.wb-toggle-right-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* Chat Header */
.wb-chat-header {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--hairline);
    flex-shrink: 0;
    background: var(--canvas);
}

.wb-chat-title {
    font-size: var(--text-caption);
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

/* Chat Messages 区域 */
.wb-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

/* 消息气泡 */
.chat-bubble {
    max-width: 75%;
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-lg);
    font-size: var(--text-body-md);
    line-height: var(--leading-relaxed);
    word-break: break-word;
    position: relative;
}

.chat-bubble.user {
    align-self: flex-end;
    background: var(--primary);
    color: var(--on-primary);
    border-bottom-right-radius: var(--radius-sm);
}

.chat-bubble.ai {
    align-self: flex-start;
    background: var(--surface-soft);
    color: var(--body);
    border-bottom-left-radius: var(--radius-sm);
    border: 1px solid var(--hairline);
}

.chat-bubble.system {
    align-self: center;
    background: var(--info-bg);
    color: var(--info);
    font-size: var(--text-caption);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-pill);
    max-width: 90%;
}

.chat-bubble .chat-timestamp {
    font-size: var(--text-small);
    opacity: 0.6;
    margin-top: var(--space-xs);
    display: block;
}

/* 输入中动画 */
.wb-chat-typing .wb-chat-text {
    animation: pulse 1.2s ease-in-out infinite;
}

.wb-chat-inline-chart {
    width: 30%;
    max-width: 180px;
    min-width: 96px;
    height: auto;
    border-radius: 8px;
    border: 1px solid var(--hairline);
    background: #fff;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* 占位提示 */
.wb-chat-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
    text-align: center;
}

.wb-chat-placeholder p {
    font-size: var(--text-body-md);
    margin-bottom: var(--space-sm);
}

/* Chat Input 区域 */
.wb-chat-input-area {
    display: flex;
    align-items: flex-end;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--hairline);
    flex-shrink: 0;
    background: var(--canvas);
}

.wb-chat-input {
    flex: 1;
    resize: none;
    min-height: 40px;
    max-height: 120px;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    border: 1px solid var(--hairline);
    font-size: var(--text-body-md);
    line-height: 1.5;
    transition: border-color var(--transition-fast);
}

.wb-chat-input:focus {
    border-color: var(--info);
    box-shadow: 0 0 0 2px var(--info-bg);
}

.wb-send-btn {
    height: 40px;
    flex-shrink: 0;
}

/* ========================================
   右侧面板 - 资产预览 (480px, 可收起)
   ======================================== */
.wb-right {
    width: 0;
    flex-shrink: 0;
    border-left: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width 0.3s ease, border-left 0.3s ease;
}
.wb-right.expanded {
    width: 528px;
    border-left: 1px solid var(--hairline);
}

.wb-right-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    border-bottom: 1px solid var(--hairline);
    flex-shrink: 0;
}

.holland-report-shell {
    padding-bottom: 24px;
}

.holland-report-html {
    color: var(--body);
    line-height: 1.7;
}

.holland-report {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.holland-report-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
    background: var(--surface-soft);
    border: 1px solid var(--hairline);
    border-radius: 10px;
}

.holland-report-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--ink);
}

.holland-report-subtitle,
.holland-report-meta {
    font-size: 12px;
    color: var(--text-secondary);
}

.holland-section {
    border: 1px solid var(--hairline);
    border-radius: 10px;
    padding: 16px;
    background: var(--canvas);
}

.holland-section h4 {
    margin: 0 0 12px;
    font-size: 14px;
    color: var(--ink);
}

.holland-basic-grid,
.holland-top-grid,
.holland-career-grid,
.holland-detail-list {
    display: grid;
    gap: 10px;
}

.holland-basic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 12px;
}

.holland-basic-grid span {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
}

.holland-basic-grid strong {
    display: block;
    margin-top: 2px;
    font-size: 14px;
    color: var(--ink);
}

.holland-summary,
.holland-band-note,
.holland-career-list,
.holland-detail-text,
.holland-disclaimer {
    font-size: 13px;
    color: var(--body);
}

.holland-score-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.holland-score-table th,
.holland-score-table td {
    border: 1px solid var(--hairline);
    padding: 8px 10px;
    text-align: left;
}

.holland-score-table th {
    background: var(--surface-soft);
    color: var(--ink);
}

.holland-top-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 12px;
}

.holland-top-card,
.holland-career-card,
.holland-detail-item {
    border: 1px solid var(--hairline);
    border-radius: 8px;
    padding: 12px;
    background: var(--surface-soft);
}

.holland-top-code {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary);
}

.holland-top-name,
.holland-top-score,
.holland-career-title,
.holland-detail-title,
.holland-code-note {
    font-size: 12px;
    color: var(--text-secondary);
}

.holland-chart-wrap {
    display: flex;
    justify-content: center;
    padding: 8px 0 4px;
}

.holland-chart-image {
    width: min(100%, 320px);
    height: auto;
    border-radius: 8px;
    border: 1px solid var(--hairline);
    background: #fff;
}

.holland-career-grid,
.holland-detail-list {
    grid-template-columns: 1fr;
}

.wb-version-select {
    flex: 1;
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--text-small);
    border-radius: var(--radius-sm);
    border: 1px solid var(--hairline);
    background: var(--canvas);
}

.wb-asset-view {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-md);
}

/* 资产占位 */
.wb-asset-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
    text-align: center;
    gap: var(--space-sm);
}

/* 资产内容区 */
.asset-content {
    font-size: var(--text-body-md);
    line-height: var(--leading-relaxed);
    color: var(--body);
    white-space: pre-wrap;
    word-break: break-word;
}

.asset-content h3 {
    font-size: var(--text-title-sm);
    font-weight: 600;
    color: var(--ink);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--hairline);
}

.asset-section {
    margin-bottom: var(--space-lg);
}

.asset-section-title {
    font-size: var(--text-caption);
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-sm);
}

/* 对比模式 */
.asset-compare {
    display: flex;
    gap: var(--space-md);
    height: 100%;
}

.asset-compare-col {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-md);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
}

.asset-compare-col .asset-compare-header {
    font-size: var(--text-caption);
    font-weight: 600;
    color: var(--muted);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--hairline);
}

/* 骨架屏在右侧面板中 */
.asset-skeleton {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    padding: var(--space-md);
}

.asset-skeleton .skeleton-line {
    margin-bottom: var(--space-sm);
}

.asset-skeleton .skeleton-block {
    height: 200px;
}

/* ========================================
   响应式调整
   ======================================== */
@media (max-width: 1400px) {
    .wb-right {
        width: 300px;
    }
}

@media (max-width: 1100px) {
    .wb-left {
        width: 180px;
    }
    .wb-right {
        width: 260px;
    }
}

/* ========================================
   Resume Editing Mock Panel
   ======================================== */
.wb-resume-edit-panel {
    position: fixed;
    right: 0;
    top: 0;
    width: 480px;
    height: 100vh;
    background: var(--bg-primary, #fff);
    border-left: 1px solid var(--border-color, #e0e0e0);
    overflow-y: auto;
    z-index: 1000;
    padding: 20px;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
}

.wb-resume-edit-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary, #1890ff);
}

.wb-resume-edit-panel .panel-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary, #333);
}

.wb-resume-edit-panel .panel-close {
    width: 28px;
    height: 28px;
    border: none;
    background: var(--bg-secondary, #f0f0f0);
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary, #666);
}

.wb-resume-edit-panel .panel-close:hover {
    background: var(--danger, #ef4444);
    color: #fff;
}

.wb-resume-section {
    margin-bottom: 20px;
    padding: 12px;
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 8px;
    background: var(--bg-secondary, #fafafa);
}

.wb-resume-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.wb-resume-section-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary, #333);
}

.wb-resume-section-content {
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    color: var(--text-secondary, #666);
}

.wb-resume-section-edit-area {
    width: 100%;
    min-height: 120px;
    font-size: 13px;
    font-family: inherit;
    padding: 8px;
    border: 1px solid var(--primary, #1890ff);
    border-radius: 4px;
    resize: vertical;
    box-sizing: border-box;
}

.wb-resume-edit-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.wb-resume-ai-chat {
    position: sticky;
    bottom: 0;
    background: var(--bg-primary, #fff);
    border-top: 1px solid var(--border-color, #e0e0e0);
    padding: 12px 0;
    margin-top: 20px;
}

.wb-resume-ai-chat .chat-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary, #333);
}

.wb-resume-ai-chat .chat-responses {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 8px;
    font-size: 12px;
    line-height: 1.6;
}

.wb-resume-ai-chat .chat-response-item {
    padding: 8px 12px;
    background: var(--bg-secondary, #f0f7ff);
    border-radius: 6px;
    margin-bottom: 6px;
    white-space: pre-wrap;
}

.wb-resume-ai-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 8px;
    box-sizing: border-box;
}

.wb-resume-edit-btn {
    padding: 4px 12px;
    font-size: 12px;
    border: 1px solid var(--primary, #1890ff);
    color: var(--primary, #1890ff);
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
}

.wb-resume-edit-btn:hover {
    background: var(--primary, #1890ff);
    color: #fff;
}

.wb-resume-save-btn {
    padding: 4px 12px;
    font-size: 12px;
    background: var(--primary, #1890ff);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.wb-resume-save-btn:hover {
    opacity: 0.9;
}

.wb-resume-cancel-btn {
    padding: 4px 12px;
    font-size: 12px;
    border: 1px solid var(--border-color, #e0e0e0);
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
}

.wb-resume-cancel-btn:hover {
    background: var(--bg-secondary, #f0f0f0);
}

.wb-resume-bottom-bar {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 16px 0;
}

.wb-resume-bottom-bar .btn-primary {
    padding: 8px 16px;
    font-size: 13px;
    background: var(--primary, #1890ff);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.wb-resume-bottom-bar .btn-secondary {
    padding: 8px 16px;
    font-size: 13px;
    background: var(--bg-secondary, #f0f0f0);
    color: var(--text-primary, #333);
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 6px;
    cursor: pointer;
}

.wb-resume-template-preview {
    padding: 24px;
    text-align: center;
    background: var(--bg-secondary, #f5f5f5);
    border-radius: 8px;
    margin-top: 12px;
}

.wb-resume-template-preview .preview-card {
    max-width: 320px;
    margin: 16px auto 0;
    padding: 24px;
    background: #fff;
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    text-align: left;
    font-size: 12px;
    line-height: 1.8;
}

.wb-resume-template-preview .preview-card .preview-name {
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
}

.wb-resume-template-preview .preview-card .preview-section {
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color, #e0e0e0);
}

.wb-resume-template-preview .preview-card .preview-section-title {
    font-weight: 600;
    font-size: 11px;
    color: var(--primary, #1890ff);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.wb-resume-edit-toggle {
    margin-left: 8px;
    padding: 6px 14px;
    font-size: 12px;
    background: var(--primary, #1890ff);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.wb-resume-edit-toggle:hover {
    opacity: 0.9;
}

/* Advisor notes indicator */
.wb-resume-section .advisor-note {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    font-size: 10px;
    background: #fff7ed;
    color: #f59e0b;
    border-radius: 4px;
    border: 1px solid #fcd34d;
}
