* { margin: 0; padding: 0; box-sizing: border-box; }
[v-cloak] { display: none; }

:root {
    --primary: #4d6bfe;
    --primary-light: #eef1ff;
    --primary-hover: #3d5bee;
    --bg: #f5f5f5;
    --white: #fff;
    --text: #1a1a1a;
    --text-secondary: #6b6b6b;
    --text-muted: #999;
    --border: #e5e5e5;
    --border-light: #f0f0f0;
    --user-msg-bg: #4d6bfe;
    --user-msg-color: #fff;
    --green: #22c55e;
    --green-bg: #f0fdf4;
    --green-border: #bbf7d0;
    --yellow: #f59e0b;
    --yellow-bg: #fffbeb;
    --yellow-border: #fde68a;
    --red: #ef4444;
    --red-bg: #fef2f2;
    --red-border: #fecaca;
    --blue: #3b82f6;
    --blue-bg: #eff6ff;
    --blue-border: #bfdbfe;
    --orange: #f59e0b;
    --orange-bg: #fffbeb;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
}

/* Startup loading hint (shown while view templates are fetched) */
#app-loading {
    display: flex; align-items: center; justify-content: center;
    height: 100vh; color: var(--text-muted); font-size: 14px;
}

/* ===== Header ===== */
.header {
    height: 52px;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 12px;
    flex-shrink: 0;
}
.header-logo {
    width: 32px; height: 32px; background: var(--primary); border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 16px; font-weight: 700;
}
.header-title { font-size: 0.95rem; font-weight: 600; }
.header-title span { color: var(--text-muted); font-weight: 400; margin-left: 2px; }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* User menu */
.user-menu-wrap { position: relative; }
.user-menu {
    position: absolute; top: calc(100% + 6px); right: 0; width: 180px;
    background: var(--white); border: 1px solid var(--border); border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1); padding: 6px; display: none; z-index: 100;
}
.user-menu-wrap.open .user-menu { display: block; }
.user-menu-item {
    padding: 10px 14px; border-radius: 8px; font-size: 0.85rem; color: var(--text);
    cursor: pointer; display: flex; align-items: center; gap: 8px; transition: background 0.15s;
}
.user-menu-item:hover { background: var(--primary-light); color: var(--primary); }
.user-menu-item.danger:hover { background: var(--red-bg); color: var(--red); }
.user-menu-divider { height: 1px; background: var(--border-light); margin: 4px 8px; }

/* User info */
.user-info {
    display: flex; align-items: center; gap: 8px; cursor: pointer;
    padding: 4px 8px; border-radius: 8px; transition: background 0.15s;
}
.user-info:hover { background: var(--primary-light); }
.user-avatar {
    width: 30px; height: 30px; border-radius: 50%; background: var(--primary);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; font-weight: 600;
}
.user-name { font-size: 0.85rem; color: var(--text); font-weight: 500; }

/* ===== Monitor Page ===== */
.main-content { max-width: 1200px; margin: 0 auto; padding: 28px 24px; }

/* Header Tabs (merged into header bar) */
.header-tabs {
    display: flex; align-items: center; gap: 0;
    margin-left: 24px; height: 100%;
}
.header-tab-item {
    padding: 0 16px; font-size: 0.82rem; cursor: pointer;
    color: var(--text-muted); transition: all 0.2s;
    user-select: none; white-space: nowrap;
    text-decoration: none; display: inline-flex; align-items: center;
    height: 100%; position: relative;
}
.header-tab-item::after {
    content: ''; position: absolute; bottom: 0; left: 16px; right: 16px;
    height: 2px; background: transparent; transition: background 0.2s;
}
.header-tab-item:hover { color: var(--text); }
.header-tab-item.active {
    color: var(--primary); font-weight: 600;
}
.header-tab-item.active::after {
    background: var(--primary);
}
.page-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 4px; }
.page-subtitle { font-size: 0.88rem; color: var(--text-secondary); margin-bottom: 28px; }
.section { margin-bottom: 32px; }
.section-title { font-size: 1.05rem; font-weight: 600; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.section-title .icon {
    width: 20px; height: 20px; border-radius: 6px;
    display: flex; align-items: center; justify-content: center; font-size: 12px;
}

/* Progress Cards */
.progress-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.progress-card {
    background: var(--white); border-radius: 14px; padding: 24px;
    border: 1px solid var(--border-light); position: relative;
    cursor: pointer; transition: box-shadow 0.15s, border-color 0.15s;
}
.progress-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); border-color: var(--primary); }
.progress-card.no-click { cursor: default; }
.progress-card.no-click:hover { box-shadow: none; border-color: var(--border-light); }
.progress-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.progress-card-title { font-size: 0.88rem; font-weight: 600; color: var(--text); }
.progress-card-title .pc-ind { font-size: 0.75rem; font-weight: 500; color: var(--text-muted); }
.progress-card-period { font-size: 0.75rem; color: var(--text-muted); }
.status-badge { padding: 3px 10px; border-radius: 20px; font-size: 0.72rem; font-weight: 600; }
.status-badge.good { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-border); }
.status-badge.warn { background: var(--yellow-bg); color: var(--yellow); border: 1px solid var(--yellow-border); }
.status-badge.bad { background: var(--red-bg); color: var(--red); border: 1px solid var(--red-border); }
.status-badge.none { background: #f3f4f6; color: var(--text-muted); border: 1px solid var(--border); }

/* Progress Ring */
.progress-ring-wrap { display: flex; align-items: center; gap: 20px; margin-bottom: 16px; }
.progress-ring { width: 80px; height: 80px; flex-shrink: 0; }
.progress-ring circle { fill: none; stroke-width: 8; stroke-linecap: round; }
.progress-ring .ring-bg { stroke: #f0f0f0; }
.progress-ring .ring-fill { transition: stroke-dashoffset 0.8s ease; }
.progress-ring .ring-text { font-size: 18px; font-weight: 700; fill: var(--text); text-anchor: middle; dominant-baseline: central; }
.progress-detail { flex: 1; }
.progress-amount { font-size: 1.3rem; font-weight: 700; margin-bottom: 2px; }
.progress-amount .unit { font-size: 0.85rem; font-weight: 400; color: var(--text-secondary); }
.progress-plan { font-size: 0.8rem; color: var(--text-muted); }
.progress-bar { height: 6px; background: #f0f0f0; border-radius: 3px; overflow: hidden; }
.progress-bar-fill { height: 100%; border-radius: 3px; transition: width 0.8s ease; }
.progress-card-footer { display: flex; justify-content: space-between; margin-top: 8px; font-size: 0.75rem; color: var(--text-muted); }

/* Diagnosis */
.diagnosis-list { display: flex; flex-direction: column; gap: 12px; }
.diagnosis-card {
    background: var(--white); border-radius: 12px; padding: 18px 20px;
    border: 1px solid var(--border-light); display: flex; gap: 14px;
    align-items: flex-start; transition: box-shadow 0.15s;
}
.diagnosis-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.diagnosis-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.diagnosis-icon.danger { background: var(--red-bg); }
.diagnosis-icon.warning { background: var(--yellow-bg); }
.diagnosis-icon.info { background: var(--blue-bg); }
.diagnosis-body { flex: 1; }
.diagnosis-title { font-size: 0.9rem; font-weight: 600; margin-bottom: 4px; }
.diagnosis-desc { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.5; }
.diagnosis-meta { display: flex; gap: 12px; margin-top: 8px; }
.diagnosis-tag { font-size: 0.72rem; padding: 2px 8px; border-radius: 4px; background: #f5f5f5; color: var(--text-secondary); }
.diagnosis-tag.danger { background: var(--red-bg); color: var(--red); }
.diagnosis-tag.warning { background: var(--yellow-bg); color: var(--yellow); }

/* Recommendations */
.recommend-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.recommend-card { background: var(--white); border-radius: 12px; padding: 20px; border: 1px solid var(--border-light); transition: box-shadow 0.15s; }
.recommend-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.recommend-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.recommend-icon { width: 32px; height: 32px; border-radius: 8px; background: var(--primary-light); display: flex; align-items: center; justify-content: center; font-size: 16px; }
.recommend-title { font-size: 0.9rem; font-weight: 600; }
.recommend-desc { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.6; margin-bottom: 12px; }
.recommend-effect { font-size: 0.78rem; padding: 6px 12px; background: var(--green-bg); color: var(--green); border-radius: 6px; border: 1px solid var(--green-border); display: inline-block; }

/* Detail View */
.progress-detail-view { animation: fadeIn 0.3s ease; }
.detail-back-btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px;
    border: 1px solid var(--border); border-radius: 8px; background: var(--white);
    font-size: 0.85rem; cursor: pointer; color: var(--text-secondary);
    margin-bottom: 20px; transition: all 0.15s;
}
.detail-back-btn:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.detail-back-btn svg { width: 16px; height: 16px; }
.detail-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.detail-title { font-size: 1.2rem; font-weight: 700; }
.detail-subtitle { font-size: 0.85rem; color: var(--text-secondary); margin-top: 2px; }
.detail-status { display: flex; align-items: center; gap: 12px; }
.detail-percent { font-size: 2rem; font-weight: 700; }
.detail-summary-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 24px; }
.detail-summary-card { background: var(--white); border-radius: 10px; padding: 16px 18px; border: 1px solid var(--border-light); }
.detail-summary-card .label { font-size: 0.78rem; color: var(--text-secondary); margin-bottom: 4px; }
.detail-summary-card .value { font-size: 1.3rem; font-weight: 700; }
.detail-summary-card .value .unit { font-size: 0.8rem; font-weight: 400; color: var(--text-muted); }
.detail-sections-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.detail-sections-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; overflow: hidden; }
.detail-sub-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }
.detail-budget-section { background: var(--white); border-radius: 12px; border: 1px solid var(--border-light); overflow: hidden; }
.detail-section-header { padding: 12px 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border-light); }
.detail-section-header .name { font-size: 0.88rem; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.detail-section-header .dot { width: 6px; height: 6px; border-radius: 50%; }
.detail-section-header.revenue .dot { background: var(--blue); }
.detail-section-header.expense .dot { background: var(--yellow); }
.detail-section-header .subtotal { font-size: 0.85rem; font-weight: 600; }
.detail-section-header.revenue .subtotal { color: var(--blue); }
.detail-section-header.expense .subtotal { color: var(--yellow); }
.detail-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.detail-table th { text-align: left; padding: 8px 18px; font-size: 0.73rem; color: var(--text-muted); font-weight: 500; border-bottom: 1px solid var(--border-light); }
.detail-table td { padding: 9px 18px; font-size: 0.82rem; border-bottom: 1px solid #fafafa; }
.detail-table tr:last-child td { border-bottom: none; }
.detail-table th:last-child, .detail-table td:last-child { text-align: right; padding-right: 18px; }
.detail-table th:first-child, .detail-table td:first-child { padding-left: 18px; width: 40%; }
.detail-table th:nth-child(2), .detail-table td:nth-child(2) { width: 35%; }
.detail-table th:nth-child(3), .detail-table td:nth-child(3) { width: 25%; }
.detail-table .item-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-table .item-amount { font-weight: 600; font-variant-numeric: tabular-nums; }
.detail-table .item-percent { color: var(--text-muted); font-size: 0.78rem; }
.detail-bar { height: 3px; background: #f0f0f0; border-radius: 2px; overflow: hidden; margin-top: 3px; }
.detail-bar-fill { height: 100%; border-radius: 2px; }

/* ===== Budget Page ===== */
.budget-page { display: flex; flex-direction: column; height: 100vh; }
.workspace { flex: 1; display: flex; overflow: hidden; position: relative; }

/* Chat Panel */
.chat-panel {
    width: 20%; min-width: 220px; display: flex; flex-direction: column;
    border-right: 1px solid var(--border); background: var(--white);
    position: relative; transition: width 0.3s ease, min-width 0.3s ease, opacity 0.3s ease;
}
.chat-panel.collapsed { width: 0; min-width: 0; border-right: none; overflow: hidden; opacity: 0; }
.chat-toolbar {
    height: 42px; display: flex; align-items: center; justify-content: space-between;
    padding: 0 14px; border-bottom: 1px solid var(--border-light); flex-shrink: 0;
}
.chat-toolbar-title { font-size: 0.82rem; font-weight: 600; color: var(--text); }

/* Chat toggle */
.chat-toggle-btn {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 10;
    width: 32px; height: 32px; border-radius: 50%; background: var(--white);
    border: 1px solid var(--border); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    transition: left 0.3s ease, background 0.15s;
    left: calc(20% - 16px);
}
.chat-toggle-btn:hover { background: var(--primary-light); }
.chat-toggle-btn svg { width: 16px; height: 16px; color: var(--text-secondary); transition: transform 0.3s; }
.workspace.chat-collapsed .chat-toggle-btn { left: 6px; }
.workspace.chat-collapsed .chat-toggle-btn svg { transform: rotate(180deg); }

/* --- AI 助手面板在右侧 + 稍加宽（budget/phc 两页 workspace 均挂 .chat-right 标记类） --- */
.workspace.chat-right .chat-panel {
    order: 3; width: 24%; min-width: 260px;
    border-right: none; border-left: 1px solid var(--border);
}
/* 收起时归零宽度让预览区扩展全屏（特异性须压过上方 .chat-right 的 24%/260px） */
.workspace.chat-right .chat-panel.collapsed { width: 0; min-width: 0; border-left: none; }
.workspace.chat-right .preview-panel { order: 1; }
.workspace.chat-right .chat-toggle-btn {
    left: auto; right: calc(24% - 16px);
    transition: right 0.3s ease, background 0.15s;
}
/* 面板在右：展开时箭头指向右（收起方向），收起后指向左（展开方向） */
.workspace.chat-right .chat-toggle-btn svg { transform: rotate(180deg); }
.workspace.chat-right.chat-collapsed .chat-toggle-btn { right: 6px; }
.workspace.chat-right.chat-collapsed .chat-toggle-btn svg { transform: none; }
@media (max-width: 900px) {
    .workspace.chat-right .chat-panel {
        order: 0; width: 100%; min-width: 0; height: 50%;
        border-left: none; border-bottom: 1px solid var(--border);
    }
    .workspace.chat-right .preview-panel { order: 0; height: 50%; }
}

/* History */
.history-view { display: none; flex-direction: column; flex: 1; overflow: hidden; }
.history-view.active { display: flex; }
.history-header { height: 42px; display: flex; align-items: center; padding: 0 14px; gap: 8px; border-bottom: 1px solid var(--border-light); flex-shrink: 0; }
.history-back-btn { background: none; border: none; cursor: pointer; padding: 4px; border-radius: 4px; color: var(--text-secondary); display: flex; align-items: center; transition: background 0.15s; }
.history-back-btn:hover { background: var(--primary-light); color: var(--primary); }
.history-back-btn svg { width: 16px; height: 16px; }
.history-header-title { font-size: 0.82rem; font-weight: 600; }
.history-list { flex: 1; overflow-y: auto; padding: 8px; }
.history-item { padding: 12px; border-radius: 10px; border: 1px solid var(--border-light); margin-bottom: 8px; cursor: pointer; transition: all 0.15s; }
.history-item:hover { background: var(--primary-light); border-color: var(--primary); }
.history-item-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.history-version { font-size: 0.75rem; font-weight: 600; color: var(--primary); background: var(--primary-light); padding: 2px 8px; border-radius: 4px; }
.history-time { font-size: 0.72rem; color: var(--text-muted); }
.history-prompt { font-size: 0.82rem; color: var(--text); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 8px; }
.history-restore-btn { padding: 4px 10px; border: 1px solid var(--border); border-radius: 5px; background: var(--white); font-size: 0.72rem; cursor: pointer; color: var(--text-secondary); transition: all 0.15s; }
.history-restore-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.history-actions { display: flex; gap: 8px; }
.history-delete-btn { padding: 4px 10px; border: 1px solid var(--border); border-radius: 5px; background: var(--white); font-size: 0.72rem; cursor: pointer; color: var(--text-secondary); transition: all 0.15s; }
.history-delete-btn:hover { background: #d9534f; color: #fff; border-color: #d9534f; }
.history-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; color: var(--text-muted); font-size: 0.85rem; gap: 8px; }
.history-empty span { font-size: 24px; }
.chat-panel.showing-history .chat-area,
.chat-panel.showing-history .input-area,
.chat-panel.showing-history .chat-toolbar { display: none; }

/* Chat area */
.chat-area { flex: 1; overflow-y: auto; padding: 20px 0; }
.chat-inner { max-width: 600px; margin: 0 auto; padding: 0 20px; display: flex; flex-direction: column; gap: 20px; }
.welcome { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 40px 20px; }
.welcome-icon { width: 52px; height: 52px; background: var(--primary); border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.welcome-icon.welcome-avatar { width: 64px; height: 64px; background: none; border-radius: 50%; }
.welcome-icon.welcome-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.welcome h2 { font-size: 1.3rem; font-weight: 600; }
.welcome p { color: var(--text-secondary); font-size: 0.9rem; text-align: center; max-width: 360px; line-height: 1.6; }
.welcome-start-btn {
    margin-top: 10px; padding: 12px 36px;
    border: none; border-radius: 10px; background: var(--primary); color: #fff;
    font-size: 0.95rem; font-weight: 700; cursor: pointer; transition: opacity 0.15s;
}
.welcome-start-btn:hover { opacity: 0.88; }
.suggestions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; width: 100%; max-width: 420px; }
.suggestion-card { padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--white); cursor: pointer; font-size: 0.82rem; color: var(--text); line-height: 1.4; transition: all 0.15s; }
.suggestion-card:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }

/* Messages */
.message-row { display: flex; gap: 10px; line-height: 1.65; }
.message-row.user { flex-direction: column; align-items: flex-end; }
.message-row.ai { align-items: flex-start; }
.msg-avatar { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0; background: var(--primary-light); }
.msg-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.msg-content { font-size: 0.9rem; }
.message-row.user .msg-content { background: var(--user-msg-bg); color: var(--user-msg-color); padding: 10px 16px; border-radius: 16px; max-width: 85%; }
.message-row.ai .msg-content { padding: 2px 0; max-width: 90%; white-space: pre-wrap; }
.thinking-dots { display: inline-flex; gap: 4px; padding: 4px 0; }
.thinking-dots span { width: 6px; height: 6px; background: var(--primary); border-radius: 50%; animation: bounce 1.4s infinite ease-in-out both; }
.thinking-dots span:nth-child(1) { animation-delay: 0s; }
.thinking-dots span:nth-child(2) { animation-delay: 0.16s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.32s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; } 40% { transform: scale(1); opacity: 1; } }

/* Input */
.input-area { padding: 12px 20px 16px; border-top: 1px solid var(--border-light); }
.input-wrapper { position: relative; max-width: 600px; margin: 0 auto; }
.input-box {
    width: 100%; background: #f9f9f9; border: 1px solid var(--border); border-radius: 14px;
    padding: 12px 48px 12px 16px; font-size: 0.9rem; font-family: inherit; resize: none;
    outline: none; line-height: 1.5; max-height: 120px; transition: border-color 0.2s, box-shadow 0.2s;
}
.input-box:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(77,107,254,0.1); background: var(--white); }
.input-box:disabled { color: #999; background: #f3f4f6; cursor: not-allowed; }
.input-box::placeholder { color: #bbb; }
.send-btn {
    position: absolute; right: 6px; bottom: 6px; width: 34px; height: 34px;
    border-radius: 10px; background: var(--primary); border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center; transition: background 0.15s;
}
.send-btn:hover:not(:disabled) { background: var(--primary-hover); }
.send-btn:disabled { background: #ccc; cursor: not-allowed; }
.send-btn svg { width: 16px; height: 16px; color: #fff; }

/* Preview Panel */
.preview-panel { flex: 1; display: flex; flex-direction: column; background: var(--bg); min-width: 0; }
.preview-header {
    height: 46px; display: flex; align-items: stretch;
    padding: 0 20px; background: var(--white); border-bottom: 1px solid var(--border); flex-shrink: 0;
    justify-content: space-between;
}
.tab-bar { display: flex; align-items: stretch; gap: 0; flex: 1; }
.tab-actions {
    display: flex; align-items: center; gap: 8px; margin-left: 12px;
    flex-shrink: 0;
}
.tab-action-btn {
    padding: 5px 14px; border-radius: 6px; font-size: 0.8rem;
    font-weight: 500; cursor: pointer; border: 1px solid var(--border);
    transition: all 0.2s;
}
.tab-action-btn.cancel {
    background: var(--white); color: var(--text-secondary);
}
.tab-action-btn.cancel:hover {
    background: #f0f0f0; color: var(--text);
}
.tab-action-btn.confirm {
    background: var(--primary); color: #fff; border-color: var(--primary);
}
.tab-action-btn.confirm:hover {
    background: var(--primary-hover);
}
.tab-item {
    padding: 0 18px; display: flex; align-items: center;
    font-size: 0.82rem; color: var(--text-muted);
    cursor: pointer; position: relative;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
    white-space: nowrap;
    user-select: none;
}
.tab-item:hover { color: var(--text); }
.tab-item.active {
    color: var(--primary); font-weight: 600;
    border-bottom-color: var(--primary);
}
.preview-body { flex: 1; overflow-y: auto; padding: 24px; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; gap: 14px; color: var(--text-muted); }
.empty-state-icon { width: 64px; height: 64px; border-radius: 16px; background: var(--white); border: 2px dashed var(--border); display: flex; align-items: center; justify-content: center; font-size: 28px; }
.empty-state p { font-size: 0.9rem; }
.empty-state small { font-size: 0.8rem; color: #ccc; }

/* Budget Content */
.budget-content { display: flex; flex-direction: column; gap: 20px; width: 100%; animation: fadeIn 0.4s ease; }
.budget-title-row { display: flex; align-items: center; justify-content: space-between; }
.budget-title { font-size: 1.2rem; font-weight: 700; }
.budget-company { font-size: 0.85rem; color: var(--text-secondary); margin-top: 2px; }
.budget-unit { font-size: 0.78rem; color: var(--text-muted); background: #f0f0f0; padding: 3px 10px; border-radius: 6px; }
.summary-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.summary-card { background: var(--white); border-radius: 12px; padding: 18px 20px; border: 1px solid var(--border-light); }
.summary-card .label { font-size: 0.78rem; color: var(--text-secondary); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.summary-card .label .dot { width: 8px; height: 8px; border-radius: 50%; }
.summary-card .value { font-size: 1.5rem; font-weight: 700; }
.summary-card.revenue .dot { background: var(--blue); }
.summary-card.revenue .value { color: var(--blue); }
.summary-card.expense .dot { background: var(--orange); }
.summary-card.expense .value { color: var(--orange); }
.summary-card.profit .dot { background: var(--green); }
.summary-card.profit .value { color: var(--green); }
.summary-card.profit.negative .dot { background: var(--red); }
.summary-card.profit.negative .value { color: var(--red); }
.summary-card .unit-small { font-size: 0.85rem; font-weight: 400; }

/* Budget sections layout */
.sections-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; min-width: 0; }
.sections-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; overflow: hidden; }
.sections-sub-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; min-width: 0; }
.budget-section { background: var(--white); border-radius: 12px; border: 1px solid var(--border-light); overflow: hidden; }
.section-header { padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border-light); }
.section-header .section-name { font-size: 0.9rem; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.section-header .section-name .icon { width: 6px; height: 6px; border-radius: 50%; }
.section-header.revenue .icon { background: var(--blue); }
.section-header.expense .icon { background: var(--orange); }
.section-header .section-subtotal { font-size: 0.88rem; font-weight: 600; }
.section-header.revenue .section-subtotal { color: var(--blue); }
.section-header.expense .section-subtotal { color: var(--orange); }
.section-body table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.section-body th:nth-child(1), .section-body td:nth-child(1) { width: 40%; }
.section-body th:nth-child(2), .section-body td:nth-child(2) { width: 35%; }
.section-body th:nth-child(3), .section-body td:nth-child(3) { width: 25%; }
.section-body th { text-align: left; padding: 10px 20px; font-size: 0.75rem; color: var(--text-muted); font-weight: 500; border-bottom: 1px solid var(--border-light); text-transform: uppercase; letter-spacing: 0.3px; }
.section-body th:last-child, .section-body td:last-child { text-align: right; padding-right: 20px; }
.section-body th:first-child, .section-body td:first-child { padding-left: 20px; }
.section-body td { padding: 11px 20px; font-size: 0.85rem; border-bottom: 1px solid #fafafa; }
.section-body tr:last-child td { border-bottom: none; }
.section-body .item-name { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.section-body .item-amount { font-weight: 600; font-variant-numeric: tabular-nums; }
.section-body .item-percent { color: var(--text-muted); font-size: 0.8rem; font-variant-numeric: tabular-nums; text-align: right; }
.budget-bar { height: 4px; background: #f0f0f0; border-radius: 2px; overflow: hidden; margin-top: 4px; }
.budget-bar-fill { height: 100%; border-radius: 2px; transition: width 0.6s ease; }
.section-header.revenue + .section-body .budget-bar-fill { background: var(--blue); }
.section-header.expense + .section-body .budget-bar-fill { background: var(--orange); }

/* Animations & Responsive */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.section { animation: fadeIn 0.4s ease; }
.section:nth-child(2) { animation-delay: 0.1s; }
.section:nth-child(3) { animation-delay: 0.2s; }

/* ==================== BSC (Balanced Scorecard) ==================== */
.bsc-container { padding: 4px 0; }
.bsc-header {
    position: relative;
    text-align: center;
    border-bottom: 3px solid var(--primary);
    padding-bottom: 14px;
    margin-bottom: 18px;
}
.bsc-header h1 { font-size: 1.35rem; color: var(--primary); letter-spacing: 2px; }
.bsc-version {
    position: absolute; top: 0; right: 0;
    font-size: 0.72rem; color: var(--text-secondary);
    background: #f7f8fa; padding: 2px 10px; border-radius: 4px; border: 1px solid var(--border);
}
.bsc-sub { font-size: 0.82rem; color: var(--text-muted); margin-top: 4px; }
.bsc-meta {
    font-size: 0.78rem; color: var(--text-secondary);
    margin-top: 8px; display: flex; justify-content: center; gap: 12px; flex-wrap: wrap;
}
.bsc-meta span {
    background: #f7f8fa; padding: 2px 12px; border-radius: 4px; border: 1px solid var(--border);
}

.bsc-summary {
    display: grid; grid-template-columns: repeat(6, 1fr); gap: 0;
    border: 2px solid var(--primary); border-radius: 8px; overflow: hidden;
    margin-bottom: 16px;
}
.bsc-summary-item {
    padding: 8px 10px; text-align: center;
    border-right: 1px solid var(--border); background: var(--white);
}
.bsc-summary-item:last-child { border-right: none; }
.bsc-summary-item .label { font-size: 0.7rem; color: var(--text-muted); font-weight: 600; display: block; }
.bsc-summary-item .value { font-size: 1.05rem; font-weight: 700; }

.bsc-logic {
    display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px;
    font-size: 0.78rem; background: #f8f9fc; padding: 8px 14px;
    border-radius: 6px; border: 1px solid var(--border); margin-bottom: 16px;
}
.logic-label { font-weight: 600; color: var(--primary); }
.bsc-logic strong { font-weight: 600; color: var(--text); }

.bsc-months {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
    border: 1px solid var(--border); border-radius: 6px; overflow: hidden;
    margin-bottom: 16px;
}
.bsc-month-item {
    padding: 8px 12px; text-align: center;
    border-right: 1px solid var(--border);
}
.bsc-month-item:last-child { border-right: none; }
.bsc-month-item .label { font-size: 0.7rem; color: var(--text-muted); font-weight: 600; display: block; }
.bsc-month-item .value { font-size: 0.88rem; font-weight: 700; }
.bsc-month-item .detail { font-size: 0.72rem; color: var(--text-muted); display: block; margin-top: 2px; }

/* BSC 数字输入框：数字在下划线内，单位与文字在下划线外 */
.num-line {
    display: flex; justify-content: center; align-items: baseline;
    flex-wrap: wrap; gap: 0 1px;
}
.num-input {
    background: transparent; color: inherit; border: none;
    border-bottom: 1px solid var(--border); border-radius: 0;
    font-family: inherit; font-size: inherit; font-weight: inherit;
    text-align: center; padding: 0 2px 2px; outline: none;
}
.num-input:focus { border-bottom-color: var(--primary); }
.num-sep { margin: 0 4px; }
.num-summary { font-size: 1.05rem; font-weight: 700; }
.num-sales { font-size: 0.88rem; font-weight: 700; }
.num-detail { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }

.bsc-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px;
}
.bsc-card {
    border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
}
.bsc-card-header {
    padding: 6px 14px; font-weight: 700; font-size: 0.88rem;
    color: #fff; display: flex; justify-content: space-between; align-items: center;
}
.bsc-tag { font-size: 0.68rem; font-weight: 400; opacity: 0.85; }
.bsc-card-body { padding: 6px 10px 4px; font-size: 0.78rem; }
.bsc-row {
    display: grid; grid-template-columns: 1.4fr 0.8fr 2fr; gap: 4px;
    padding: 4px 0; border-bottom: 1px solid #f0f2f5; align-items: center;
}
.bsc-row:last-child { border-bottom: none; }
.r-label { color: var(--text); font-weight: 500; font-size: 0.75rem; }
.r-val { font-weight: 600; font-size: 0.75rem; }
.r-desc { font-size: 0.65rem; color: var(--text-muted); line-height: 1.3; }

.bsc-fin .bsc-card-header { background: var(--red); }
.r-val.c-fin { color: var(--red); }
.bsc-cus .bsc-card-header { background: var(--orange); }
.r-val.c-cus { color: var(--orange); }
.bsc-int .bsc-card-header { background: var(--green); }
.r-val.c-int { color: var(--green); }
.bsc-lea .bsc-card-header { background: var(--blue); }
.r-val.c-lea { color: var(--blue); }
/* 其他指标卡（无层面归属的 calc 指标兜底分组）：中性灰卡头 */
.bsc-misc .bsc-card-header { background: var(--text-secondary); }

.c-gold { color: #b8952e; }
.c-red { color: var(--red); }
.c-green { color: var(--green); }
.c-blue { color: var(--blue); }
.c-orange { color: var(--orange); }
.c-purple { color: #8e44ad; }

.bsc-chain {
    background: #f8f9fc; border: 1px solid var(--border); border-radius: 8px;
    padding: 10px 16px; margin-bottom: 16px;
    display: flex; align-items: center; justify-content: center;
    flex-wrap: wrap; gap: 4px 8px; font-size: 0.8rem;
}
.chain-title { font-weight: 600; color: var(--primary); }
.chain-arrow { color: #999; font-size: 1rem; font-weight: 300; }
.chain-box {
    padding: 3px 12px; border-radius: 4px;
    font-weight: 600; color: #fff; font-size: 0.75rem;
}
.chain-box.fin { background: var(--red); }
.chain-box.cus { background: var(--orange); }
.chain-box.int { background: var(--green); }
.chain-box.lea { background: var(--blue); }
.chain-note { color: #999; font-size: 0.68rem; margin-left: 6px; }

.bsc-footer {
    background: #f8f9fc; border: 1px solid var(--border); border-radius: 6px;
    padding: 10px 16px; font-size: 0.75rem; color: var(--text-secondary);
    display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px 16px;
}
.bsc-footer-item { display: flex; gap: 4px; }
.f-icon { font-weight: 700; }

/* ==================== Monthly Analysis Table ==================== */
.month-ref {
    background: #eef2f7; border-left: 4px solid var(--primary);
    padding: 8px 14px; border-radius: 4px; font-size: 0.8rem;
    color: var(--text-secondary); margin-bottom: 16px;
    display: flex; flex-wrap: wrap; gap: 4px 18px; align-items: center;
}
.ref-label { font-weight: 600; color: var(--primary); }
.month-ref strong { color: var(--text); font-weight: 600; }

.month-dashboard {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0;
    border: 2px solid var(--primary); border-radius: 8px; overflow: hidden;
    margin-bottom: 16px;
}
.dash-item {
    padding: 6px 8px; text-align: center;
    border-right: 1px solid var(--border); background: var(--white);
}
.dash-item:last-child { border-right: none; }
.dash-item .label { font-size: 0.65rem; color: var(--text-muted); font-weight: 600; display: block; }
.dash-item .value { font-size: 0.95rem; font-weight: 700; }
.dash-item .vs { font-size: 0.62rem; color: #bbb; }
/* KPI 看板卡片（共享标记类 .kpi-cards：monthly 页蓝框看板 + weekly 页本周核心目标；budget 页同名 .month-dashboard 不加该类保持原样）：
   独立圆角卡+顶部彩条（dash-* 取原色板）、主数字行在上/辅助小字在下、hover 上浮 */
.month-dashboard.kpi-cards {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px; border: none; border-radius: 0; overflow: visible;
}
.kpi-cards .dash-item {
    position: relative; overflow: hidden;
    display: flex; flex-direction: column; gap: 3px;
    padding: 11px 14px 10px; text-align: left;
    background: var(--white); border: 1px solid var(--border); border-radius: 10px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.kpi-cards .dash-item::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: var(--dash-accent, var(--primary));
}
.kpi-cards .dash-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(16, 24, 40, 0.10);
    border-color: var(--dash-accent, var(--primary));
}
.kpi-cards .dash-red { --dash-accent: var(--red); }
.kpi-cards .dash-orange { --dash-accent: var(--orange); }
.kpi-cards .dash-green { --dash-accent: var(--green); }
.kpi-cards .dash-blue { --dash-accent: var(--blue); }
.kpi-cards .dash-purple { --dash-accent: #8e44ad; }
.kpi-cards .dash-item .label {
    display: block; font-size: 0.72rem; font-weight: 600; color: var(--text-secondary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* 实绩行（vs）升为主数字、目标行（value）降为辅助小字：flex order 视觉换位，不动模板顺序 */
.kpi-cards .dash-item .vs {
    order: 1; margin-left: 0; white-space: nowrap;
    display: flex; align-items: baseline; gap: 3px; line-height: 1.35;
}
/* 实绩行三段：前缀/单位小字弱化，数字放大加粗突出 */
.kpi-cards .dash-item .vs .vs-k { font-size: 0.7rem; font-weight: 500; color: var(--text-muted); }
.kpi-cards .dash-item .vs .vs-n { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.kpi-cards .dash-item .vs .vs-u { font-size: 0.68rem; font-weight: 500; color: var(--text-muted); }
.kpi-cards .dash-item .value {
    order: 2; white-space: nowrap;
    display: flex; align-items: baseline; gap: 3px;
    font-size: 0.72rem; font-weight: 500; color: var(--text-muted);
}
/* 目标行同拆三段：数字黑色加粗，前缀「目标」与单位保持灰色小字 */
.kpi-cards .dash-item .value .val-n { font-weight: 700; color: var(--text); }
/* weekly 页本周核心目标：卡片组是 mo-personal 盒内末元素，去掉默认下边距 */
.mo-personal .month-dashboard.kpi-cards { margin-bottom: 0; }

.month-table-wrap { overflow-x: auto; margin-bottom: 16px; }
.month-table {
    width: 100%; border-collapse: collapse;
    font-size: 0.75rem; border: 1px solid var(--border);
    min-width: 800px;
}
.month-table th {
    background: #f7f8fa; color: var(--primary); font-weight: 700;
    padding: 5px 6px; border: 1px solid var(--border);
    text-align: center; font-size: 0.7rem; white-space: nowrap;
}
.month-table td {
    padding: 5px 6px; border: 1px solid var(--border);
    text-align: center; font-size: 0.72rem;
    vertical-align: middle;
}
.month-table .td-left { text-align: left; font-weight: 500; padding-left: 10px; }
.month-table .td-sub { padding-left: 28px; font-size: 0.7rem; color: var(--text-secondary); }
.month-table .td-center { text-align: center; }
/* 表格数值列一律右对齐（月度经营分析表数值格 / 序号列） */
.month-table .td-num { text-align: right; }
/* monthly 页月度经营分析表：数值加粗（budget 页同款表不在 .monthly-page 内，不受影响） */
.monthly-page .month-table td.td-num { font-weight: 700; }
.tasks-table td.td-no, .improve-table td.td-no { text-align: right; }
.month-table .td-input { color: var(--text-muted); }
.month-table .td-empty, .mo-emp-table .td-empty { color: #ccc; }
.month-table .layer-row td,
.mo-emp-table .layer-row td {
    background: #fafbfc; font-weight: 700;
    color: var(--primary); text-align: left; padding-left: 10px;
}
.month-table .layer-fin td, .mo-emp-table .layer-fin td { border-left: 4px solid var(--red); }
.month-table .layer-cus td, .mo-emp-table .layer-cus td { border-left: 4px solid var(--orange); }
.month-table .layer-int td, .mo-emp-table .layer-int td { border-left: 4px solid var(--green); }
.month-table .layer-lea td, .mo-emp-table .layer-lea td { border-left: 4px solid var(--blue); }
.month-table .layer-misc td, .mo-emp-table .layer-misc td { border-left: 4px solid var(--text-muted); }

.month-improve {
    border: 2px solid var(--green); border-radius: 6px;
    overflow: hidden; margin-bottom: 14px;
}
.improve-header {
    background: var(--green); color: #fff;
    padding: 5px 14px; font-weight: 700; font-size: 0.85rem;
    display: flex; align-items: center; gap: 10px;
}
.improve-tag { font-weight: 400; font-size: 0.68rem; opacity: 0.85; }
.improve-table {
    width: 100%; border-collapse: collapse; font-size: 0.72rem;
}
.improve-table th {
    background: var(--green); color: #fff; font-weight: 700;
    padding: 4px 8px; text-align: left; font-size: 0.72rem;
    border: 1px solid var(--green);
}
.improve-table td {
    padding: 5px 8px; border: 1px solid var(--border);
    font-size: 0.72rem; vertical-align: middle;
    color: #ccc; text-align: center;
}

/* ==================== Weekly Plan & Review ==================== */
.week-goals {
    display: grid; grid-template-columns: 1.2fr 1fr;
    gap: 0; border: 1px solid var(--border); border-radius: 6px;
    overflow: hidden; margin-bottom: 16px; font-size: 0.8rem;
}
.week-goal-item {
    padding: 8px 12px; border-right: 1px solid var(--border);
    background: var(--white);
}
.week-goal-item:last-child { border-right: none; }
.goal-label {
    font-weight: 600; color: var(--primary); font-size: 0.75rem;
    display: block; margin-bottom: 4px;
}
.goal-value {
    color: var(--text); line-height: 1.6; font-size: 0.8rem;
}
.goal-tag {
    display: inline-block; background: #eef2f7; padding: 0 8px;
    border-radius: 10px; font-size: 0.72rem; color: var(--text-secondary);
    margin-right: 4px;
}
.goal-input {
    width: 100%; padding: 4px 8px; border: 1px solid var(--border);
    border-radius: 4px; font-size: 0.8rem; font-family: inherit;
    background: #fafbfc; outline: none; transition: border-color 0.2s;
}
.goal-input:focus { border-color: var(--primary); background: var(--white); }

/* 本周核心目标（/weekly 页）：已改用 .month-dashboard.kpi-cards KPI 卡片（与 monthly 看板同款），旧 week-goal chip 样式已删 */
/* AI 生成按钮 .ai-generate-btn 已删（monthly 主表标题行旧「改善方案建议」入口移除，AI 入口统一为筛选行 .week-ai-sum-btn） */

/* Week Table */
.week-table-wrap {
    overflow-x: auto; margin-bottom: 16px;
    border: 1px solid var(--border); border-radius: 6px;
}
.week-table {
    width: 100%; border-collapse: collapse; font-size: 0.72rem; min-width: 800px;
}
.week-table th {
    background: #f7f8fa; color: var(--primary); font-weight: 700;
    padding: 5px 6px; border: 1px solid var(--border);
    text-align: center; font-size: 0.7rem;
}
.week-table td {
    padding: 4px 6px; border: 1px solid var(--border);
    vertical-align: middle; text-align: center; font-size: 0.72rem;
}
.week-table .td-left { text-align: left; padding-left: 8px; }
.week-table .td-day { font-weight: 600; color: var(--primary); white-space: nowrap; }
.day-date { font-size: 0.62rem; color: var(--text-muted); }
.week-table .td-time { font-size: 0.68rem; color: var(--text-secondary); white-space: pre-line; }
.week-table td.td-input { font-size: 0.7rem; color: var(--text); text-align: left; padding-left: 8px; }
.week-action-line { display: inline; }
.tag-sm {
    display: inline-block; font-size: 0.6rem; padding: 0 6px;
    border-radius: 8px; color: #fff; margin-right: 2px; line-height: 1.6;
}
.tag-design { background: var(--blue); }
.tag-sale { background: var(--orange); }
.tag-prod { background: var(--green); }
.tag-install { background: #8e44ad; }
.week-input {
    width: 100%; padding: 2px 4px; border: 1px solid var(--border);
    border-radius: 3px; font-size: 0.7rem; font-family: inherit;
    background: #fafbfc; outline: none; transition: border-color 0.2s;
}
.week-input:focus { border-color: var(--primary); background: var(--white); }

/* Week Plan Box（/weekly 页：本周工作 + 下周计划 合并单框；标题与保存按钮同行，富文本 + 5 秒自动保存） */
.week-plan-bar {
    display: flex; align-items: center;
    gap: 10px; margin-bottom: 10px;
}
.week-plan-title { font-weight: 700; font-size: 0.9rem; color: var(--text); margin-right: auto; }
.week-plan-save-tip { font-size: 0.75rem; color: var(--text-muted); }
.week-plan-save-tip.dirty { color: #d97706; }
.week-plan-save-tip.saved { color: var(--green); }
.week-plan-save-tip.error { color: var(--red); }
.week-plan-save-tip.saving { color: var(--primary); }
.week-plan-save-btn {
    background: var(--primary); color: #fff; border: none;
    border-radius: 6px; padding: 5px 14px;
    font-size: 0.78rem; font-family: inherit; cursor: pointer;
    transition: background 0.2s; white-space: nowrap;
}
.week-plan-save-btn:hover:not(:disabled) { background: var(--primary-hover); }
.week-plan-save-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.week-plan-box {
    background: var(--white); border: 1px solid var(--border);
    border-radius: 6px; padding: 12px 14px; margin-bottom: 16px;
}
.week-plan-sec + .week-plan-sec { margin-top: 16px; }
.week-plan-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 6px;
}
.week-plan-label { font-weight: 600; color: var(--primary); font-size: 0.85rem; }
.week-rt-tools button {
    border: 1px solid var(--border); background: var(--white); color: var(--text-muted);
    font-size: 0.72rem; font-family: inherit; padding: 2px 10px;
    border-radius: 3px; margin-left: 4px; cursor: pointer; transition: all 0.15s;
}
.week-rt-tools button:hover { border-color: var(--primary); color: var(--primary); }
.week-rt-input {
    width: 100%; min-height: 160px; max-height: 420px; overflow-y: auto;
    border: 1px solid var(--border); border-radius: 4px;
    padding: 8px 10px; font-size: 0.9rem; line-height: 1.7;
    background: #fafbfc; outline: none; transition: border-color 0.2s;
}
.week-rt-input:focus { border-color: var(--primary); background: var(--white); }
.week-rt-input:empty::before { content: attr(data-placeholder); color: #bbb; pointer-events: none; }
.week-rt-input p { margin: 0 0 4px; }
.week-rt-input ul, .week-rt-input ol { margin: 2px 0; padding-left: 22px; }
.week-rt-input h1, .week-rt-input h2, .week-rt-input h3 { font-size: 0.95rem; margin: 6px 0 3px; }
.week-rt-input blockquote { margin: 4px 0; padding: 2px 10px; border-left: 3px solid var(--border); color: var(--text-muted); }
.gap-neg { color: var(--red); }
.review-val.rate-good { color: var(--green); font-weight: 700; }
.review-val.rate-bad { color: var(--red); font-weight: 700; }
/* 周计划页·部门整体指标完成情况表（month-table 变体）：达成率着色沿用复盘规则 */
.week-review-table .rate-good { color: var(--green); font-weight: 700; }
.week-review-table .rate-bad { color: var(--red); font-weight: 700; }

/* Review Section */
.week-review {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0; border: 1px solid var(--border); border-radius: 6px;
    overflow: hidden; margin-bottom: 14px;
}
.review-item {
    padding: 8px 12px; border-right: 1px solid var(--border);
    background: var(--white);
}
.review-item:last-child { border-right: none; }
.review-label {
    font-weight: 600; color: var(--primary); font-size: 0.75rem;
    display: block; margin-bottom: 4px;
}
.review-row {
    display: flex; justify-content: space-between;
    padding: 2px 0; font-size: 0.8rem;
    border-bottom: 1px dashed #ecf0f3;
}
.review-row:last-child { border-bottom: none; }
.review-val { color: var(--text); }
.review-input { color: var(--text-muted); }

/* Summary Section */
.week-summary {
    display: grid; grid-template-columns: 1fr 1fr 1.2fr;
    gap: 0; border: 1px solid var(--border); border-radius: 6px;
    overflow: hidden; margin-bottom: 14px; background: #fafbfc;
}
.summary-item {
    padding: 8px 12px; border-right: 1px solid var(--border);
    min-height: 65px;
}
.summary-item:last-child { border-right: none; }
.summary-label {
    font-weight: 700; color: var(--primary); font-size: 0.8rem;
    display: block; margin-bottom: 4px;
}
.summary-input {
    width: 100%; padding: 3px 6px; border: 1px solid var(--border);
    border-radius: 3px; font-size: 0.75rem; font-family: inherit;
    background: var(--white); outline: none; margin-bottom: 3px;
    transition: border-color 0.2s;
}
.summary-input:focus { border-color: var(--primary); }
.summary-input::placeholder { color: #bbb; }
.summary-text {
    font-size: 0.78rem; color: var(--text); line-height: 1.6;
    padding: 2px 0;
}

/* Logic Section */
.week-logic {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 0; border: 1px solid var(--border); border-radius: 6px;
    overflow: hidden; margin-bottom: 16px;
}
.logic-item {
    padding: 8px 14px; border-right: 1px solid var(--border);
}
.logic-item:last-child { border-right: none; }
.logic-item-label {
    font-weight: 700; font-size: 0.8rem; display: block; margin-bottom: 4px;
}
.logic-desc {
    font-size: 0.78rem; color: var(--text-secondary); line-height: 1.6;
}
.logic-desc strong { font-weight: 700; }

/* ==================== Init Page ==================== */
.init-steps {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 0;
    padding: 12px 0;
}
.init-step-card {
    display: flex;
    align-items: stretch;
    gap: 14px;
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    padding: 24px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 0;
    position: relative;
}
.init-step-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 20px rgba(77,107,254,0.1);
    transform: translateY(-2px);
}
.init-step-num {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.init-step-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.init-step-icon { font-size: 1.5rem; margin-bottom: 6px; }
.init-step-title { font-size: 1.05rem; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.init-step-desc { font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; margin-bottom: 14px; flex: 1; }
.init-step-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 500;
}
.init-step-action svg { width: 14px; height: 14px; transition: transform 0.2s; }
.init-step-card:hover .init-step-action svg { transform: translateX(3px); }
.init-connector {
    padding: 0 6px;
    color: var(--border);
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.init-connector svg { width: 24px; height: 24px; transform: rotate(-90deg); }

/* 任务完成状态徽标（卡片右上角） */
.init-step-status {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    background: #f3f4f6;
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.init-step-status.done {
    background: #e8f7ee;
    color: #16a34a;
    border-color: #bfe8cd;
}

/* 完成初始化按钮区 */
.init-complete-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 28px;
    padding-bottom: 8px;
}
.init-complete-btn {
    min-width: 220px;
    padding: 12px 0;
    border: none;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.init-complete-btn:hover:not(:disabled) { background: var(--primary-hover); }
.init-complete-btn:disabled { background: #ccc; cursor: not-allowed; }
.init-complete-hint { font-size: 0.8rem; color: var(--text-muted); }
.init-complete-error { font-size: 0.8rem; color: #dc2626; }

@media (max-width: 900px) {
    .init-steps { flex-direction: column; align-items: center; }
    .init-step-card { flex: none; width: 100%; max-width: 520px; }
    .init-connector { padding: 8px 0; }
    .init-connector svg { transform: none; }
}

/* ==================== Dept Page ==================== */
.main-content.dept-page { max-width: none; }   /* dept 页全宽铺满屏幕 */
/* dept 页标题行：返回按钮与「部门员工管理」标题齐平靠右（按钮基础规则为 6 页共用，覆盖只在 dept 作用域） */
.dept-head-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.dept-head-row .page-title { margin-bottom: 0; }
.dept-head-row .detail-back-btn { margin-bottom: 0; flex-shrink: 0; }
.dept-split {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 16px;
    margin-top: 16px;
}
.dept-tree-panel {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}
.dept-tree-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}
.dept-tree-header span { font-weight: 600; font-size: 0.9rem; }
.tree-add-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.78rem;
    color: var(--primary);
    cursor: pointer;
    transition: all 0.2s;
}
.tree-add-btn:hover { background: var(--primary-light); border-color: var(--primary); }

/* 新增项目下拉菜单（/bsc 左栏：直接创建 / 调整指标并创建） */
.new-proj-wrap { position: relative; }
.new-proj-menu {
    position: absolute; top: calc(100% + 6px); right: 0; z-index: 60;
    min-width: 250px; background: #fff; border: 1px solid var(--border);
    border-radius: 10px; box-shadow: 0 8px 24px rgba(20, 30, 80, 0.16);
    padding: 6px; overflow: hidden;
}
.new-proj-opt {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 9px 10px; border-radius: 8px; cursor: pointer; transition: background 0.15s;
}
.new-proj-opt:hover { background: var(--primary-light); }
.new-proj-opt .npo-icon { font-size: 1.05rem; line-height: 1.3; }
.new-proj-opt .npo-body { display: flex; flex-direction: column; gap: 2px; }
.new-proj-opt .npo-title { font-size: 0.84rem; font-weight: 700; color: var(--text); }
.new-proj-opt .npo-sub { font-size: 0.72rem; color: var(--text-muted); line-height: 1.4; }

/* Department Tree */
.dept-tree { font-size: 0.85rem; }
.tree-node { margin-left: 16px; }
.tree-node-root { margin-left: 0; }
.tree-row {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
    position: relative;
}
.tree-row:hover { background: #f5f5f5; }
.tree-row.active { background: var(--primary-light); color: var(--primary); font-weight: 500; }
.tree-toggle {
    width: 18px; height: 18px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.65rem;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform 0.2s;
    user-select: none;
}
.tree-children { margin-top: 2px; }
.tree-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tree-actions {
    display: none;
    gap: 2px;
    flex-shrink: 0;
    margin-left: 4px;
}
.tree-row:hover .tree-actions { display: flex; }
.tree-action-btn {
    background: none;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.15s;
}
.tree-action-btn:hover { background: #e8e8e8; color: var(--text); }
.tree-action-btn.danger:hover { background: var(--red-bg); color: var(--red); }

/* Employee Panel */
.dept-employee-panel {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 200px);
}
.employee-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    gap: 12px;
    flex-wrap: wrap;
}
.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f5f5f5;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 14px;
    flex: 1;
    max-width: 380px;
    min-width: 200px;
}
.search-box svg { width: 16px; height: 16px; color: var(--text-muted); flex-shrink: 0; }
.search-box input {
    border: none; background: none; outline: none;
    font-size: 0.85rem; color: var(--text); width: 100%;
}
.search-box input::placeholder { color: #bbb; }
.search-clear {
    background: none; border: none;
    font-size: 1rem; color: var(--text-muted);
    cursor: pointer; padding: 0 4px; line-height: 1;
}
.employee-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}
.employee-add-btn {
    background: var(--primary); color: white; border: none;
    border-radius: 8px; padding: 8px 16px;
    font-size: 0.82rem; font-weight: 500;
    cursor: pointer; transition: background 0.2s;
    white-space: nowrap;
}
.employee-add-btn:hover { background: var(--primary-hover); }
.employee-add-btn.import {
    background: white; color: var(--primary);
    border: 1px solid var(--primary);
}
.employee-add-btn.import:hover { background: var(--blue-bg); }
/* 批量删除（勾选员工后出现在工具栏） */
.employee-add-btn.batch-del {
    background: white; color: var(--red);
    border: 1px solid var(--red);
}
.employee-add-btn.batch-del:hover { background: #fdecec; }

/* Excel 导入 */
.import-hints { margin: 4px 0 16px; }
.import-hints p {
    font-size: 0.8rem; color: var(--text-muted);
    line-height: 1.9; margin: 0;
}
.import-hints b { color: var(--text); }
.import-actions-row { display: flex; gap: 10px; justify-content: flex-end; }
.import-summary {
    padding: 10px 14px; border-radius: 8px;
    font-size: 0.88rem; font-weight: 600; margin-bottom: 12px;
}
.import-summary.ok { background: #e8f7ee; color: #1a7f43; }
.import-summary.warn { background: #fff4e5; color: #b3660a; }
.import-errors {
    max-height: 240px; overflow-y: auto;
    background: #fafbfc; border: 1px solid var(--border);
    border-radius: 8px; padding: 8px 14px; margin-bottom: 6px;
}
.import-errors p {
    font-size: 0.8rem; color: var(--red);
    margin: 6px 0; line-height: 1.5;
}

/* Employee Table */
.dept-table-wrap { overflow-x: auto; flex: 1; }
.dept-table { width: 100%; border-collapse: collapse; }
.dept-table th {
    text-align: left; padding: 10px 14px;
    font-size: 0.78rem; font-weight: 600;
    color: var(--text-muted); text-transform: uppercase;
    letter-spacing: 0.5px; border-bottom: 2px solid var(--border);
    background: #fafbfc; white-space: nowrap;
}
.dept-table td {
    padding: 12px 14px; font-size: 0.85rem;
    color: var(--text); border-bottom: 1px solid #f0f0f0;
}
.dept-table tr:last-child td { border-bottom: none; }
.dept-table tr:hover td { background: #fafbfc; }
.dept-table .emp-name { font-weight: 600; }
.dept-table .emp-email { color: var(--text-muted); font-size: 0.82rem; }
/* 批量删除勾选列（第1列，表头为全选框） */
.dept-table .emp-check-col { width: 36px; min-width: 36px; padding-right: 0; }
.dept-table .emp-check-col input[type="checkbox"] {
    width: 15px; height: 15px; margin: 0;
    cursor: pointer; accent-color: var(--primary); vertical-align: middle;
}
/* 部门（第4列）/职位（第5列）加宽，避免徽章与职位名换行挤压（勾选列为第1列，原 3/4 列右移一位） */
.dept-table th:nth-child(4), .dept-table td:nth-child(4) { min-width: 150px; }
.dept-table th:nth-child(5), .dept-table td:nth-child(5) { min-width: 130px; }
.dept-badge {
    display: inline-block; background: var(--blue-bg); color: var(--blue);
    padding: 2px 8px; border-radius: 5px; font-size: 0.78rem; font-weight: 500;
}
/* 超级管理员：员工列表姓名旁徽章 + 员工弹窗勾选项
   （label 需 .form-group label.super-check 压过全局 .form-group label 的 block/muted 样式，同 radio-item 惯例） */
.super-badge {
    display: inline-block; background: var(--primary-light); color: var(--primary);
    padding: 1px 6px; border-radius: 4px; font-size: 0.68rem; font-weight: 600;
    margin-left: 6px; vertical-align: middle; white-space: nowrap;
}
.form-group label.super-check {
    display: flex; align-items: center; gap: 8px; cursor: pointer;
    font-size: 0.88rem; color: var(--text); font-weight: 400; margin-bottom: 0;
}
.form-group .super-check input[type="checkbox"] {
    width: 16px; height: 16px; margin: 0; padding: 0; cursor: pointer;
    accent-color: var(--primary);
}
.super-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }
.empty-table {
    text-align: center; padding: 40px 20px; color: var(--text-muted);
}
.empty-table span { font-size: 2rem; display: block; margin-bottom: 8px; }
.empty-table p { font-size: 0.85rem; }

/* Row Action Buttons */
.row-actions { display: flex; gap: 6px; white-space: nowrap; }
.action-btn {
    border: none; border-radius: 5px;
    padding: 4px 10px; font-size: 0.78rem;
    cursor: pointer; transition: all 0.15s;
}
.action-btn.edit { background: var(--blue-bg); color: var(--blue); }
.action-btn.edit:hover { background: var(--blue); color: white; }
.action-btn.delete { background: var(--red-bg); color: var(--red); }
.action-btn.delete:hover { background: var(--red); color: white; }
.action-btn.perm { background: var(--primary-light); color: var(--primary); }
.action-btn.perm:hover { background: var(--primary); color: white; }

/* Permission Dialog（员工权限管理） */
.dialog-box.perm-box { width: 640px; max-width: 94vw; }
.perm-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border-light); margin-bottom: 16px; }
.perm-tab {
    padding: 8px 18px; cursor: pointer; font-size: 0.88rem;
    color: var(--text-secondary); border-bottom: 2px solid transparent;
    transition: all 0.15s; user-select: none;
}
.perm-tab:hover { color: var(--primary); }
.perm-tab.active { color: var(--primary); font-weight: 600; border-bottom-color: var(--primary); }
.perm-body { max-height: 46vh; overflow-y: auto; padding-right: 4px; }
.perm-group { margin-bottom: 16px; }
.perm-group-name { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 8px; }
.perm-checks { display: flex; flex-wrap: wrap; gap: 10px 20px; }
.perm-check { display: flex; align-items: center; gap: 7px; font-size: 0.86rem; color: var(--text); cursor: pointer; }
.perm-check input { accent-color: var(--primary); width: 15px; height: 15px; cursor: pointer; flex-shrink: 0; }
.perm-data-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.perm-summary { font-size: 0.78rem; color: var(--text-muted); }
.perm-mini-btn {
    border: 1px solid var(--border); background: var(--white); border-radius: 6px;
    padding: 3px 12px; font-size: 0.75rem; color: var(--text-secondary);
    cursor: pointer; margin-left: 6px; transition: all 0.15s;
}
.perm-mini-btn:hover { border-color: var(--primary); color: var(--primary); }
.perm-tree { border: 1px solid var(--border-light); border-radius: 8px; padding: 6px 0; background: #fafafa; }
.perm-node { display: flex; align-items: center; gap: 4px; padding: 5px 10px 5px 0; }
.perm-node:hover { background: #f0f0f0; }
.perm-toggle { width: 18px; text-align: center; cursor: pointer; color: var(--text-muted); font-size: 0.75rem; flex-shrink: 0; }
.perm-check.dept .perm-node-name { font-weight: 600; }

/* Dialog Modal */
.dialog-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.35);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.15s ease;
}
.dialog-box {
    background: var(--white); border-radius: 14px;
    padding: 24px 28px; width: 400px; max-width: 90vw;
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}
.dialog-title { font-size: 1.05rem; font-weight: 600; margin-bottom: 18px; }
.form-group { margin-bottom: 14px; }
.form-group label {
    display: block; font-size: 0.8rem; font-weight: 500;
    color: var(--text-muted); margin-bottom: 5px;
}
.form-group input {
    width: 100%; border: 1px solid var(--border);
    border-radius: 8px; padding: 9px 12px;
    font-size: 0.88rem; outline: none;
    transition: border-color 0.2s;
}
.form-group input:focus { border-color: var(--primary); }
/* 只读字段（个人信息弹窗的员工号/职位：管理员维护，不可自助编辑） */
.form-group input:disabled {
    background: #f5f6f8; color: var(--text-muted); cursor: not-allowed;
}
.form-group textarea {
    width: 100%; border: 1px solid var(--border);
    border-radius: 8px; padding: 9px 12px;
    font-size: 0.88rem; outline: none;
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
    transition: border-color 0.2s;
}
.form-group textarea:focus { border-color: var(--primary); }
.form-group select,
.form-select {
    width: 100%; border: 1px solid var(--border);
    border-radius: 8px; padding: 9px 12px;
    font-size: 0.88rem; outline: none;
    background: white;
    transition: border-color 0.2s;
    appearance: auto;
}
.form-group select:focus,
.form-select:focus { border-color: var(--primary); }
.form-actions {
    display: flex; justify-content: flex-end;
    gap: 10px; margin-top: 20px;
}
.form-btn {
    border: none; border-radius: 8px;
    padding: 9px 20px; font-size: 0.85rem;
    cursor: pointer; font-weight: 500;
    transition: all 0.2s;
}
.form-btn.cancel { background: #f0f0f0; color: var(--text); }
.form-btn.cancel:hover { background: #e0e0e0; }
.form-btn.primary { background: var(--primary); color: white; }
.form-btn.primary:hover { background: var(--primary-hover); }
.form-btn.danger { background: var(--red); color: white; }
.form-btn.danger:hover { background: #dc2626; }
.form-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.form-error {
    color: var(--red); font-size: 0.82rem;
    background: var(--red-bg); border-radius: 8px;
    padding: 8px 10px; margin-top: 4px;
}
.form-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 5px; }

/* ===== Login Page ===== */
.login-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(160deg, var(--primary-light) 0%, var(--bg) 45%);
    padding: 24px;
}
.login-card {
    width: 380px; max-width: 100%; background: var(--white);
    border: 1px solid var(--border-light); border-radius: 16px;
    padding: 36px 32px 26px; box-shadow: 0 12px 40px rgba(0,0,0,0.08);
}
.login-logo {
    width: 48px; height: 48px; background: var(--primary); border-radius: 12px;
    color: #fff; font-size: 24px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 14px;
}
.login-title { text-align: center; font-size: 1.25rem; font-weight: 700; margin-bottom: 18px; }
.login-ent {
    text-align: center; font-size: 0.82rem; border-radius: 8px; padding: 7px 10px;
    margin-bottom: 18px; color: var(--primary); background: var(--primary-light);
}
.login-ent.loading { color: var(--text-muted); background: var(--bg); }
.login-ent.error { color: var(--red); background: var(--red-bg); }
.login-btn {
    width: 100%; margin-top: 16px; padding: 10px 0;
    border: none; border-radius: 8px; background: var(--primary);
    color: #fff; font-size: 0.95rem; font-weight: 500;
    cursor: pointer; transition: background 0.2s;
}
.login-btn:hover:not(:disabled) { background: var(--primary-hover); }
.login-btn:disabled { opacity: 0.55; cursor: not-allowed; }

@media (max-width: 900px) {
    .dept-split { grid-template-columns: 1fr; }
    .dept-tree-panel { max-height: 300px; }
    .week-goals { grid-template-columns: 1fr; }
    .week-goal-item { border-right: none; border-bottom: 1px solid var(--border); }
    .week-goal-item:last-child { border-bottom: none; }
    .week-review { grid-template-columns: 1fr; }
    .review-item { border-right: none; border-bottom: 1px solid var(--border); }
    .review-item:last-child { border-bottom: none; }
    .week-summary { grid-template-columns: 1fr; }
    .summary-item { border-right: none; border-bottom: 1px solid var(--border); }
    .summary-item:last-child { border-bottom: none; }
    .week-logic { grid-template-columns: 1fr; }
    .logic-item { border-right: none; border-bottom: 1px solid var(--border); }
    .logic-item:last-child { border-bottom: none; }
    .week-table { font-size: 0.62rem; min-width: 700px; }
}
@media (max-width: 900px) {
    .progress-cards { grid-template-columns: 1fr; }
    .recommend-list { grid-template-columns: 1fr; }
    .workspace { flex-direction: column; }
    .chat-panel { width: 100%; min-width: 0; height: 50%; border-right: none; border-bottom: 1px solid var(--border); }
    .preview-panel { height: 50%; }
    .summary-cards { grid-template-columns: 1fr; }
    .suggestions { grid-template-columns: 1fr; }
    .tab-item { padding: 0 12px; font-size: 0.76rem; }
    .header-tab-item { padding: 0 10px; font-size: 0.78rem; }
    .bsc-grid { grid-template-columns: 1fr; }
    .bsc-summary { grid-template-columns: repeat(3, 1fr); }
    .bsc-summary-item { border-bottom: 1px solid var(--border); }
    .bsc-months { grid-template-columns: repeat(2, 1fr); }
    .bsc-month-item { border-bottom: 1px solid var(--border); }
    .bsc-footer { grid-template-columns: 1fr 1fr; }
    .month-dashboard { grid-template-columns: repeat(4, 1fr); }
    .dash-item { border-bottom: 1px solid var(--border); }
    /* KPI 看板为独立卡片，窄屏改两列网格（不沿用 4 列硬拆） */
    .month-dashboard.kpi-cards { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

/* ===== BSC Adjust Page ===== */
.adj-logic {
    background: var(--bg); border-left: 4px solid #1a2a5e; border-radius: 6px;
    padding: 12px 18px; margin-bottom: 18px; font-size: 0.85rem;
    color: var(--text); line-height: 1.8;
}
.adj-logic strong { color: #1a2a5e; }
.adj-logic-core { margin-top: 6px; }
.adj-logic-core > span { display: block; margin-top: 4px; line-height: 1.8; }

.adj-table-wrap { overflow-x: auto; margin-bottom: 18px; }
.adj-table {
    width: 100%; border-collapse: collapse; font-size: 0.78rem;
    border: 1px solid var(--border);
}
.adj-table th {
    background: var(--bg); color: #1a2a5e; font-weight: 700;
    padding: 8px 10px; border: 1px solid var(--border);
    text-align: center; font-size: 0.76rem;
}
.adj-table td {
    padding: 6px 10px; border: 1px solid var(--border);
    vertical-align: middle; text-align: center; font-size: 0.78rem; color: var(--text);
}
/* 数值列（原目标/实际/调整后/调整幅度）右对齐；文本列与层面合并行保持原样 */
.adj-table td:not(.td-left):not(.td-reason):not(.td-impact):not([colspan]) { text-align: right; }
.adj-table .td-left { text-align: left; font-weight: 500; padding-left: 12px; }
.adj-table .td-sub { padding-left: 32px; font-size: 0.72rem; }
.adj-table .td-old { color: var(--text); font-weight: 700; }
.adj-table .td-reason { font-size: 0.72rem; color: var(--text-secondary); text-align: left; padding-left: 10px; }
.adj-table .td-impact { font-size: 0.72rem; color: #2980b9; text-align: left; padding-left: 10px; }
.adj-table .layer-row td {
    background: var(--bg); font-weight: 700; color: #1a2a5e;
    text-align: left; padding-left: 12px;
}
.adj-table .sub-row td { font-size: 0.72rem; }
.layer-label-fin { border-left: 4px solid #c0392b; }
.layer-label-cus { border-left: 4px solid #e67e22; }
.layer-label-int { border-left: 4px solid #27ae60; }
.layer-label-lea { border-left: 4px solid #2980b9; }

.adj-impact-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px;
}
.adj-impact-box {
    border-radius: 8px; padding: 12px 16px;
}
.adj-impact-box.risk { background: #fcf2f0; border-left: 4px solid #c0392b; }
.adj-impact-box.support { background: #eef7f2; border-left: 4px solid #27ae60; }
.adj-impact-title { font-weight: 700; font-size: 0.85rem; margin-bottom: 6px; }
.adj-impact-box.risk .adj-impact-title { color: #c0392b; }
.adj-impact-box.support .adj-impact-title { color: #27ae60; }
.adj-impact-box ul { font-size: 0.8rem; color: var(--text-secondary); padding-left: 20px; line-height: 1.9; }

.adj-footer {
    background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
    padding: 12px 18px; display: grid; grid-template-columns: 1fr 1fr 1fr;
    gap: 6px 20px;
}
.adj-footer-item { display: flex; gap: 4px; font-size: 0.76rem; color: var(--text-secondary); }
.adj-footer-item .dot { font-weight: 700; color: #1a2a5e; }
.adj-footer-item strong { color: var(--text); }
.layer-label-misc { border-left: 4px solid #7f8c8d; }

/* 调整表交互版（真实数据）：输入格 / 改动高亮（页面外框/筛选/按钮均复用 monthly 同款
   pt-detail / mo-filters / edit-submit-bar，见 .bsc-adjust-page 选择器扩展） */
.adj-hint {
    font-size: 0.78rem; color: var(--text-secondary); background: #f4f7fd;
    border: 1px solid #dde7f7; border-radius: 8px; padding: 8px 12px; margin-bottom: 14px;
}
.adj-hint strong { color: #c0392b; }
.adj-input {
    width: 92px; border: 1px solid var(--border); border-radius: 6px;
    padding: 4px 8px; font-size: 0.8rem; text-align: right; color: #2980b9; font-weight: 700;
    background: #f5f9ff;
}
.adj-input:focus { outline: none; border-color: var(--primary); background: #fff; }
.adj-reason-input {
    width: 100%; min-width: 160px; border: 1px solid var(--border); border-radius: 6px;
    padding: 4px 8px; font-size: 0.75rem; color: var(--text); background: #fff;
}
.adj-reason-input:focus { outline: none; border-color: var(--primary); }
.adj-calc { color: #2980b9; font-weight: 700; font-size: 0.82rem; }
.adj-table tr.adj-changed > td { background: #fdf9f0; }
.adj-table tr.adj-changed .td-left { box-shadow: inset 3px 0 0 #e67e22; }
/* 页头右侧 chips 里的时间/团队弹层靠右对齐，防溢出视口（personal-split 同款处理）；
   选择器须带 .split-page 提权（0,3,0）：裸 .bsc-adjust-page .meta-pop 与后文 .split-page .meta-pop
   同权重且在前会被压掉 left/transform，残留 right:0 与 left:50% 叠加导致面板被拉伸收窄、内容溢出无背景 */
.bsc-adjust-page .split-page .meta-pop, .bsc-edit-page .split-page .meta-pop { left: auto; right: 0; transform: none; }

/* bsc-edit 第一步：调整预填提示条 */
.adj-prefill-note {
    font-size: 0.8rem; color: #8a5a00; background: #fdf6e3;
    border: 1px solid #f0e0b0; border-radius: 8px; padding: 8px 14px; margin-bottom: 14px;
}

@media (max-width: 768px) {
    .adj-impact-grid { grid-template-columns: 1fr; }
    .adj-footer { grid-template-columns: 1fr 1fr; }
    .adj-table { min-width: 800px; }
}

/* ===== New Project Page ===== */
.new-project-page { max-width: 680px; margin: 0 auto; padding-top: 20px; }
.new-project-header { text-align: center; margin-bottom: 36px; }
.new-project-header h1 { font-size: 1.5rem; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.new-project-header p { font-size: 0.92rem; color: var(--text-secondary); }
.new-project-cards { display: flex; flex-direction: column; gap: 16px; }
.new-project-card {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 24px; background: var(--white);
    border: 2px solid var(--border); border-radius: 14px;
    cursor: pointer; transition: all 0.2s; position: relative;
}
.new-project-card:hover {
    border-color: var(--primary); background: var(--primary-light);
    transform: translateY(-2px); box-shadow: 0 6px 20px rgba(59,130,246,0.12);
}
.npc-icon { font-size: 2.5rem; flex-shrink: 0; }
.npc-title { font-size: 1.05rem; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.npc-desc { font-size: 0.82rem; color: var(--text-muted); line-height: 1.5; }
.npc-arrow {
    position: absolute; right: 24px; top: 50%; transform: translateY(-50%);
    font-size: 1.4rem; color: var(--text-muted); transition: all 0.2s;
}
.new-project-card:hover .npc-arrow { color: var(--primary); right: 20px; }

/* ===== BSC Edit Page ===== */
.meta-input {
    background: none; border: none; border-bottom: 1px dashed var(--border);
    font-size: inherit; color: var(--text); width: 120px; padding: 2px 4px;
    font-family: inherit;
}
.meta-input:focus { outline: none; border-bottom-color: var(--primary); }
.edit-input {
    width: 100%; padding: 8px 12px; border: 1.5px solid var(--border);
    border-radius: 8px; font-size: 1.1rem; font-weight: 700;
    text-align: center; font-family: inherit; background: var(--white);
    transition: border-color 0.2s;
}
.edit-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }
.edit-input.c-gold { color: #d97706; }
.edit-input.c-red { color: #ef4444; }
.edit-input.c-purple { color: #8b5cf6; }
.edit-input.c-green { color: #22c55e; }
.edit-input.c-blue { color: #3b82f6; }

.month-edit-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 0.85rem; }
.month-input {
    width: 80px; padding: 4px 8px; border: 1.5px solid var(--border);
    border-radius: 6px; font-size: 0.85rem; font-weight: 600;
    text-align: center; font-family: inherit;
}
.month-input:focus { outline: none; border-color: var(--primary); }

.r-input {
    width: 100px; padding: 4px 8px; border: 1.5px solid var(--border);
    border-radius: 6px; font-size: 0.85rem; font-weight: 700;
    text-align: center; font-family: inherit;
}
.r-input:focus { outline: none; border-color: var(--primary); }
.r-action-input {
    flex: 1; min-width: 100px; padding: 4px 8px; border: 1.5px solid var(--border);
    border-radius: 6px; font-size: 0.78rem; font-family: inherit;
}
.r-action-input:focus { outline: none; border-color: var(--primary); }

.edit-submit-bar {
    display: flex; gap: 12px; justify-content: center; margin-top: 28px; padding-bottom: 20px;
}
.edit-submit-btn {
    padding: 10px 36px; background: var(--primary); color: #fff;
    border: none; border-radius: 10px; font-size: 0.95rem; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
}
.edit-submit-btn:hover { background: #2563eb; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(59,130,246,0.3); }
.edit-cancel-btn {
    padding: 10px 36px; background: none; color: var(--text-muted);
    border: 1px solid var(--border); border-radius: 10px; font-size: 0.95rem;
    cursor: pointer; transition: all 0.15s;
}
.edit-cancel-btn:hover { background: var(--bg); color: var(--text); }

/* --- bsc-edit 页指标化改版（页面私有部分 .bsc-edit 作用域；时间弹层/split-head/calc-box 等
       与 /personal-split 页共享的家族挂 .split-page，两页容器都带该类） --- */
/* 顶部三格：时间/团队下拉选择 */
.split-page .meta-pick { position: relative; cursor: pointer; user-select: none; }
.split-page .meta-pick b { font-weight: 600; color: var(--text); }
.split-page .meta-ph { color: var(--text-muted); font-weight: 400 !important; }
.split-page .pick-caret { width: 12px; height: 12px; vertical-align: -1px; color: var(--text-muted); }
.split-page .meta-pop {
    position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%);
    background: var(--white); border: 1px solid var(--border); border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.12); padding: 10px 12px; z-index: 30;
    cursor: default; white-space: nowrap; text-align: left;
}
.split-page .pop-row { display: flex; align-items: center; gap: 8px; }
.split-page .pop-tilde { color: var(--text-muted); }
.split-page .pop-ok {
    margin-top: 8px; width: 100%; padding: 4px 0; background: var(--primary); color: #fff;
    border: none; border-radius: 6px; cursor: pointer; font-size: 0.8rem; font-family: inherit;
}
.split-page .pop-depts { display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow-y: auto; min-width: 170px; }
.split-page .pop-dept { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; cursor: pointer; color: var(--text); }
.split-page .pop-empty { font-size: 0.78rem; color: var(--text-muted); }
/* 蓝框：数字输入 + 单位在框外（输入字体与卡片一致偏小） */
.bsc-edit .bsc-summary { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.bsc-edit .bsc-summary-item { border-bottom: 1px solid var(--border); }
.bsc-edit .sum-in-row { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 4px; }
.bsc-edit .sum-in-row .edit-input { width: 84px; padding: 5px 8px; font-size: 0.88rem; }
.bsc-edit .sum-in-row .calc-box { width: 84px; padding: 5px 8px; font-size: 0.88rem; }
.bsc-edit .unit-out { font-size: 0.78rem; color: var(--text-secondary); font-weight: 600; }
/* 两步向导指示条 */
.bsc-edit .step-bar { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 12px 0 18px; }
.bsc-edit .step-chip {
    display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
    font-size: 0.8rem; color: var(--text-muted); background: #f1f3f7;
    border: 1px solid var(--border); border-radius: 999px; padding: 4px 14px;
    transition: all 0.15s; user-select: none;
}
.bsc-edit .step-chip b {
    display: inline-flex; align-items: center; justify-content: center;
    width: 18px; height: 18px; border-radius: 50%; font-size: 0.7rem;
    background: var(--border); color: #fff;
}
.bsc-edit .step-chip.active { color: var(--primary); border-color: var(--primary); background: #eff6ff; font-weight: 600; }
.bsc-edit .step-chip.active b { background: var(--primary); }
.bsc-edit .step-chip.done { color: var(--text-secondary); }
.bsc-edit .step-chip.done b { background: var(--green, #22c55e); }
.bsc-edit .step-arrow { color: var(--text-muted); font-size: 0.85rem; }
/* 第二步：目标分拆 月×部门 二维表 */
.split-page .split-head { font-size: 0.95rem; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.split-page .split-sub { font-size: 0.75rem; font-weight: 400; color: var(--text-muted); margin-left: 8px; }
.split-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 16px; }
.split-table { border-collapse: collapse; width: 100%; font-size: 0.78rem; background: var(--white); }
.split-table th, .split-table td { border: 1px solid var(--border); padding: 4px 6px; text-align: center; white-space: nowrap; }
/* 数字右对齐：除指标列与跨列合并格（层面行/空态行）外，数值格全部右对齐 */
.split-table td:not(.st-ind):not([colspan]) { text-align: right; }
.split-table thead th { background: #f7f8fa; color: var(--text-secondary); font-weight: 600; }
.split-table .st-month { font-size: 0.8rem; font-weight: 700; color: var(--text); background: #eef2f8; }
.split-table .st-dept { font-size: 0.72rem; font-weight: 500; }
/* 月份分组分隔线（每月第一列左边加粗） */
.split-table .st-month-start { border-left: 2px solid #c9d2de; }
/* 指标列：横向滚动时吸附在左侧 */
.split-table .st-ind {
    position: sticky; left: 0; z-index: 2; background: var(--white);
    text-align: left; min-width: 170px; max-width: 240px;
    overflow: hidden; text-overflow: ellipsis; font-weight: 600; color: var(--text);
}
.split-table thead .st-ind { z-index: 3; background: #f7f8fa; }
.split-table .st-unit { font-size: 0.68rem; font-weight: 400; color: var(--text-muted); }
.split-table .st-input {
    width: 64px; padding: 3px 4px; border: 1.5px solid var(--border); border-radius: 6px;
    font-size: 0.75rem; font-weight: 600; text-align: right; font-family: inherit;
    background: var(--white); color: var(--text);
}
.split-table .st-input:focus { outline: none; border-color: var(--primary); }
.split-table .st-total { background: #f8f9fc; min-width: 76px; }
.split-table .st-total-val { font-weight: 700; font-size: 0.8rem; color: var(--text); }
/* /bsc 与 /bsc-edit 部门分拆表固定列宽（split-fixed 修饰类 + 总宽行内绑定 splitTableWidth）：table-layout fixed 下
   首行 th.st-ind 定指标列 180px、th.st-total 定 Σ 合计列 92px，剩余宽度在 月×部门 数据列间均分（=110px/列）；
   列多时总宽超出 .split-scroll（overflow-x:auto）→ 出横向滚动条、指标列 sticky 吸附不变；列少→列宽同样固定不拉伸 */
.split-table.split-fixed { table-layout: fixed; }
.split-table.split-fixed .st-ind { width: 180px; }
.split-table.split-fixed .st-total { width: 92px; }
/* 数据列加宽后格内输入框同步吃满（基础 .st-input 64px 在 110px 列里显得窄） */
.split-table.split-fixed .st-input { width: 88px; }
/* /bsc-edit 第二步「总目标」列：紧随 sticky 指标列（left=180px）同样吸附，横向滚动填分拆值时总目标始终可参照；
   仅 bsc-edit 分拆表使用（st-target 类），不影响 /bsc 详情等其他 split-table */
.split-table .st-target { position: sticky; left: 180px; z-index: 2; background: #f8f9fc; }
.split-table thead .st-target { z-index: 3; background: #f7f8fa; }
.split-table .st-target-val { font-weight: 700; font-size: 0.8rem; color: var(--text); }
.split-table.split-fixed .st-target { width: 92px; }
.bsc-edit .total-warn { color: var(--red); }
.months-empty {
    font-size: 0.8rem; color: var(--text-muted); background: #f8f9fc;
    border: 1px dashed var(--border); border-radius: 6px; padding: 14px;
    text-align: center; margin-bottom: 16px;
}
.total-warn-bar {
    font-size: 0.78rem; color: #b91c1c; background: #fef2f2;
    border: 1px solid #fecaca; border-radius: 6px; padding: 8px 12px; margin: -6px 0 16px;
}
.total-warn-bar b { margin: 0 8px 0 2px; font-weight: 600; }
/* 四层面卡片行：名称 | 目标输入 | 单位 | 注释（改善动作已去掉；输入字体偏小与整页一致） */
.bsc-edit .edit-row { grid-template-columns: minmax(0, 1.4fr) 80px 2.4em minmax(0, 1.7fr); }
.bsc-edit .edit-row .r-input { width: 100%; font-size: 0.75rem; padding: 3px 6px; }
.bsc-edit .r-unit { font-size: 0.72rem; color: var(--text-muted); }
.bsc-edit .r-note { font-size: 0.66rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bsc-edit .card-empty { font-size: 0.75rem; color: var(--text-muted); padding: 8px 0; text-align: center; }
/* 计算指标（type=calc）：只读格，随输入动态计算；与各作用域输入框同尺寸，
   展示样式与普通指标一致（白底黑字，不再置灰），仅保留 cursor:default 提示不可编辑 */
.split-page .calc-box {
    display: inline-flex; align-items: center; justify-content: flex-end;
    background: var(--white); border: 1.5px solid var(--border); border-radius: 8px;
    color: var(--text); font-weight: 600; cursor: default;
    box-sizing: border-box; min-height: 1.6em; text-align: right;
}

/* --- 个人目标分拆页（/personal-split）与经营数据录入页（/biz-data）：复用 .split-page 共享家族 + split-table 全局样式 --- */
/* 右上角筛选：项目时间弹层/日期 + 部门单选（挂在 .bsc-header 右上，类似 .bsc-version 定位） */
.split-page .ps-filters {
    position: absolute; top: 0; right: 0;
    display: flex; align-items: center; gap: 8px;
    font-size: 0.78rem; color: var(--text-secondary);
}
.split-page .ps-filters > span {
    background: #f7f8fa; padding: 2px 12px; border-radius: 4px; border: 1px solid var(--border);
}
/* 弹层靠右展开，避免超出页面右缘（仅个人目标分拆页有弹层；bsc-edit 保持基础居中，经营数据录入用原生日期框无弹层） */
.personal-split .meta-pop { left: auto; right: 0; transform: none; }
.split-page .ps-dept-select {
    border: none; background: transparent; font-family: inherit; font-size: 0.78rem;
    font-weight: 600; color: var(--text); cursor: pointer; max-width: 150px;
}
.split-page .ps-dept-select:focus { outline: none; }
/* 经营数据录入页：筛选已并入 pt-detail-head 右侧 mo-filters（chip 样式由 .biz-data-page .mo-filters 提供），
   这里保留部门整体汇总格（只读）与保存时间提示 */
.split-page .ps-saved { color: var(--text-muted); font-size: 0.72rem; border: none !important; background: transparent !important; padding: 0 !important; }
.biz-data .bd-dept-total { display: inline-block; min-width: 48px; font-weight: 700; font-size: 0.8rem; color: var(--text); }
.biz-data .bd-dept-total.empty { font-weight: 400; color: var(--text-muted); }
/* 指标括注里的日目标数字：黑色加粗（括注其余文字保持灰色小字） */
.biz-data .st-unit .goal-num { color: var(--text); font-weight: 700; }
/* 按周录入：周一 ~ 周日 7 个日区块，每日小标题（周X + 日期 + 今天徽章 + 该日保存时间）+ 独立 split-scroll 表格 */
.bd-day { margin-bottom: 18px; }
.bd-day-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.bd-day-name { font-size: 0.85rem; font-weight: 700; color: var(--text); }
.bd-day-date { font-size: 0.78rem; color: var(--text-secondary); }
.bd-day-today { font-size: 0.68rem; font-weight: 700; color: var(--primary); background: var(--primary-light); border-radius: 4px; padding: 1px 6px; }
.bd-day-saved { font-size: 0.7rem; color: var(--text-muted); margin-left: auto; }

/* --- 月份选择组件 month-picker（bsc-edit / personal-split 时间弹层内两联使用） --- */
.split-page .pop-col { display: flex; flex-direction: column; gap: 4px; }
.split-page .pop-cap { font-size: 0.72rem; color: var(--text-muted); text-align: center; }
.mp-wrap { width: 150px; }
.mp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; }
.mp-head b { font-size: 0.8rem; color: var(--text); }
.mp-nav {
    width: 20px; height: 20px; padding: 0; line-height: 1; cursor: pointer;
    border: 1px solid var(--border); border-radius: 4px; background: var(--white);
    color: var(--text-secondary); font-size: 0.85rem;
}
.mp-nav:hover { border-color: var(--primary); color: var(--primary); }
.mp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.mp-cell {
    padding: 4px 0; font-size: 0.72rem; font-family: inherit; cursor: pointer;
    border: 1px solid var(--border); border-radius: 5px; background: var(--white); color: var(--text);
}
.mp-cell:hover:not(.disabled):not(.active) { border-color: var(--primary); color: var(--primary); }
.mp-cell.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.mp-cell.disabled { background: #f3f4f6; color: var(--text-muted); opacity: 0.6; cursor: not-allowed; }

/* ===== Monitor Layout ===== */
.monitor-layout {
    display: grid; grid-template-columns: 1fr 340px; gap: 28px; align-items: start;
}
.monitor-left { min-width: 0; }
.monitor-right .section { margin-bottom: 0; }
.monitor-right { position: sticky; top: 20px; }

/* 进度概览部门切换（section-title 右侧 chip）：数据权限范围部门 + 全部部门 */
.monitor-dept-pick {
    margin-left: auto; display: flex; align-items: center; gap: 6px;
    font-size: 0.78rem; font-weight: 400; color: var(--text-secondary);
    background: #f7f8fa; padding: 2px 12px; border-radius: 4px; border: 1px solid var(--border);
}
.monitor-dept-pick select {
    border: none; background: transparent; font-family: inherit; font-size: 0.78rem;
    font-weight: 600; color: var(--text); cursor: pointer; max-width: 170px;
}
.monitor-dept-pick select:focus { outline: none; }

/* 首页 AI 每日诊断：问题诊断/优化建议 section-title 右侧来源标注小 chip（🤖 + 日期 / 生成中…） */
.diag-source {
    margin-left: auto; font-size: 0.72rem; font-weight: 500; color: var(--blue);
    background: var(--blue-bg); border-radius: 999px; padding: 2px 10px; white-space: nowrap;
}

.my-task-status {
    font-size: 0.72rem; font-weight: 600; padding: 3px 10px;
    border-radius: 20px;
}
.my-task-status.doing { background: #dbeafe; color: #2563eb; }
.my-task-status.pending { background: #fef3c7; color: #d97706; }
.my-task-status.done { background: #dcfce7; color: #16a34a; }

/* Quick Tools */
.quick-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.monitor-right .section + .section { margin-top: 28px; }
.quick-tool-item {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 16px; background: var(--white);
    border: 1px solid var(--border); border-radius: 10px;
    text-decoration: none; color: var(--text); font-size: 0.85rem; font-weight: 500;
    transition: all 0.15s;
}
.quick-tool-item:hover { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.qt-icon { font-size: 1.2rem; }

@media (max-width: 900px) {
    .monitor-layout { grid-template-columns: 1fr; }
}

/* ===== Monthly Accounting Page ===== */
.ma-tabs {
    display: flex; border-bottom: 2px solid var(--border); margin-bottom: 20px;
}
.ma-tab {
    padding: 10px 24px; font-size: 0.88rem; cursor: pointer;
    color: var(--text-muted); border-bottom: 2px solid transparent;
    margin-bottom: -2px; transition: all 0.2s; font-weight: 500;
}
.ma-tab:hover { color: var(--text); }
.ma-tab.active { color: var(--primary); font-weight: 600; border-bottom-color: var(--primary); }

.ma-table-wrap { overflow-x: auto; margin-bottom: 20px; }
.ma-table {
    width: 100%; border-collapse: collapse; font-size: 0.76rem;
    border: 1px solid var(--border); min-width: 900px;
}
.ma-table th {
    background: var(--bg); color: #1a2a5e; font-weight: 700;
    padding: 7px 8px; border: 1px solid var(--border);
    text-align: center; font-size: 0.74rem; white-space: nowrap;
}
.ma-table td {
    padding: 5px 8px; border: 1px solid var(--border);
    vertical-align: middle; font-size: 0.76rem;
}
.ma-table .th-name { text-align: left; min-width: 160px; }
.ma-table .th-no { width: 40px; }
.ma-table .th-total { background: #eef2f7; font-weight: 700; }
.ma-table .th-rule { text-align: left; min-width: 200px; color: var(--text-secondary); font-weight: 500; }

.ma-table .td-name { text-align: left; font-weight: 500; padding-left: 12px; color: var(--text); }
.ma-table .td-indent { padding-left: 28px; font-weight: 400; }
.ma-table .td-num { text-align: right; color: var(--text); white-space: nowrap; }
.ma-table .td-bold { font-weight: 700; }
.ma-table .td-total { background: #f8f9fc; font-weight: 700; }
.ma-table .td-rule { font-size: 0.7rem; color: var(--text-muted); text-align: left; padding-left: 8px; }
.ma-table .td-green { color: var(--text); font-weight: 600; }
.ma-table .td-red { color: #c0392b; font-weight: 600; }

.ma-table .ma-section-row td {
    background: #f0f2f7; font-weight: 700; color: #1a2a5e;
    text-align: left; padding: 8px 12px; font-size: 0.8rem;
}
.ma-table .ma-subtotal-row { background: #f8f9fc; }
.ma-table .ma-subtotal-row td { font-weight: 700; }
.ma-table .ma-result-row td {
    background: #f8f9fc; font-weight: 700; color: #1a2a5e;
}
.ma-table .ma-info-row td { background: #f8f9fc; }

.branch-table .td-name { min-width: 140px; }

/* ===== Tasks Page ===== */
.tasks-toolbar {
    display: flex; align-items: center; gap: 16px; margin-bottom: 16px; flex-wrap: wrap;
}
.tasks-search {
    flex: 0 0 240px; padding: 7px 12px; border: 1px solid var(--border);
    border-radius: 6px; font-size: 0.82rem; outline: none;
    transition: border-color 0.2s;
}
.tasks-search:focus { border-color: var(--primary); }
.tasks-filters { display: flex; gap: 8px; }
.filter-btn {
    padding: 5px 14px; border-radius: 16px; border: 1px solid var(--border);
    background: #fff; color: var(--text-muted); font-size: 0.78rem;
    cursor: pointer; transition: all 0.2s; font-weight: 500;
}
.filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.filter-btn.active {
    background: var(--primary); color: #fff; border-color: var(--primary);
}

.tasks-table-wrap { overflow-x: auto; margin-bottom: 16px; }
.tasks-table {
    width: 100%; border-collapse: collapse; font-size: 0.8rem;
    border: 1px solid var(--border);
}
.tasks-table th {
    background: var(--bg); color: #1a2a5e; font-weight: 700;
    padding: 8px 12px; border: 1px solid var(--border);
    text-align: center; font-size: 0.76rem; white-space: nowrap;
}
.tasks-table td {
    padding: 7px 12px; border: 1px solid var(--border);
    font-size: 0.8rem; color: var(--text);
}
.tasks-table .th-no { width: 50px; }
.tasks-table .th-name { text-align: left; min-width: 200px; }
.tasks-table .td-name { text-align: left; font-weight: 500; }
.tasks-table .td-center { text-align: center; }
.tasks-table .td-empty { text-align: center; color: var(--text-muted); padding: 32px 0; }

.priority-tag {
    display: inline-block; padding: 2px 10px; border-radius: 10px;
    font-size: 0.72rem; font-weight: 600;
}
.priority-high { background: #fef2f2; color: #dc2626; }
.priority-medium { background: #fffbeb; color: #d97706; }
.priority-low { background: #f0fdf4; color: #16a34a; }

.tasks-pagination {
    display: flex; align-items: center; justify-content: center; gap: 16px;
    padding: 8px 0;
}
.page-btn {
    padding: 5px 14px; border-radius: 6px; border: 1px solid var(--border);
    background: #fff; color: var(--text); font-size: 0.78rem;
    cursor: pointer; transition: all 0.2s;
}
.page-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.page-info { font-size: 0.78rem; color: var(--text-muted); }

/* ===== Indicators Page ===== */
/* 页面已改 monthly 同款：pt-page 全宽 + pt-detail 外框 + pt-detail-head 表头 + month-table 表格 */
.ind-filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
/* 原 .tasks-table 作用域的单元格样式，换 month-table 后在 .indicators-table 下补齐 */
.indicators-table .th-no { width: 50px; }
.indicators-table .th-name { text-align: left; min-width: 200px; }
.indicators-table .td-name { text-align: left; font-weight: 500; }
.indicators-table td.td-no { text-align: right; }
.indicators-table .td-empty { padding: 32px 0; }
.indicators-table .td-formula {
    font-size: 0.74rem; color: var(--text-secondary); text-align: left;
}
.indicators-table .td-desc {
    font-size: 0.74rem; color: var(--text-muted); text-align: left;
    line-height: 1.5;
}
.cat-tag {
    display: inline-block; padding: 2px 10px; border-radius: 10px;
    font-size: 0.72rem; font-weight: 600; white-space: nowrap;
}
.cat-finance { background: #eff6ff; color: #2563eb; }
.cat-customer { background: #fef3c7; color: #d97706; }
.cat-process { background: #f0fdf4; color: #16a34a; }
.cat-learn { background: #fdf2f8; color: #db2777; }

/* ===== Indicators Page CRUD ===== */
.type-base { background: var(--blue-bg); color: var(--blue); }
.type-calc { background: #fdf2f8; color: #db2777; }
.polarity-pos { background: var(--green-bg); color: #16a34a; }
.polarity-neg { background: var(--red-bg); color: #dc2626; }
.ind-add-btn { margin-left: auto; white-space: nowrap; }
.ind-row-actions { justify-content: center; }
.dialog-box.ind-dialog { width: 560px; }
.ind-form-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.ind-form-row.ind-form-2col { grid-template-columns: 1fr 1fr; }
/* 数值格式：小数/百分数 的小数位数输入行 */
.ind-scale-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.ind-scale-label { font-size: 0.78rem; color: var(--text-secondary); white-space: nowrap; }
.ind-scale-input {
    width: 64px; padding: 4px 8px;
    border: 1px solid var(--border); border-radius: 6px;
    font-size: 0.8rem; color: var(--text);
}
.ind-scale-input:focus { outline: none; border-color: var(--primary); }
.ind-scale-hint { font-size: 0.74rem; color: var(--text-muted); }
.td-format { font-size: 12px; color: var(--gray, #6b7280); }
/* 图标选择器：常用图标点选，选中高亮 */
.icon-picker { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; }
.icon-pick {
    display: flex; align-items: center; justify-content: center;
    height: 34px; padding: 0; font-size: 18px; line-height: 1;
    background: #fff; border: 1px solid #e5e7eb; border-radius: 6px;
    cursor: pointer; transition: border-color .15s, background .15s;
}
.icon-pick:hover { border-color: var(--blue); }
.icon-pick.active { border-color: var(--blue); background: var(--blue-bg); box-shadow: 0 0 0 1px var(--blue) inset; }
/* 单选组：正/负类型（带释义）、指标类型
   注意：.form-group label / .form-group input 的全局样式会作用到单选项上，
   这里用更高优先级覆盖（label 需保持 flex 行内排布、radio 不能被拉成整宽输入框） */
.radio-group { display: flex; flex-direction: column; gap: 8px; }
.radio-group.radio-inline { flex-direction: row; gap: 20px; }
.form-group label.radio-item {
    display: flex; align-items: baseline; gap: 6px;
    margin-bottom: 0; font-weight: normal; cursor: pointer;
}
.form-group .radio-item input[type="radio"] {
    width: auto; margin: 0; padding: 0; border: none; border-radius: 0;
    accent-color: var(--blue); cursor: pointer;
}
.radio-label { font-size: 13px; color: #111827; }
.radio-hint { font-size: 12px; color: #9ca3af; }

/* ===== Monthly Page Editable ===== */
.month-actual-input {
    width: 56px; padding: 2px 4px; border: 1px solid var(--border);
    border-radius: 4px; font-size: 0.76rem; text-align: right;
    outline: none; background: #fff; transition: border-color 0.2s;
}
.month-actual-input:focus { border-color: var(--primary); }
.month-unit { font-size: 0.72rem; font-weight: 400; color: var(--text-muted); margin-left: 3px; }
/* 表格数值后的单位小字（分拆二维表只读格 / Σ合计 / 部门整体汇总格等） */
.cell-unit { font-size: 0.66rem; font-weight: 400; color: var(--text-muted); margin-left: 1px; }
.month-table .diff-pos { color: #dc2626; font-weight: 600; }
.month-table .diff-neg { color: #16a34a; font-weight: 600; }
/* monthly 页月度经营分析表：达成率 ≥100% 绿 / <100% 红（负向指标已按达标方向反转；budget 预览表不受影响） */
.monthly-page .month-table .rate-good { color: var(--green); font-weight: 700; }
.monthly-page .month-table .rate-bad { color: var(--red); font-weight: 700; }

/* ===== PHC Page（人货场梳理与挖掘） ===== */
.phc-header-title { display: flex; align-items: center; font-size: 0.9rem; font-weight: 600; color: var(--text); }
.phc-container { padding: 4px 0; }
.phc-products { display: flex; flex-direction: column; gap: 20px; margin-top: 20px; }

/* 货品区块 */
.phc-product-card { background: var(--white); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.phc-product-header {
    display: flex; align-items: center; gap: 14px; padding: 16px 20px;
    background: #fafbff; border-bottom: 1px solid var(--border-light);
}
.phc-product-icon {
    width: 44px; height: 44px; border-radius: 12px; background: var(--white);
    border: 1px solid var(--border-light);
    display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0;
}
.phc-product-info { flex: 1; min-width: 0; }
.phc-product-name { font-size: 1rem; font-weight: 600; color: var(--text); }
.phc-product-body { padding: 20px; display: flex; flex-direction: column; gap: 22px; }

/* 画像旅程 markdown 渲染（客户画像 + 5A 客户旅程表格） */
.phc-markdown { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.7; min-width: 0; }
.phc-markdown h1, .phc-markdown h2, .phc-markdown h3 { color: var(--text); margin: 18px 0 10px; line-height: 1.4; }
.phc-markdown h1 { font-size: 1rem; }
.phc-markdown h2 { font-size: 0.95rem; padding-bottom: 6px; border-bottom: 1px solid var(--border-light); }
.phc-markdown h3 { font-size: 0.88rem; }
.phc-markdown > :first-child { margin-top: 0; }
.phc-markdown p { margin: 8px 0; }
.phc-markdown ul, .phc-markdown ol { margin: 8px 0; padding-left: 22px; }
.phc-markdown li { margin: 4px 0; }
.phc-markdown strong { color: var(--text); }
.phc-markdown code {
    font-size: 0.75rem; color: var(--primary); background: var(--primary-light);
    border-radius: 4px; padding: 1px 6px; margin-right: 4px;
}
.phc-markdown blockquote {
    margin: 8px 0; padding: 6px 12px; border-left: 3px solid var(--primary);
    background: #fafafa; border-radius: 0 8px 8px 0; color: var(--text-muted); font-size: 0.8rem;
}
.phc-markdown table {
    display: block; overflow-x: auto; max-width: 100%;   /* 宽表内部滚动，不撑破页面 */
    border-collapse: collapse; margin: 10px 0; font-size: 0.8rem;
}
.phc-markdown th, .phc-markdown td {
    border: 1px solid var(--border-light); padding: 8px 10px;
    text-align: left; vertical-align: top; min-width: 90px;
}
.phc-markdown th { background: #fafbff; color: var(--text); font-weight: 600; white-space: nowrap; }
.phc-markdown tr:nth-child(even) td { background: #fcfcfd; }
.phc-markdown hr { border: none; border-top: 1px solid var(--border-light); margin: 14px 0; }
.phc-markdown h4 { font-size: 0.85rem; color: var(--text); margin: 12px 0 6px; line-height: 1.4; }

/* phc 聊天气泡内的 markdown（ai 消息）：标题紧凑、恢复正常换行流
   （.message-row.ai .msg-content 是 pre-wrap，会把 marked 输出里的换行渲染成大段空白） */
.msg-markdown { white-space: normal; }
.msg-markdown h1, .msg-markdown h2, .msg-markdown h3, .msg-markdown h4 { margin: 10px 0 6px; }
.msg-markdown h1 { font-size: 0.98rem; }
.msg-markdown h2 { padding-bottom: 4px; }

@media (max-width: 900px) {
    .phc-product-header { flex-wrap: wrap; }
    .phc-markdown th, .phc-markdown td { min-width: 72px; padding: 6px 8px; }
}

/* PHC 历史按钮与弹窗 */
.tab-action-btn.history { background: var(--white); color: var(--text-secondary); }
.tab-action-btn.history:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.phc-modal-mask {
    position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); z-index: 100;
    display: flex; align-items: center; justify-content: center;
}
.phc-modal {
    width: 440px; max-width: 92vw; max-height: 72vh;
    display: flex; flex-direction: column; overflow: hidden;
    background: var(--white); border-radius: 14px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}
.phc-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px; border-bottom: 1px solid var(--border-light);
    font-size: 0.9rem; font-weight: 600; color: var(--text); flex-shrink: 0;
}
.phc-modal-close {
    background: none; border: none; cursor: pointer; color: var(--text-muted);
    font-size: 14px; padding: 4px 8px; border-radius: 6px; transition: all 0.15s;
}
.phc-modal-close:hover { background: var(--primary-light); color: var(--primary); }
.phc-modal-body { overflow-y: auto; padding: 12px; }
.phc-modal-body .history-empty { min-height: 160px; }

/* PHC 版本化：版本徽标、最新标识、操作提示 */
.phc-version-chip {
    margin-left: 10px; padding: 2px 10px; border-radius: 999px;
    background: var(--primary-light); color: var(--primary);
    font-size: 0.72rem; font-weight: 600; vertical-align: middle;
}
.phc-version-chip.demo { background: var(--border-light); color: var(--text-secondary); }
.phc-version-chip.draft { background: #fff3e0; color: #e65100; }
.history-latest-badge {
    padding: 2px 8px; border-radius: 999px;
    background: var(--primary); color: #fff; font-size: 0.68rem; font-weight: 600;
}
.history-draft-badge {
    padding: 2px 8px; border-radius: 999px;
    background: #fff3e0; color: #e65100; font-size: 0.68rem; font-weight: 600;
}
.draft-prompt-tip { font-size: 0.8rem; color: var(--text-secondary); margin: 2px 0 10px; }
.draft-fresh-btn {
    display: block; width: 100%; margin-top: 12px; padding: 10px 0;
    border: 2px solid var(--primary); border-radius: 8px; background: var(--white); color: var(--primary);
    font-size: 0.85rem; font-weight: 700; cursor: pointer; transition: background 0.15s;
}
.draft-fresh-btn:hover { background: var(--primary-light); }
.history-item.active { border-color: var(--primary); background: var(--primary-light); }
.phc-toast {
    position: fixed; top: 24px; left: 50%; transform: translateX(-50%);
    padding: 8px 18px; border-radius: 999px; z-index: 300;
    background: rgba(30, 30, 30, 0.88); color: #fff;
    font-size: 0.82rem; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

/* --- budget tab0 挂 .pt-view KPI 卡片蓝框：卡内可编辑 num-input 伪装成只读大数字（保留虚线下划线提示可编辑） --- */
.budget-bsc .bsc-summary-item .num-line.num-summary {
    justify-content: flex-start; align-items: baseline; gap: 3px;
    margin-top: 0; line-height: 1.35; white-space: nowrap;
}
.budget-bsc .bsc-summary-item .num-summary > span { font-size: 0.68rem; font-weight: 500; color: var(--text-muted); }
.budget-bsc .bsc-summary-item .num-input {
    font-size: 1.05rem; font-weight: 700; color: var(--text);
    text-align: left; border-bottom: 1px dashed var(--border);
}

/* --- budget 企业经营计划表：区块绑定指标编辑（总览/月度指标编辑条 + 层面卡头按钮 + 指标库多选弹层） --- */
.bsc-block-bar {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 6px;
}
.bsc-block-title { font-size: 0.82rem; font-weight: 700; color: var(--text); }
.bind-edit-btn {
    background: var(--white); border: 1px solid var(--border); border-radius: 999px;
    padding: 2px 10px; font-size: 0.7rem; color: var(--text-secondary);
    cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.bind-edit-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
/* 四层面卡头（彩色底）里的按钮：半透明白，悬停反白 */
.bsc-card-header .bind-edit-btn {
    background: rgba(255, 255, 255, 0.18); border-color: rgba(255, 255, 255, 0.55); color: #fff;
}
.bsc-card-header .bind-edit-btn:hover { background: #fff; border-color: #fff; color: var(--text); }
.bch-right { display: flex; align-items: center; gap: 8px; }
.bind-modal { width: 480px; }
.bind-list { display: flex; flex-direction: column; gap: 4px; max-height: 46vh; overflow-y: auto; }
.bind-item {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px;
    font-size: 0.8rem; cursor: pointer; transition: border-color 0.12s, background 0.12s;
}
.bind-item:hover { border-color: var(--primary); }
.bind-item.on { border-color: var(--primary); background: var(--primary-light); }
.bind-item input[type="checkbox"] { accent-color: var(--primary); }
/* 拖动排序：整行可拖，拖动中半透明，悬停目标行顶部显示插入指示线 */
.bind-item.dragging { opacity: 0.45; }
.bind-item.drag-over { box-shadow: inset 0 2px 0 var(--primary); }
.bind-grip {
    cursor: move; color: var(--text-muted); font-size: 0.85rem; line-height: 1;
    user-select: none; -webkit-user-select: none;
}
.bind-order {
    min-width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0;
    background: var(--primary); color: #fff;
    font-size: 0.66rem; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
}
.bind-name { font-weight: 600; color: var(--text); }
.bind-badge {
    font-size: 0.64rem; padding: 1px 7px; border-radius: 999px;
    background: #f1f3f6; color: var(--text-secondary); white-space: nowrap;
}
.bind-badge.calc { background: #ede7f6; color: #7e57c2; }
.bind-unit { margin-left: auto; font-size: 0.7rem; color: var(--text-muted); }
.bind-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.bind-actions button {
    padding: 7px 18px; border-radius: 8px; font-size: 0.82rem; font-weight: 600; cursor: pointer;
    border: 1px solid var(--border); background: var(--white); color: var(--text-secondary);
    transition: all 0.15s;
}
.bind-actions button:hover { border-color: var(--primary); color: var(--primary); }
.bind-actions .bind-ok { background: var(--primary); border-color: var(--primary); color: #fff; }
.bind-actions .bind-ok:hover { opacity: 0.88; color: #fff; }

/* ===== AI Assistant Page（小盈AI助手） ===== */
.main-content.ai-page { max-width: none; }
/* 卡片外框：与 monthly 等页同款 pt-detail；定高吸附视口，头部固定、聊天区在卡片内滚动 */
.ai-page .pt-detail.ai-detail {
    display: flex; flex-direction: column;
    position: sticky; top: 80px; height: calc(100vh - 108px);
    min-height: 0;
}
.ai-layout { flex: 1; min-height: 0; display: flex; }
.ai-chat-side { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.ai-chat-area { min-height: 200px; flex: 1; overflow-y: auto; padding: 10px 4px 18px; display: flex; flex-direction: column; gap: 24px; }
.ai-history-tip { flex-shrink: 0; text-align: center; font-size: 0.75rem; color: #9aa0ab; padding: 2px 0; }
.ai-msg.user { display: flex; justify-content: flex-end; }
.ai-msg.user .msg-content { background: var(--user-msg-bg); color: var(--user-msg-color); padding: 10px 16px; border-radius: 16px; max-width: 72%; font-size: 0.9rem; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.ai-msg-head { display: flex; align-items: center; gap: 10px; }
.ai-msg-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--primary-light); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.ai-msg-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.ai-msg-name { font-size: 0.95rem; font-weight: 600; color: var(--text); }
.ai-msg-status { margin: 10px 0 6px; font-size: 0.78rem; color: var(--text-muted); }
.ai-msg-status .chev { color: var(--text-muted); }
.ai-msg-body { font-size: 0.92rem; color: var(--text); line-height: 1.8; white-space: pre-wrap; word-break: break-word; }
.ai-msg-actions { display: flex; align-items: center; gap: 4px; margin-top: 10px; }
.ai-act { background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 5px; border-radius: 6px; display: flex; align-items: center; transition: all 0.15s; }
.ai-act:hover { background: var(--bg); color: var(--text); }
.ai-act.on { color: var(--primary); }
.ai-act svg { width: 15px; height: 15px; }
.ai-msg-time { margin-left: auto; font-size: 0.75rem; color: var(--text-muted); }
.ai-input-card { background: var(--white); border: 1px solid var(--border); border-radius: 16px; padding: 12px 14px; box-shadow: 0 2px 10px rgba(0,0,0,0.04); margin-bottom: 8px; transition: border-color 0.15s, box-shadow 0.15s; }
/* 聚焦时主色描边+浅蓝光环（同系统输入聚焦风格） */
.ai-input-card:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.ai-input-box { width: 100%; border: none; outline: none; resize: none; background: transparent; font-family: inherit; font-size: 0.92rem; line-height: 1.6; max-height: 140px; color: var(--text); }
.ai-input-box::placeholder { color: #b8b8b8; }
.ai-input-bar { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; gap: 10px; }
.ai-input-left { display: flex; align-items: center; min-width: 0; }
.ai-input-hint { font-size: 0.78rem; color: var(--text-muted); }
.ai-send-round { width: 38px; height: 38px; border-radius: 50%; border: none; background: var(--primary); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.15s; flex-shrink: 0; }
.ai-send-round:hover:not(:disabled) { background: var(--primary-hover); }
.ai-send-round:disabled { background: #c9d2f7; cursor: not-allowed; }
.ai-send-round svg { width: 17px; height: 17px; }
/* AI 回复 markdown 渲染（marked GFM）：覆盖气泡 pre-wrap，排版标题/列表/表格/代码块 */
.ai-msg-md { white-space: normal; }
.ai-msg-md > :first-child { margin-top: 0; }
.ai-msg-md > :last-child { margin-bottom: 0; }
/* 流式输出中：正文末尾跟随闪烁光标（done/error 后 streaming 类移除即消失） */
.ai-msg-md.streaming::after { content: '▍'; color: var(--primary); margin-left: 2px; animation: ai-caret-blink 0.9s steps(1) infinite; }
@keyframes ai-caret-blink { 50% { opacity: 0; } }
/* 小盈AI-总结逐字输出（monthly/weekly 注解面板）：与 /ai 流式同款闪烁光标 */
.mo-note-md.streaming::after { content: '▍'; color: var(--primary); margin-left: 2px; animation: ai-caret-blink 0.9s steps(1) infinite; }
.week-note .tw-caret { display: inline-block; width: 2px; height: 1em; margin-left: 2px; vertical-align: text-bottom; background: var(--primary); animation: ai-caret-blink 0.9s steps(1) infinite; }
.ai-msg-md h1, .ai-msg-md h2, .ai-msg-md h3, .ai-msg-md h4 { margin: 14px 0 8px; line-height: 1.4; color: var(--text); }
.ai-msg-md h1 { font-size: 1.15rem; }
.ai-msg-md h2 { font-size: 1.05rem; }
.ai-msg-md h3 { font-size: 0.98rem; }
.ai-msg-md h4 { font-size: 0.92rem; }
.ai-msg-md p { margin: 8px 0; }
.ai-msg-md ul, .ai-msg-md ol { margin: 8px 0; padding-left: 22px; }
.ai-msg-md li { margin: 4px 0; }
.ai-msg-md blockquote {
    margin: 8px 0; padding: 6px 12px; border-left: 3px solid var(--primary);
    background: var(--primary-light); border-radius: 0 8px 8px 0; color: var(--text-secondary);
}
.ai-msg-md code {
    background: #f2f3f7; border-radius: 4px; padding: 1px 5px; font-size: 0.85em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.ai-msg-md pre { background: #f6f7f9; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; overflow-x: auto; margin: 8px 0; }
.ai-msg-md pre code { background: none; padding: 0; }
.ai-msg-md table { border-collapse: collapse; margin: 10px 0; width: 100%; font-size: 0.85rem; }
.ai-msg-md th, .ai-msg-md td { border: 1px solid var(--border); padding: 5px 9px; text-align: left; }
.ai-msg-md th { background: #f7f8fa; font-weight: 600; }
.ai-msg-md hr { border: none; border-top: 1px solid var(--border); margin: 12px 0; }
.ai-msg-md a { color: var(--primary); }
@media (max-width: 900px) {
    .ai-page .pt-detail.ai-detail { position: static; height: auto; }
    .ai-chat-area { flex: none; max-height: 46vh; }
}

/* ===== 小盈AI-总结和建议（/weekly 页）：表头筛选行按钮 + 页面右侧注解框 ===== */
.week-ai-sum-btn {
    background: var(--primary); color: #fff; border: none;
    border-radius: 8px; padding: 5px 12px;
    font-size: 0.76rem; font-weight: 500; font-family: inherit;
    cursor: pointer; transition: background 0.2s; white-space: nowrap;
}
.week-ai-sum-btn:hover:not(:disabled) { background: var(--primary-hover); }
.week-ai-sum-btn:disabled { opacity: 0.6; cursor: not-allowed; }
/* 表头右侧可点击 chip（周次选择器，兼作日历弹层定位锚点；weekly 与 biz-data 按周录入两处共用，
   作用域限定 .week-filters/.bd-filters，避免影响 bsc-edit 同名 .meta-pick） */
.week-filters .meta-pick, .bd-filters .meta-pick { position: relative; cursor: pointer; user-select: none; transition: all 0.15s; }
.week-filters .meta-pick:hover, .week-filters .meta-pick.on,
.bd-filters .meta-pick:hover, .bd-filters .meta-pick.on {
    background: var(--primary-light); border-color: var(--primary); color: var(--primary);
}
/* 周选择面板：月份翻页 + 日期网格日历（点击日期选中所在周） */
.week-pick-pop {
    position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%);
    z-index: 600; width: 268px; background: var(--white);
    border: 1px solid var(--border); border-radius: 10px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.16);
    padding: 10px 12px 10px; text-align: center;
}
/* .bsc-meta span 的 chip 样式（背景/边框/左右 12px 内边距）会命中面板内所有 span，
   把网格撑出面板；这里显式重置，再由各自规则恢复 */
.week-pick-pop span { background: none; border: none; padding: 0; }
.week-pick-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.week-pick-title { font-size: 0.85rem; font-weight: 700; color: var(--text); }
.week-pick-nav {
    background: var(--white); border: 1px solid var(--border); border-radius: 5px;
    cursor: pointer; color: var(--text-secondary); font-size: 0.85rem;
    padding: 1px 10px; line-height: 1.3; font-family: inherit; transition: all 0.15s;
}
.week-pick-nav:hover { border-color: var(--primary); color: var(--primary); }
.week-pick-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.week-pick-pop .wp-dow { font-size: 0.68rem; color: var(--text-muted); padding: 3px 0; }
.wp-cell {
    font-size: 0.74rem; padding: 4px 0; border-radius: 5px; cursor: pointer;
    color: var(--text); background: none; border: none; font-family: inherit; transition: background 0.12s;
}
.wp-cell.out { color: #c6cad2; }
.wp-cell.in-week { background: var(--primary-light); color: var(--primary); font-weight: 700; }
.wp-cell.today { box-shadow: inset 0 0 0 1px var(--primary); }
.wp-cell:hover { background: var(--primary); color: #fff; }
.week-pick-foot { margin-top: 8px; display: flex; justify-content: space-between; align-items: center; }
.week-pick-back {
    background: none; border: none; color: var(--primary); font-size: 0.75rem;
    cursor: pointer; font-family: inherit; padding: 2px 4px;
}
.week-pick-back:hover { text-decoration: underline; }
.week-pick-hint { font-size: 0.68rem; color: var(--text-muted); }
/* 月度目标承接空态 */
.month-ref-empty { font-size: 0.75rem; color: var(--text-muted); }
.week-note {
    position: fixed; top: 84px; right: 16px; z-index: 700;
    width: 420px; max-width: calc(100vw - 32px);
    max-height: calc(100vh - 108px); overflow-y: auto;
    background: var(--white); border: 1px solid var(--border);
    border-left: 3px solid var(--primary); border-radius: 8px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.14);
    padding: 12px 14px;
}
/* 注解框展开时页面主区左移让位（右边距 = 框宽 420 + 右缘 16 + 间隙 24），关闭后还原，不与内容重叠 */
.main-content.note-open { margin-right: 460px; margin-left: auto; }
.week-note-head { display: flex; align-items: center; margin-bottom: 8px; }
.week-note-title { font-size: 0.88rem; font-weight: 700; color: var(--primary); }
.week-note-close {
    margin-left: auto; background: none; border: none; cursor: pointer;
    color: var(--text-muted); font-size: 0.95rem; line-height: 1;
    padding: 3px 6px; border-radius: 5px; transition: all 0.15s;
}
.week-note-close:hover { background: var(--bg); color: var(--text); }
.week-note-loading {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.82rem; color: var(--text-muted); padding: 8px 0;
}
.week-note-error { font-size: 0.82rem; color: var(--red); padding: 6px 0; }
.week-note-talk {
    font-size: 0.84rem; color: var(--text); line-height: 1.7;
    padding: 7px 10px; background: var(--primary-light);
    border-radius: 6px; margin-bottom: 4px;
}
.week-note-sec { padding: 8px 0 2px; border-top: 1px dashed var(--border); margin-top: 8px; }
.week-note-sec:first-of-type { border-top: none; margin-top: 4px; }
.week-note-empty { font-size: 0.8rem; color: var(--text-muted); padding: 6px 0; line-height: 1.6; }
@media (max-width: 900px) {
    .week-ai-sum-btn { position: static; margin-top: 4px; transform: none; }
    .week-note { top: auto; bottom: 16px; right: 16px; max-height: 60vh; }
    .main-content.note-open { margin-right: auto; }
}

/* monthly 小盈AI-总结和建议注解框：复用 .week-note 骨架，正文为 markdown（复用 .phc-markdown），
   仅微调字号与标题间距适配窄面板 */
.mo-note-md { font-size: 0.84rem; color: var(--text); }
.mo-note-md h1, .mo-note-md h2, .mo-note-md h3, .mo-note-md h4 { margin: 12px 0 6px; }
.mo-note-md p { margin: 6px 0; }
.mo-note-md ul, .mo-note-md ol { margin: 6px 0; padding-left: 20px; }

/* 画像旅程导航：旅程暂未梳理时的空态提示 */
.phc-journey-empty {
    padding: 14px; border: 1px dashed var(--border); border-radius: 10px;
    color: var(--text-secondary); font-size: 0.8rem; text-align: center;
}

/* ===== /bsc 项目目标：左列表 + 右详情（数据源 t_project_target） ===== */
.main-content.pt-page { max-width: none; }   /* /bsc 全宽铺满屏幕 */
.pt-split {
    display: grid; grid-template-columns: 300px 1fr;
    gap: 16px; align-items: start;
}

/* 左：列表侧栏 */
.pt-side {
    background: var(--white); border: 1px solid var(--border); border-radius: 12px;
    max-height: calc(100vh - 160px); overflow-y: auto;
}
.pt-side-head {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 14px 16px; border-bottom: 1px solid var(--border-light);
    position: sticky; top: 0; background: var(--white); z-index: 1;
}
.pt-side-title { font-size: 0.92rem; font-weight: 600; color: var(--text); }
.pt-side-list { display: flex; flex-direction: column; gap: 10px; padding: 12px; }
.pt-item {
    border: 1px solid var(--border); border-radius: 10px;
    padding: 12px 14px; cursor: pointer;
    display: flex; flex-direction: column; gap: 8px;
    transition: border-color 0.2s, background 0.2s;
}
.pt-item:hover { border-color: var(--primary); }
.pt-item.active { border-color: var(--primary); background: var(--primary-light); }
.pt-item-period { font-size: 0.88rem; font-weight: 600; color: var(--text); }
.pt-item-time { font-size: 0.72rem; color: var(--text-muted); }
.pt-side-empty {
    padding: 40px 16px; text-align: center;
    font-size: 0.82rem; color: var(--text-muted); line-height: 1.8;
}

/* 右：详情面板 */
.pt-detail {
    background: var(--white); border: 1px solid var(--border); border-radius: 12px;
    padding: 20px 22px; min-height: 320px;
}
.pt-detail-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 12px; flex-wrap: wrap; margin-bottom: 12px;
}
.pt-detail-title { font-size: 1.02rem; font-weight: 600; color: var(--text); }
.pt-detail-meta {
    display: flex; align-items: center; gap: 10px; margin-top: 6px;
    font-size: 0.75rem; color: var(--text-muted);
}
.pt-detail-actions { display: flex; gap: 8px; }
.pt-detail-depts { margin-bottom: 4px; }
/* 详情只读态（.pt-view）：复用 .bsc-edit/.split-page 作用域版面，input 换成文本 */
.pt-view { margin-top: 14px; }
.pt-view .ro-text {
    display: inline-block; min-width: 64px; text-align: center;
    font-weight: 700; font-size: 0.8rem; color: var(--text);
}
.pt-view .ro-text.empty { color: var(--text-muted); font-weight: 400; }
.pt-view .sum-in-row .ro-text { min-width: 84px; font-size: 0.95rem; }
.pt-view .edit-row .ro-text { width: 100%; min-width: 0; font-size: 0.75rem; text-align: right; }
.pt-view .ro-empty { color: var(--text-muted); }
/* 部门分拆表数值加粗（单位小字 .cell-unit 自带常规字重不受影响；空值 — 保持常规） */
.pt-view .split-table td:not(.st-ind):not([colspan]) { font-weight: 700; }
.pt-view .split-table .ro-empty { font-weight: 400; }
/* 分月卡片（与 budget 页 .bsc-months 同款版面）：列数自适应项目月份数 + 末张合计卡；浏览态数值为只读文本 */
.pt-view .bsc-months { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 14px; }
.pt-view .bsc-month-item .num-val.empty { color: var(--text-muted); font-weight: 400; }
/* bsc 页分月卡片 sub 指标：数字黑色加粗（前缀标签/单位保持灰色小字），空值仍置灰 */
.pt-view .bsc-month-item .num-detail .num-val:not(.empty) { color: var(--text); font-weight: 700; }
/* bsc 页整体指标蓝框：与 monthly 看板 .month-dashboard.kpi-cards 同款 KPI 卡片
   （独立圆角卡+顶部彩条按序轮换+hover 上浮；卡内为只读文本：标签小字 + 总目标数字放大加粗） */
.pt-view .bsc-summary {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px; border: none; border-radius: 0; overflow: visible;
    margin-bottom: 14px;
}
.pt-view .bsc-summary-item {
    position: relative; overflow: hidden;
    display: flex; flex-direction: column; gap: 3px;
    padding: 11px 14px 10px; text-align: left;
    background: var(--white); border: 1px solid var(--border); border-radius: 10px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.pt-view .bsc-summary-item::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: var(--dash-accent, var(--primary));
}
.pt-view .bsc-summary-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(16, 24, 40, 0.10);
    border-color: var(--dash-accent, var(--primary));
}
.pt-view .bsc-summary-item:nth-child(5n+1) { --dash-accent: var(--red); }
.pt-view .bsc-summary-item:nth-child(5n+2) { --dash-accent: var(--orange); }
.pt-view .bsc-summary-item:nth-child(5n+3) { --dash-accent: var(--green); }
.pt-view .bsc-summary-item:nth-child(5n+4) { --dash-accent: var(--blue); }
.pt-view .bsc-summary-item:nth-child(5n+5) { --dash-accent: #8e44ad; }
.pt-view .bsc-summary-item .label {
    display: block; font-size: 0.72rem; font-weight: 600; color: var(--text-secondary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pt-view .bsc-summary-item .sum-in-row {
    justify-content: flex-start; align-items: baseline; gap: 3px; margin-top: 0;
    white-space: nowrap; line-height: 1.35;
}
.pt-view .bsc-summary-item .sum-in-row .ro-text {
    min-width: 0; font-size: 1.1rem; font-weight: 700; color: var(--text); text-align: left;
}
.pt-view .bsc-summary-item .sum-in-row .ro-text.empty { color: var(--text-muted); font-weight: 400; }
.pt-view .bsc-summary-item .unit-out { font-size: 0.68rem; font-weight: 500; color: var(--text-muted); }
.pt-view .split-head { margin-top: 4px; }
.pt-detail-empty {
    text-align: center; padding: 72px 20px; color: var(--text-muted); font-size: 0.85rem;
}
.pt-empty-icon { font-size: 2rem; margin-bottom: 10px; }
.pt-detail-empty p { margin: 0 0 6px; font-size: 0.92rem; color: var(--text-secondary); }
.pt-detail-empty small { display: block; font-size: 0.78rem; }
.pt-ver {
    font-size: 0.72rem; color: var(--primary); background: var(--primary-light);
    border-radius: 6px; padding: 2px 8px; white-space: nowrap;
}
.pt-ver.preset { color: var(--text-muted); background: #f0f0f0; }
.pt-depts { display: flex; flex-wrap: wrap; gap: 6px; }
.pt-dept {
    font-size: 0.75rem; color: var(--text-secondary);
    background: #f5f5f5; border: 1px solid var(--border-light);
    border-radius: 6px; padding: 3px 9px;
}
@media (max-width: 900px) {
    .pt-split { grid-template-columns: 1fr; }
    .pt-side { max-height: 320px; }
}

/* 删除的强烈二次确认弹窗 */
.pt-delete-box { width: 420px; text-align: center; }
.pt-delete-icon { font-size: 2.2rem; line-height: 1; margin-bottom: 10px; }
.pt-delete-title { color: var(--red); margin-bottom: 14px; }
.pt-delete-info {
    background: #f5f5f5; border-radius: 10px;
    padding: 12px 14px; margin-bottom: 12px;
}
.pt-delete-period { font-weight: 600; font-size: 0.9rem; color: var(--text); }
.pt-delete-info .pt-depts { justify-content: center; margin-top: 8px; }
.pt-delete-warn {
    font-size: 0.8rem; color: var(--text-secondary); line-height: 1.7;
    background: var(--red-bg); border: 1px solid var(--red-border);
    border-radius: 8px; padding: 10px 12px; text-align: left;
}
.pt-delete-warn b { color: var(--red); }
.pt-delete-actions { justify-content: center; }

/* --- /monthly 月度经营分析表：左企业经营计划表列表 + 右分月分析（复用 .pt-split 主从布局） --- */
/* 详情头右上角筛选：月份 + 部门 */
.monthly-page .mo-filters, .weekly-page .mo-filters, .biz-data-page .mo-filters, .bsc-adjust-page .mo-filters, .bsc-edit-page .mo-filters {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    font-size: 0.78rem; color: var(--text-secondary);
}
.monthly-page .mo-filters > span, .weekly-page .mo-filters > span, .biz-data-page .mo-filters > span, .bsc-adjust-page .mo-filters > span, .bsc-edit-page .mo-filters > span {
    background: #f7f8fa; padding: 2px 12px; border-radius: 4px; border: 1px solid var(--border);
}
.monthly-page .mo-select, .weekly-page .mo-select, .biz-data-page .mo-select, .bsc-adjust-page .mo-select, .bsc-edit-page .mo-select {
    border: none; background: transparent; font-family: inherit; font-size: 0.78rem;
    font-weight: 600; color: var(--text); cursor: pointer; max-width: 170px;
}
.monthly-page .mo-select:focus, .weekly-page .mo-select:focus, .biz-data-page .mo-select:focus, .bsc-adjust-page .mo-select:focus, .bsc-edit-page .mo-select:focus { outline: none; }
/* 表格：本月计划只读加粗；本月实绩取自业绩表只读展示；根因/改善为内存填报输入框 */
.month-table .td-plan { font-weight: 600; color: var(--text); }
.month-table .td-actual { font-weight: 600; color: var(--text); white-space: nowrap; }
/* 与个人指标进度 .st-unit 完全一致：0.68rem / 400，不继承 td-left 的 500 */
.month-table .mo-ind-unit, .adj-table .mo-ind-unit { font-size: 0.68rem; font-weight: 400; color: var(--text-muted); }
/* 数据行同高：主表行高由根因/改善输入框撑起（约 33px），个人表为纯文本较矮；
   两表数据单元格统一固定 34px（border-box 最小高度），层面分隔行除外保持紧凑一致 */
.month-table tr:not(.layer-row) td,
.mo-emp-table tr:not(.layer-row) td { height: 34px; }
.month-text-input {
    width: 100%; min-width: 110px; border: 1px solid var(--border-light); border-radius: 6px;
    padding: 3px 6px; font-size: 0.72rem; font-family: inherit; color: var(--text); background: var(--white);
}
.month-text-input:focus { outline: none; border-color: var(--primary); }
/* 根因分析/改善方案填报格：默认文本 + 小编辑图标（无内容时仅图标），点击进入多行编辑（textarea）+ 保存/取消，保存入库 */
.month-table .td-entry { text-align: left; vertical-align: top; min-width: 130px; }
.month-table .entry-view {
    display: flex; align-items: flex-start; gap: 4px; width: 100%;
    min-height: 24px; padding: 2px; border-radius: 4px; cursor: pointer;
}
.month-table .entry-view:hover { background: var(--primary-light); }
.month-table .entry-text {
    flex: 1; min-width: 0; white-space: pre-wrap; word-break: break-all;
    font-size: 0.72rem; line-height: 1.5; color: var(--text);
}
.month-table .entry-icon { flex: none; font-size: 0.7rem; line-height: 1.5; opacity: 0.35; }
.month-table .entry-view:hover .entry-icon { opacity: 1; }
.month-table .entry-edit { display: flex; flex-direction: column; gap: 4px; padding: 2px 0; }
.month-table .entry-area {
    width: 100%; min-width: 130px; padding: 4px 6px; font-size: 0.72rem; line-height: 1.5;
    font-family: inherit; color: var(--text); background: var(--white);
    border: 1px solid var(--primary); border-radius: 4px; resize: vertical; outline: none;
}
.month-table .entry-btns { display: flex; gap: 4px; justify-content: flex-end; }
.month-table .entry-btn {
    padding: 2px 8px; font-size: 0.68rem; border-radius: 4px; cursor: pointer;
    border: 1px solid var(--border); background: var(--white); color: var(--text-secondary);
}
.month-table .entry-btn.save { background: var(--primary); border-color: var(--primary); color: var(--white); }
.month-table .entry-btn:disabled { opacity: 0.6; cursor: wait; }
/* 空态（无企业经营计划表：请先创建）与宽表防撑破 */
.mo-empty-icon { font-size: 2rem; margin-bottom: 10px; }
.monthly-page .pt-detail-empty b { color: var(--red); }
.mo-create-btn { margin-top: 16px; padding: 8px 30px; font-size: 0.88rem; }
.monthly-page .pt-detail { min-width: 0; }
/* 部门视角：个人指标分拆进度表（员工 × 本月计划/本月实绩/达成率）—— 与主表 month-table 同款样式 */
.mo-personal { margin: 18px 0 16px; }
.mo-personal-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.mo-personal-title { font-weight: 700; font-size: 0.9rem; color: var(--text); }
.mo-personal-sub { color: var(--text-muted); font-size: 0.75rem; }
.mo-personal-head .action-btn { margin-left: auto; }
.mo-personal-saved { color: var(--text-muted); font-size: 0.72rem; }
.mo-personal-head .action-btn:disabled { opacity: 0.6; cursor: wait; }
/* 同款覆盖：容器/字号/边框/表头/间距对齐 .month-table（表格同时带 .split-table 结构类，规则靠后生效） */
.mo-emp-table { font-size: 0.75rem; border: 1px solid var(--border); min-width: 800px; }
/* monthly 个人指标进度表固定列宽：table-layout fixed + 总宽按员工数行内绑定（MonthlyPage.empTableWidth），
   首行 th.st-ind 定指标列 180px，剩余宽度在每员工 3 列间均分（=92px/列）；员工多→总宽超出
   .month-table-wrap 出横向滚动条、指标列 sticky 吸附不变，员工少→列宽不拉伸；仅 monthly 模板挂 .emp-fixed，weekly/budget 同表不受影响 */
.mo-emp-table.emp-fixed { table-layout: fixed; min-width: 0; }
.mo-emp-table.emp-fixed .st-ind { width: 180px; }
/* 层面行（财务层面等）标题格挂 .st-ind 被吸附：sticky 定位/z-index 来自 .split-table .st-ind（(0,2,0)），
   底色/字色/加粗由 .mo-emp-table .layer-row td（(0,2,1)）覆盖为层面行样式，无需额外规则；
   填充格恢复普通 1px 边框（不跟随 layer-* 的 4px 彩色左边线，避免吸附列右侧出现彩色竖线） */
/* 层面标题保持 700 加粗（.mo-emp-table td.st-ind 的 500 在源码更后、同特异性会反超，需显式压回） */
.mo-emp-table.emp-fixed .layer-row td.st-ind { font-weight: 700; }
.mo-emp-table.emp-fixed .layer-row td.st-ind + td { border-left: 1px solid var(--border); }
/* 横向滚动条常显不隐藏：macOS 悬浮滚动条默认自动隐藏，自定义 webkit 滚动条样式即切换为经典常驻滚动条
   （挂系统全部两类横向滚动容器：month-table-wrap=monthly 主表/个人指标进度 + split-scroll=bsc/bsc-edit 部门分拆、
   weekly/personal-split 等分员工表；无溢出时 overflow-x:auto 不占位不显示） */
.month-table-wrap, .split-scroll { scrollbar-width: thin; scrollbar-color: #b6bfcd #f1f3f7; }
.month-table-wrap::-webkit-scrollbar, .split-scroll::-webkit-scrollbar { height: 12px; }
.month-table-wrap::-webkit-scrollbar-track, .split-scroll::-webkit-scrollbar-track { background: #f1f3f7; border-radius: 6px; }
.month-table-wrap::-webkit-scrollbar-thumb, .split-scroll::-webkit-scrollbar-thumb { background: #b6bfcd; border-radius: 6px; border: 2px solid #f1f3f7; }
.month-table-wrap::-webkit-scrollbar-thumb:hover, .split-scroll::-webkit-scrollbar-thumb:hover { background: #98a3b4; }
.mo-emp-table th, .mo-emp-table td { padding: 5px 6px; vertical-align: middle; }
.mo-emp-table thead th { background: #f7f8fa; color: var(--primary); font-weight: 700; font-size: 0.7rem; }
.mo-emp-table .st-month { background: #f7f8fa; color: var(--primary); font-size: 0.7rem; }
/* monthly 页「个人指标进度」：员工名称表头改黑色（weekly 页同款表保持原蓝色） */
.monthly-page .mo-emp-table .st-month { color: #000; }
.mo-emp-table .st-dept { font-size: 0.7rem; font-weight: 700; }
.mo-emp-table td { font-size: 0.72rem; }
.mo-emp-table td.st-ind { padding-left: 10px; font-weight: 500; }
.mo-emp-table .emp-plan-text { display: inline-block; min-width: 48px; font-weight: 600; font-size: 0.72rem; color: var(--text); }
/* 自动计算指标：浏览态直接文本展示，颜色字重与普通指标完全一致（calc 类不再置灰；空值 .empty 置灰对所有指标一视同仁） */
.mo-emp-table .emp-plan-text.empty { color: var(--text-muted); font-weight: 400; }
.mo-emp-table .emp-rate { font-weight: 700; font-size: 0.72rem; white-space: nowrap; }
.mo-emp-table .emp-rate-good { color: var(--green); }
.mo-emp-table .emp-rate-bad { color: var(--red); }
/* weekly 部门整体指标表差异列：负值红字（盖过 .emp-plan-text 的默认色） */
.mo-emp-table .emp-plan-text.gap-neg { color: var(--red); }

/* ===== 管理后台 /admin ===== */
.admin-page { min-height: 100vh; }

/* 登录卡片：蓝紫渐变 logo + 径向光晕，区别于员工登录 */
.admin-login {
    background: radial-gradient(880px 460px at 18% -8%, #e4e9ff 0%, rgba(228,233,255,0) 60%),
                linear-gradient(160deg, var(--primary-light) 0%, var(--bg) 48%);
}
.admin-login-logo { background: linear-gradient(135deg, var(--primary) 0%, #8a5cf6 100%); font-size: 22px; }

/* 顶栏：深蓝渐变白字，sticky */
.admin-topbar {
    display: flex; align-items: center; justify-content: space-between;
    height: 58px; padding: 0 24px;
    background: linear-gradient(120deg, var(--primary) 0%, #3a4fd6 55%, #26307e 100%);
    box-shadow: 0 2px 12px rgba(30, 41, 99, 0.25);
    position: sticky; top: 0; z-index: 20;
}
.admin-topbar-title {
    display: flex; align-items: center; gap: 10px;
    color: #fff; font-size: 1.05rem; font-weight: 700; letter-spacing: 0.5px;
}
.admin-logo {
    width: 32px; height: 32px; border-radius: 9px;
    background: rgba(255,255,255,0.18);
    display: flex; align-items: center; justify-content: center; font-size: 17px;
}
.admin-topbar-right { display: flex; align-items: center; gap: 14px; }
.admin-user { display: flex; align-items: center; gap: 8px; color: rgba(255,255,255,0.92); font-size: 0.86rem; }
.admin-avatar {
    width: 28px; height: 28px; border-radius: 50%;
    background: rgba(255,255,255,0.22); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; font-weight: 700;
}
.admin-logout-btn {
    border: 1px solid rgba(255,255,255,0.4); background: transparent; color: #fff;
    font-size: 0.8rem; padding: 6px 14px; border-radius: 8px; cursor: pointer; transition: all 0.15s;
}
.admin-logout-btn:hover { background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.75); }

/* 内容区 */
.main-content.admin-content { max-width: none; }

/* 顶栏导航页签：半透明白 pill，选中=白底品牌蓝字 */
.admin-nav { display: flex; align-items: center; gap: 6px; }
.admin-nav-tab {
    border: none; background: transparent; cursor: pointer;
    padding: 7px 18px; border-radius: 8px; font-size: 0.88rem; font-weight: 500;
    color: rgba(255,255,255,0.75); transition: all 0.18s; white-space: nowrap;
}
.admin-nav-tab:hover { color: #fff; background: rgba(255,255,255,0.12); }
.admin-nav-tab.active {
    background: #fff; color: var(--primary); font-weight: 600;
    box-shadow: 0 1px 6px rgba(0,0,0,0.18);
}

/* 区块头：左标题 + 右操作按钮 */
.admin-sec-head {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 12px; margin-bottom: 16px;
}
.admin-sec-head .page-title { margin-bottom: 0; }

/* 表格面板：卡片化浅阴影 */
.admin-panel {
    background: var(--white); border: 1px solid var(--border-light);
    border-radius: 14px; padding: 6px 18px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}
/* 中和 dept 页第 3/4 列的 min-width（admin 列含义不同） */
.admin-table th:nth-child(3), .admin-table td:nth-child(3),
.admin-table th:nth-child(4), .admin-table td:nth-child(4) { min-width: 0; }
.admin-table .admin-id { color: var(--text-muted); font-size: 0.8rem; }
.admin-table .admin-desc {
    max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    color: var(--text-secondary); font-size: 0.82rem;
}
/* 编辑企业弹窗：企业简介大文本框 */
.admin-desc-textarea {
    min-height: 200px; line-height: 1.6; resize: vertical;
}
/* 初始化企业弹窗：将创建内容说明 */
.admin-init-note {
    margin-top: 4px; padding: 10px 12px;
    background: var(--bg); border: 1px solid var(--border-light);
    border-radius: 8px; color: var(--text-secondary);
    font-size: 0.8rem; line-height: 1.7;
}
.admin-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.8rem;
    background: var(--bg); border: 1px solid var(--border-light);
    padding: 2px 8px; border-radius: 6px; color: var(--text);
}
/* 初始化状态徽章 + 版本号 chip */
.admin-badge {
    display: inline-flex; align-items: center; white-space: nowrap;
    font-size: 0.75rem; padding: 3px 10px; border-radius: 999px;
    background: var(--bg); color: var(--text-muted); border: 1px solid var(--border-light);
}
.admin-badge.ok { background: var(--green-bg); color: var(--green); border-color: var(--green-border); }
.admin-ver {
    display: inline-block; font-size: 0.78rem; font-weight: 600;
    color: var(--primary); background: var(--primary-light);
    padding: 2px 10px; border-radius: 999px;
}
.admin-none { color: var(--text-muted); }
/* 企业列表分页组件（表格下方，15 条/页） */
.admin-pager { display: flex; justify-content: flex-end; align-items: center; gap: 6px; margin-top: 14px; }
.admin-pager-btn, .admin-pager-num {
    height: 30px; padding: 0 10px;
    border: 1px solid var(--border-light); background: var(--white);
    border-radius: 8px; cursor: pointer; font-size: 0.82rem; color: var(--text-secondary);
    transition: all 0.15s; display: inline-flex; align-items: center; justify-content: center;
}
.admin-pager-num { min-width: 30px; padding: 0 6px; }
.admin-pager-btn:hover:not(:disabled), .admin-pager-num:hover { border-color: var(--primary); color: var(--primary); }
.admin-pager-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.admin-pager-num.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }

/* ===== 系统设置页（/settings）：左侧子菜单 + 右侧内容（企业基本信息 / Token 使用账单） ===== */
.settings-page .pt-detail { min-width: 0; }
.settings-body { display: flex; gap: 18px; align-items: flex-start; }
.settings-menu { flex: none; width: 178px; display: flex; flex-direction: column; gap: 8px; }
.settings-menu-item {
    display: flex; align-items: center; gap: 8px; padding: 11px 14px;
    border: 1px solid var(--border-light); border-radius: 10px; background: var(--white);
    font-size: 0.9rem; color: var(--text-secondary); cursor: pointer; user-select: none;
    transition: all 0.15s;
}
.settings-menu-item:hover { border-color: var(--primary); color: var(--primary); }
.settings-menu-item.active {
    background: var(--primary-light, rgba(77,107,254,0.08));
    border-color: var(--primary); color: var(--primary); font-weight: 600;
}
.smi-icon { font-size: 1rem; }
.settings-panel { flex: 1; min-width: 0; }
.settings-sec-title {
    font-size: 0.98rem; font-weight: 600; color: var(--text);
    margin: 2px 0 16px; display: flex; align-items: center; gap: 12px;
}
.settings-loading { padding: 44px 0; text-align: center; color: var(--text-muted); font-size: 0.9rem; }
/* ① 企业基本信息表单 */
.set-form { max-width: 660px; }
.set-row { margin-bottom: 18px; }
.set-row label { display: block; font-size: 0.84rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 7px; }
.set-row input[type=text], .set-row textarea {
    width: 100%; box-sizing: border-box; padding: 9px 12px;
    border: 1px solid #dcdfe6; border-radius: 8px;
    font-size: 0.9rem; font-family: inherit; color: var(--text); outline: none; resize: vertical;
    transition: border-color 0.15s;
}
.set-row input[type=text]:focus, .set-row textarea:focus { border-color: var(--primary); }
.set-code-readonly { font-size: 0.9rem; color: var(--text); padding: 8px 0; }
.set-code-hint { margin-left: 10px; font-size: 0.78rem; color: var(--text-muted); }
.set-actions { display: flex; align-items: center; gap: 14px; }
.set-save-tip { font-size: 0.82rem; color: var(--green); }
.set-save-tip.err { color: var(--red); }
/* ② Token 使用：月份切换 */
.tk-month-nav { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; font-weight: 400; }
.tk-nav-btn {
    width: 26px; height: 26px; border: 1px solid #dcdfe6; background: var(--white);
    border-radius: 6px; cursor: pointer; color: var(--text-secondary); font-size: 15px; line-height: 1;
}
.tk-nav-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.tk-nav-btn:disabled { opacity: 0.4; cursor: default; }
.tk-month-label { font-size: 0.9rem; font-weight: 600; min-width: 76px; text-align: center; }
/* 账单总览卡片 */
.tk-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.tk-card {
    border: 1px solid var(--border-light); border-radius: 12px; padding: 12px 14px;
    background: var(--white); display: flex; flex-direction: column; gap: 4px;
}
.tk-label { font-size: 0.78rem; color: var(--text-muted); }
.tk-value { font-size: 1.3rem; font-weight: 700; color: var(--text); }
.tk-value.sm { font-size: 0.95rem; font-weight: 600; line-height: 2; }
.tk-sub { font-size: 0.74rem; color: var(--text-muted); }
.tk-card.used .tk-value { color: var(--primary); }
.tk-card.remain .tk-value { color: var(--green); }
.tk-card.remain.over .tk-value { color: var(--red); }
/* 额度使用进度条 */
.tk-bar-wrap { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.tk-bar { flex: 1; height: 8px; border-radius: 4px; background: #eef0f4; overflow: hidden; }
.tk-bar-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--primary), #8a5cf6); transition: width 0.3s; }
.tk-bar-fill.over { background: var(--red); }
.tk-bar-text { font-size: 0.78rem; color: var(--text-muted); flex: none; }
/* 账单区块与表格（复用 dept-table 基样式，数值列右对齐） */
.tk-sec { margin-bottom: 24px; }
.tk-sec-title { font-size: 0.88rem; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.tk-table th, .tk-table td { text-align: right; white-space: nowrap; }
.tk-table th:first-child, .tk-table td:first-child { text-align: left; }
.tk-table .tk-user { font-weight: 600; }
.tk-table tr.cur td { background: rgba(77,107,254,0.05); }
.tk-bar-th { width: 120px; }
.tk-mini-bar { height: 6px; border-radius: 3px; background: #eef0f4; overflow: hidden; min-width: 60px; }
.tk-mini-bar div { height: 100%; background: var(--primary); border-radius: 3px; }
.tk-empty {
    padding: 24px 0; text-align: center; color: var(--text-muted); font-size: 0.85rem;
    border: 1px dashed #e3e6eb; border-radius: 10px;
}
.tk-note { font-size: 0.78rem; color: var(--text-muted); line-height: 1.7; }
/* 管理后台：编辑企业弹窗的额度提示小字 */
.admin-quota-hint { margin-top: 5px; font-size: 0.76rem; color: var(--text-muted); line-height: 1.5; }
/* 窄屏：左菜单横排置顶 */
@media (max-width: 720px) {
    .settings-body { flex-direction: column; }
    .settings-menu { width: 100%; flex-direction: row; }
    .settings-menu-item { flex: 1; justify-content: center; }
}
