/* ============================================================
   组件库：导航 / 卡片 / 按钮 / 表格 / 表单 / 步骤条 / 终端 /
   对话 / 共享中心面板 / KPI / 图表 / 时间线 / 审批流
   ============================================================ */

/* ---------- 导航栏 ---------- */
.navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 900;
    height: 60px; background: rgba(255,255,255,.96);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--slate-200);
    display: flex; align-items: center;
}
.navbar-inner {
    max-width: 1560px; margin: 0 auto; padding: 0 16px;
    display: flex; align-items: center; gap: 10px; width: 100%;
    min-width: 0;
}
.navbar-brand {
    display: flex; align-items: center; gap: 8px; text-decoration: none;
    flex-shrink: 0; min-width: max-content;
}
/* 阶段子站导航栏左上角的返回键：回到带四个阶段标签的工作台，而不是主页 */
.nav-back {
    display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0;
    padding: 6px 10px; border-radius: 8px; text-decoration: none;
    border: 1px solid var(--slate-300); background: #fff;
    color: var(--slate-700); font-size: .80rem; font-weight: 700;
    transition: var(--trans); white-space: nowrap;
}
.nav-back i { width: 14px; height: 14px; }
.nav-back:hover { border-color: var(--slate-400); background: var(--slate-100); color: var(--slate-900); }
.brand-mark {
    width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
    background: linear-gradient(135deg, #2e5ce6, #6f9bff);
    display: flex; align-items: center; justify-content: center;
    color: #fff; box-shadow: 0 3px 8px rgba(46,92,230,.28);
}
.brand-mark i { width: 17px; height: 17px; }
.brand-name {
    font-size: .94rem; font-weight: 900; color: var(--slate-900);
    letter-spacing: .3px; white-space: nowrap;
}
.brand-sub {
    font-size: .66rem; color: var(--slate-400); font-weight: 600;
    letter-spacing: 1px; white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis; max-width: 140px; display: block;
}

.nav-links {
    display: flex; gap: 4px; align-items: center;
    flex: 1 1 auto; min-width: 0;
    overflow-x: auto; overflow-y: hidden;
    scrollbar-width: none; -ms-overflow-style: none;
}
.nav-links::-webkit-scrollbar { display: none; }

.nav-link {
    padding: 5px 9px; border-radius: 7px; text-decoration: none;
    color: var(--slate-600); font-size: .82rem; font-weight: 600;
    transition: var(--trans); white-space: nowrap !important;
    flex-shrink: 0; display: inline-flex; align-items: center;
}
.nav-link:hover { background: var(--slate-100); color: var(--slate-900); }
.nav-link.active {
    background: var(--role-bg); color: var(--role-color);
    font-weight: 800;
}

.navbar-actions {
    margin-left: auto; display: flex; align-items: center; gap: 8px;
    flex-shrink: 0; white-space: nowrap;
}
.role-chip {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 7px 16px; border-radius: 999px; font-size: 1rem; font-weight: 800;
    background: var(--role-light); color: var(--role-dark);
    border: 1px solid rgba(0,0,0,.06); white-space: nowrap; flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.role-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--role-color); }

@media (max-width: 1360px) {
    .brand-sub { display: none !important; }
}
@media (max-width: 1220px) {
    .role-chip { display: none !important; }
}
@media (max-width: 1040px) {
    .nav-back span { display: none; }
    .nav-back { padding: 6px 8px; }
}

/* ---------- 页头 ---------- */
.page-wrapper { padding-top: 60px; min-height: 100vh; }
.page-header { padding: 16px 0 2px; }
.page-title {
    font-size: 1.42rem; font-weight: 900; color: var(--slate-900);
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.page-title::after {
    content: ''; width: 38px; height: 4px; border-radius: 3px; margin-top: 6px;
}
.page-subtitle { color: var(--slate-500); font-size: .9rem; margin-top: 4px; }
.page-header-row { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }

/* ---------- 卡片 ---------- */
.card {
    background: #fff; border: 1px solid var(--slate-200);
    border-radius: var(--radius-lg); padding: 32px 36px;
    box-shadow: var(--shadow-sm);
    transition: var(--trans);
}
.card-hover:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card-title {
    font-size: 1.08rem; font-weight: 800; color: var(--slate-900);
    display: flex; align-items: center; gap: 9px; margin-bottom: 18px;
}
.card-title i { width: 19px; height: 19px; color: var(--role-color); }
.card-title .tag-right { margin-left: auto; font-size: .74rem; font-weight: 600; }

/* 区块小节头（①②③ 编号节） */
.section-head {
    display: flex; align-items: center; gap: 10px;
    font-size: .98rem; font-weight: 800; color: var(--slate-800);
    margin: 22px 0 12px;
}
.section-head .sec-no {
    min-width: 24px; width: auto; height: 24px; padding: 0 8px; border-radius: 6px; flex: none;
    background: var(--role-bg); color: var(--role-color);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .76rem; font-weight: 900; white-space: nowrap; line-height: 1;
}
.section-head .sec-sub { font-weight: 500; color: var(--slate-400); font-size: .82rem; margin-left: auto; }

/* 承接头（新内容块因果过渡） */
.bridge {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 18px; border-radius: var(--radius-md);
    background: var(--role-light); color: var(--role-dark);
    font-size: .88rem; font-weight: 600;
    border: 1px dashed color-mix(in srgb, var(--role-color) 35%, transparent);
    margin: 18px 0;
}
.bridge i { width: 16px; height: 16px; flex: none; }

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: 0; cursor: pointer; text-decoration: none;
    font-family: inherit; font-size: .95rem; font-weight: 700;
    padding: 11px 26px; border-radius: 10px;
    transition: var(--trans); line-height: 1.4; white-space: nowrap;
}
.btn i { width: 17px; height: 17px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--brand-color); color: #fff; box-shadow: 0 3px 10px rgba(46,92,230,.24); }
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(46,92,230,.3); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover:not(:disabled) { background: #12813b; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-secondary {
    background: #fff; color: var(--slate-700);
    border: 1px solid var(--slate-300); box-shadow: var(--shadow-sm);
}
.btn-secondary:hover:not(:disabled) { border-color: var(--slate-400); background: var(--slate-50); }
.btn-ghost { background: transparent; color: var(--role-color); }
.btn-ghost:hover:not(:disabled) { background: var(--role-bg); }
.btn-sm { padding: 7px 16px; font-size: .85rem; border-radius: 8px; }
.btn-sm i { width: 15px; height: 15px; }
.btn-lg { padding: 14px 36px; font-size: 1.05rem; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-pulse { animation: pulse 1.8s infinite; }

/* ---------- 数据表 ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--slate-200); border-radius: var(--radius-md); background: #fff; }
.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.data-table th {
    background: var(--slate-50); color: var(--slate-600);
    font-weight: 700; text-align: left; padding: 11px 14px;
    border-bottom: 1px solid var(--slate-200); white-space: nowrap;
    font-size: .84rem;
}
.data-table td { padding: 11px 14px; border-bottom: 1px solid var(--slate-100); color: var(--slate-700); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: var(--slate-50); }
.data-table .num, .data-table td[class*="text-right"] { text-align: right; }
.data-table th.num, .data-table th[class*="text-right"] { text-align: right; }
.data-table tr.row-total td {
    background: var(--slate-50); font-weight: 800; color: var(--slate-900);
    border-top: 2px solid var(--slate-200);
}
.data-table tr.row-hl td { background: var(--warning-light); }
.data-table tr.row-good td { background: var(--success-light); }
.data-table .cell-strong { font-weight: 800; color: var(--slate-900); }
.data-table .cell-brand { font-weight: 800; color: var(--role-color); }
.data-table.compact th, .data-table.compact td { padding: 8px 12px; font-size: .84rem; }

/* ---------- 表单 ---------- */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: .86rem; font-weight: 700; color: var(--slate-700); margin-bottom: 7px; }
.form-label .req { color: var(--danger); margin-left: 3px; }
.form-input, .form-select, .form-textarea {
    width: 100%; padding: 10px 14px; font-size: .92rem;
    border: 1px solid var(--slate-300); border-radius: 9px;
    background: #fff; color: var(--slate-800);
    font-family: inherit; transition: var(--trans); outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--role-color); box-shadow: 0 0 0 3px var(--role-bg);
}
.form-input::placeholder { color: var(--slate-400); }
.form-hint { font-size: .78rem; color: var(--slate-400); margin-top: 5px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.form-input.err, .form-select.err { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-light); }

/* 复选 / 单选组 */
.check-item {
    display: flex; align-items: flex-start; gap: 11px;
    padding: 12px 16px; border: 1.5px solid var(--slate-200);
    border-radius: var(--radius-md); cursor: pointer;
    transition: var(--trans); background: #fff;
}
.check-item:hover { border-color: var(--slate-300); background: var(--slate-50); }
.check-item.checked { border-color: var(--role-color); background: var(--role-light); }
.check-item input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--role-color); cursor: pointer; flex: none; }
.check-item .ck-title { font-weight: 700; font-size: .92rem; color: var(--slate-800); }
.check-item .ck-desc { font-size: .8rem; color: var(--slate-500); margin-top: 2px; }

.radio-card {
    display: flex; align-items: center; gap: 11px; padding: 14px 18px;
    border: 1.5px solid var(--slate-200); border-radius: var(--radius-md);
    cursor: pointer; transition: var(--trans); background: #fff;
}
.radio-card:hover { border-color: var(--slate-300); }
.radio-card.selected { border-color: var(--role-color); background: var(--role-light); box-shadow: 0 0 0 3px var(--role-bg); }
.radio-card input { accent-color: var(--role-color); width: 17px; height: 17px; }

/* 开关 */
.switch { position: relative; width: 42px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
    position: absolute; inset: 0; border-radius: 999px;
    background: var(--slate-300); transition: var(--trans); cursor: pointer;
}
.switch .slider::before {
    content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%;
    background: #fff; top: 3px; left: 3px; transition: var(--trans);
    box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.switch input:checked + .slider { background: var(--role-color); }
.switch input:checked + .slider::before { transform: translateX(18px); }

/* ---------- 向导步骤面板（互斥显示） ---------- */
.wizard-step { display: none; }
.wizard-step.active { display: block; animation: fadeInUp .45s both; }
.wizard-step > div { max-width: none !important; }

/* ---------- 步骤条（大号居中 · 数字圆点 + 下方标签 + 渐变连线） ---------- */
.step-nav {
    display: flex; align-items: flex-start; justify-content: center;
    margin: 16px auto 14px; row-gap: 12px; max-width: 1220px;
}
.step-dot {
    width: 34px; height: 34px; border-radius: 50%;
    border: 2px solid var(--slate-300); background: #fff;
    color: var(--slate-400); font-size: .9rem; font-weight: 900;
    display: flex; align-items: center; justify-content: center;
    transition: var(--trans); flex: none;
}
.step-dot.done { background: #10b981; border-color: #10b981; color: #fff; box-shadow: 0 3px 12px rgba(16,185,129,.32); }
.step-dot-wrap .dot-label {
    font-size: .82rem; font-weight: 700;
    color: var(--slate-400); white-space: nowrap;
    transition: var(--trans);
}
.step-dot-wrap .dot-label.active-label { color: var(--role-color); font-weight: 900; }
.step-line {
    flex: 1 1 auto; min-width: 46px; height: 2.5px; border-radius: 3px;
    background: var(--slate-200); transition: var(--trans);
    margin-top: 15.5px;
}
.step-line.done { background: linear-gradient(90deg, #10b981, var(--role-color)); }

/* ---------- 终端 ---------- */
.terminal-card { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); border: 1px solid #23263a; }
.terminal-header {
    background: #1d2030; padding: 10px 16px;
    display: flex; align-items: center; gap: 8px;
}
.terminal-dot { width: 12px; height: 12px; border-radius: 50%; }
.terminal-dot.r { background: #ff5f57; } .terminal-dot.y { background: #febc2e; } .terminal-dot.g { background: #28c840; }
.terminal-title { margin-left: 10px; color: #8b93b8; font-size: .8rem; font-weight: 600; }
.terminal {
    background: #101319; padding: 18px 20px; min-height: 300px;
    max-height: 520px; overflow-y: auto;
    font-family: 'JetBrains Mono', 'Cascadia Code', Consolas, monospace;
    font-size: .84rem; line-height: 1.75; color: #a9b1d6;
}
.terminal .t-prompt { color: #7aa2f7; }
.terminal .t-success { color: #28c840; }
.terminal .t-warning { color: #febc2e; }
.terminal .t-error { color: #ff5f57; }
.terminal .t-comment { color: #565f89; }
.terminal .t-keyword { color: #bb9af7; }
.terminal .t-string { color: #9ece6a; }
.terminal .t-number { color: #ff9e64; }
.terminal .t-cmd { color: #e6edf7; }

/* ---------- 对话（AI） ---------- */
.chat-panel {
    background: var(--slate-50); border: 1px solid var(--slate-200);
    border-radius: var(--radius-lg); padding: 22px;
    max-height: 460px; overflow-y: auto;
}
.chat-msg { display: flex; gap: 11px; margin-bottom: 16px; }
.chat-msg.user { flex-direction: row-reverse; }
.chat-avatar {
    width: 34px; height: 34px; border-radius: 10px; flex: none;
    display: flex; align-items: center; justify-content: center; color: #fff;
}
.chat-avatar i { width: 17px; height: 17px; }
.chat-msg.user .chat-avatar { background: var(--slate-600); }
.chat-msg.bot .chat-avatar { background: linear-gradient(135deg, var(--role-color), color-mix(in srgb, var(--role-color) 55%, #7dd3fc)); }
.chat-bubble {
    max-width: 82%; padding: 12px 16px; font-size: .89rem; line-height: 1.7;
    border-radius: 14px;
}
.chat-msg.user .chat-bubble { background: var(--role-color); color: #fff; border-top-right-radius: 4px; }
.chat-msg.bot .chat-bubble { background: #fff; border: 1px solid var(--slate-200); border-top-left-radius: 4px; box-shadow: var(--shadow-sm); }
.chat-bubble table { border-collapse: collapse; margin-top: 8px; font-size: .82rem; }
.chat-bubble table td, .chat-bubble table th { border: 1px solid var(--slate-200); padding: 5px 10px; }
.chat-quick { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.chat-quick .q-btn {
    padding: 7px 15px; border-radius: 999px; border: 1px solid var(--role-color);
    color: var(--role-color); background: #fff; font-size: .82rem; font-weight: 600;
    cursor: pointer; transition: var(--trans);
}
.chat-quick .q-btn:hover { background: var(--role-light); }
.typing-dots { display: inline-flex; gap: 4px; align-items: center; height: 18px; }
.typing-dots span {
    width: 6px; height: 6px; border-radius: 50%; background: var(--slate-400);
    animation: typingBounce 1.2s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: .15s; }
.typing-dots span:nth-child(3) { animation-delay: .3s; }

/* ---------- KPI 指标卡 ---------- */
.kpi-tile {
    background: #fff; border: 1px solid var(--slate-200);
    border-radius: var(--radius-lg); padding: 20px 22px;
    box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.kpi-tile::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 3px;
    background: var(--role-color);
}
.kpi-label { font-size: .82rem; color: var(--slate-500); font-weight: 600; display: flex; align-items: center; gap: 7px; }
.kpi-label i { width: 15px; height: 15px; }
.kpi-value { font-size: 1.85rem; font-weight: 900; color: var(--slate-900); margin-top: 6px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.kpi-value .unit { font-size: .82rem; font-weight: 600; color: var(--slate-400); margin-left: 4px; }
.kpi-foot { font-size: .78rem; color: var(--slate-400); margin-top: 5px; }
.kpi-delta { font-size: .8rem; font-weight: 800; margin-top: 6px; display: inline-flex; align-items: center; gap: 4px; }
.kpi-delta.up { color: var(--success); } .kpi-delta.down { color: var(--danger); }
.kpi-delta i { width: 14px; height: 14px; }

/* ---------- 纯 CSS 图表 ---------- */
.chart-bars {
    display: flex; align-items: flex-end; gap: 18px; height: 210px;
    padding: 0 8px; border-bottom: 2px solid var(--slate-200);
}
.chart-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.chart-bar {
    width: 70%; max-width: 54px; border-radius: 6px 6px 0 0;
    transition: height 1s cubic-bezier(.4,0,.2,1); position: relative;
    min-height: 3px;
}
.chart-bar .bar-val {
    position: absolute; top: -24px; left: 50%; transform: translateX(-50%);
    font-size: .76rem; font-weight: 800; color: var(--slate-700); white-space: nowrap;
}
.chart-bar-label { font-size: .78rem; color: var(--slate-500); font-weight: 600; margin-top: 8px; text-align: center; }

.hbar-row { display: grid; grid-template-columns: 92px 1fr 88px; align-items: center; gap: 12px; margin-bottom: 12px; }
.hbar-name { font-size: .84rem; font-weight: 700; color: var(--slate-600); text-align: right; }
.hbar-track { background: var(--slate-100); border-radius: 6px; height: 22px; overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 6px; transition: width 1s cubic-bezier(.4,0,.2,1); min-width: 2px; }
.hbar-val { font-size: .82rem; font-weight: 800; color: var(--slate-700); font-variant-numeric: tabular-nums; }

.pie-wrap { display: flex; align-items: center; gap: 26px; justify-content: center; }
.pie-legend { display: flex; flex-direction: column; gap: 9px; }
.pie-legend .lg-item { display: flex; align-items: center; gap: 9px; font-size: .84rem; color: var(--slate-600); }
.pie-legend .lg-dot { width: 11px; height: 11px; border-radius: 3.5px; }
.pie-legend .lg-val { font-weight: 800; color: var(--slate-800); margin-left: auto; font-variant-numeric: tabular-nums; }

/* 折线（SVG 内联时使用） */
.line-chart-path { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- 时间线 / 流程节点 ---------- */
.flow-rail { display: flex; flex-direction: column; gap: 0; }
.flow-node {
    display: grid; grid-template-columns: 172px 26px 1fr; gap: 14px;
    padding-bottom: 22px; position: relative;
}
.flow-node:last-child { padding-bottom: 0; }
.flow-node .fn-label {
    text-align: right; font-size: .88rem; font-weight: 800; color: var(--slate-700);
    padding-top: 1px;
}
.flow-node .fn-label .fn-sub { display: block; font-size: .72rem; color: var(--slate-400); font-weight: 500; margin-top: 2px; }
.flow-node .fn-axis { position: relative; display: flex; justify-content: center; }
.flow-node .fn-axis::before {
    content: ''; position: absolute; top: 24px; bottom: -4px; width: 2px;
    background: var(--slate-200);
}
.flow-node:last-child .fn-axis::before { display: none; }
.flow-node .fn-point {
    width: 24px; height: 24px; border-radius: 50%; z-index: 1;
    border: 2.5px solid var(--slate-300); background: #fff;
    display: flex; align-items: center; justify-content: center;
    transition: var(--trans); margin-top: 1px;
}
.flow-node .fn-point i { width: 12px; height: 12px; color: var(--slate-400); }
.flow-node.running .fn-point { border-color: var(--role-color); animation: pulse 1.2s infinite; }
.flow-node.running .fn-point i { color: var(--role-color); }
.flow-node.done .fn-point { border-color: var(--success); background: var(--success-light); }
.flow-node.done .fn-point i { color: var(--success); }
.flow-node .fn-body {
    background: #fff; border: 1px solid var(--slate-200); border-radius: var(--radius-md);
    padding: 14px 18px; font-size: .87rem; color: var(--slate-600);
    transition: var(--trans); opacity: .55;
}
.flow-node.running .fn-body, .flow-node.done .fn-body { opacity: 1; }
.flow-node.running .fn-body { border-color: var(--role-color); box-shadow: 0 0 0 3px var(--role-bg); }

/* ---------- 审批流 ---------- */
.approval-chain { display: flex; align-items: center; gap: 0; flex-wrap: wrap; }
.appr-node { text-align: center; flex: none; }
.appr-avatar {
    width: 46px; height: 46px; border-radius: 50%; margin: 0 auto;
    display: flex; align-items: center; justify-content: center;
    font-weight: 900; font-size: .95rem; color: #fff;
    border: 2.5px solid #fff; box-shadow: var(--shadow-md);
}
.appr-name { font-size: .8rem; font-weight: 700; color: var(--slate-700); margin-top: 6px; }
.appr-status { font-size: .72rem; font-weight: 700; margin-top: 2px; }
.appr-arrow { width: 56px; height: 2px; background: var(--slate-200); margin: 0 8px; position: relative; top: -22px; }
.appr-arrow.done { background: var(--success); }
.appr-arrow::after {
    content: ''; position: absolute; right: -1px; top: -3.5px;
    border-left: 7px solid var(--slate-200); border-top: 4.5px solid transparent; border-bottom: 4.5px solid transparent;
}
.appr-arrow.done::after { border-left-color: var(--success); }

/* ---------- 共享中心面板 ---------- */
.shared-panel {
    position: fixed; top: 0; right: -420px; width: 400px; height: 100vh;
    background: #fff; z-index: 1000; box-shadow: -12px 0 40px rgba(16,24,40,.16);
    transition: right .32s cubic-bezier(.4,0,.2,1);
    display: flex; flex-direction: column;
}
.shared-panel.open { right: 0; }
.shared-mask { position: fixed; inset: 0; background: rgba(16,24,40,.32); z-index: 999; opacity: 0; pointer-events: none; transition: opacity .3s; }
.shared-mask.show { opacity: 1; pointer-events: auto; }
.shared-head {
    padding: 20px 22px; border-bottom: 1px solid var(--slate-200);
    display: flex; align-items: center; gap: 10px;
}
.shared-head i { width: 19px; height: 19px; color: var(--brand-color); }
.shared-head .sh-title { font-weight: 900; font-size: 1.02rem; flex: 1; }
.shared-body { flex: 1; overflow-y: auto; padding: 16px 18px; }
.shared-item {
    display: flex; gap: 12px; padding: 13px 14px; border: 1px solid var(--slate-200);
    border-radius: var(--radius-md); margin-bottom: 12px; background: #fff;
    transition: var(--trans); animation: slideInRight .4s both;
}
.shared-item:hover { box-shadow: var(--shadow-md); border-color: var(--slate-300); }
.shared-item .si-icon {
    width: 38px; height: 38px; border-radius: 10px; flex: none;
    display: flex; align-items: center; justify-content: center;
}
.shared-item .si-icon i { width: 18px; height: 18px; }
.si-name { font-size: .86rem; font-weight: 700; color: var(--slate-800); word-break: break-all; }
.si-meta { font-size: .74rem; color: var(--slate-400); margin-top: 4px; display: flex; gap: 8px; flex-wrap: wrap; }
.si-empty { text-align: center; color: var(--slate-400); font-size: .85rem; padding: 50px 0; }

/* ---------- 模态框 ---------- */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(16,24,40,.5); z-index: 1100;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity .25s;
    backdrop-filter: blur(3px);
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal-box {
    background: #fff; border-radius: var(--radius-lg); width: min(560px, 92vw);
    max-height: 86vh; overflow-y: auto; padding: 30px 32px;
    box-shadow: var(--shadow-lg); transform: translateY(14px) scale(.97); transition: transform .25s;
}
.modal-overlay.active .modal-box { transform: none; }

/* ---------- 进度条 ---------- */
.progress-bar { background: var(--slate-100); border-radius: 999px; height: 10px; overflow: hidden; }
.progress-fill {
    height: 100%; border-radius: 999px; background: var(--role-color);
    transition: width .5s cubic-bezier(.4,0,.2,1); position: relative;
}
.progress-fill.striped {
    background-image: linear-gradient(45deg, rgba(255,255,255,.22) 25%, transparent 25%,
        transparent 50%, rgba(255,255,255,.22) 50%, rgba(255,255,255,.22) 75%, transparent 75%);
    background-size: 18px 18px; animation: progressFlow 1s linear infinite;
}

/* ---------- 标签页 ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1.5px solid var(--slate-200); margin-bottom: 20px; flex-wrap: wrap; }
.tab {
    padding: 10px 18px; font-size: .9rem; font-weight: 700; color: var(--slate-500);
    border-bottom: 2.5px solid transparent; margin-bottom: -1.5px; cursor: pointer;
    transition: var(--trans); background: none; border-top: 0; border-left: 0; border-right: 0;
    font-family: inherit;
}
.tab:hover { color: var(--slate-800); }
.tab.active { color: var(--role-color); border-bottom-color: var(--role-color); }

/* ---------- 状态点 ---------- */
.status-dot { display: inline-flex; align-items: center; gap: 7px; font-size: .82rem; font-weight: 700; }
.status-dot::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status-dot.ok { color: var(--success); }
.status-dot.warn { color: var(--warning); }
.status-dot.err { color: var(--danger); }
.status-dot.idle { color: var(--slate-400); }
.status-dot.live::before { animation: pulse 1.2s infinite; }

/* ---------- 任务卡片（工作台） ---------- */
.task-card {
    display: flex; gap: 16px; align-items: stretch; text-decoration: none;
    background: #fff; border: 1px solid var(--slate-200); border-radius: var(--radius-lg);
    padding: 20px 22px; transition: var(--trans); box-shadow: var(--shadow-sm);
    position: relative; overflow: hidden;
}
.task-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.task-card .tk-icon {
    width: 52px; height: 52px; border-radius: 14px; flex: none;
    display: flex; align-items: center; justify-content: center; color: #fff;
}
.task-card .tk-icon i { width: 24px; height: 24px; }
.tk-title { font-size: 1rem; font-weight: 800; color: var(--slate-900); display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.tk-desc { font-size: .83rem; color: var(--slate-500); margin-top: 5px; }
.tk-foot { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.tk-done-flag {
    position: absolute; top: 0; right: 0; padding: 3px 12px;
    background: var(--success); color: #fff; font-size: .7rem; font-weight: 800;
    border-radius: 0 0 0 10px;
}

/* ---------- 结论横幅 ---------- */
.result-banner {
    border-radius: var(--radius-lg); padding: 26px 30px;
    background: linear-gradient(135deg, #0f2b1b, #14532d);
    color: #fff; position: relative; overflow: hidden;
}
.result-banner::before {
    content: ''; position: absolute; right: -60px; top: -60px; width: 240px; height: 240px;
    background: radial-gradient(circle, rgba(52,194,110,.25), transparent 70%); border-radius: 50%;
}
.result-banner .rb-title { font-size: 1.1rem; font-weight: 900; display: flex; align-items: center; gap: 9px; }
.result-banner .rb-title i { width: 20px; height: 20px; color: #34c26e; }
.result-banner .rb-body { margin-top: 8px; font-size: .92rem; color: rgba(255,255,255,.86); position: relative; }
.result-banner .rb-stats { display: flex; gap: 34px; margin-top: 16px; flex-wrap: wrap; position: relative; }
.result-banner .rb-stat .v { font-size: 1.5rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.result-banner .rb-stat .k { font-size: .76rem; color: rgba(255,255,255,.65); }

/* 警示横幅 */
.alert-banner {
    display: flex; gap: 13px; align-items: flex-start;
    border-radius: var(--radius-md); padding: 16px 20px;
    background: var(--warning-light); border: 1px solid rgba(217,119,6,.28);
    color: #8a4b05; font-size: .9rem;
}
.alert-banner i { width: 20px; height: 20px; flex: none; color: var(--warning); margin-top: 2px; }
.alert-banner.alert-red { background: var(--danger-light); border-color: rgba(220,38,38,.25); color: #9f1f1f; }
.alert-banner.alert-red i { color: var(--danger); }
.alert-banner.alert-blue { background: var(--info-light); border-color: rgba(2,132,199,.25); color: #0c5a83; }
.alert-banner.alert-blue i { color: var(--info); }

/* ---------- 单据（ERP 风格） ---------- */
.doc-sheet { background: #fff; border: 1px solid var(--slate-200); border-radius: var(--radius-lg); padding: 30px 34px; }
.doc-sheet .doc-no { text-align: right; font-size: .82rem; color: var(--slate-500); }
.doc-sheet .doc-title { text-align: center; font-size: 1.25rem; font-weight: 900; color: var(--slate-900); letter-spacing: 6px; margin: 6px 0 4px; }
.doc-sheet .doc-sub { text-align: center; font-size: .78rem; color: var(--slate-400); letter-spacing: 2px; }

/* ---------- 敏感度滑杆 ---------- */
.slider-row { display: flex; align-items: center; gap: 16px; }
.slider-row input[type=range] {
    flex: 1; accent-color: var(--role-color); height: 6px; cursor: pointer;
}
.slider-val {
    min-width: 86px; text-align: center; font-weight: 900; font-size: 1.05rem;
    color: var(--role-color); background: var(--role-light);
    padding: 6px 12px; border-radius: 9px; font-variant-numeric: tabular-nums;
}

/* ---------- 区块链 ---------- */
.chain-visual { display: flex; align-items: center; gap: 0; overflow-x: auto; padding: 20px 6px; }
.block-node {
    min-width: 168px; border-radius: var(--radius-md); padding: 13px 15px;
    background: #101319; border: 1px solid #2b3048; color: #8b93b8;
    font-family: 'JetBrains Mono', Consolas, monospace; font-size: .7rem; flex: none;
}
.block-node .bn-head { display: flex; align-items: center; gap: 7px; color: #7dd3fc; font-weight: 700; }
.block-node .bn-head i { width: 13px; height: 13px; }
.block-node .bn-hash { margin-top: 6px; word-break: break-all; line-height: 1.5; }
.block-node.latest { border-color: #34c26e; box-shadow: 0 0 0 3px rgba(52,194,110,.18); }
.block-node.latest .bn-head { color: #34c26e; }
.chain-link { width: 34px; height: 2px; background: repeating-linear-gradient(90deg, #475069 0 6px, transparent 6px 11px); flex: none; }

/* ---------- 打印体结论卡 ---------- */
.doc-final {
    border: 1.5px solid var(--slate-300); border-radius: var(--radius-lg);
    background: #fff; padding: 34px 38px; position: relative;
}
.doc-final::before {
    content: ''; position: absolute; top: 10px; left: 10px; right: 10px; bottom: 10px;
    border: 1px solid var(--slate-200); border-radius: 12px; pointer-events: none;
}
.doc-final .df-title { text-align: center; font-size: 1.3rem; font-weight: 900; letter-spacing: 5px; }
.doc-final .df-no { text-align: right; font-size: .78rem; color: var(--slate-400); }
.stamp {
    position: absolute; right: 40px; bottom: 34px; width: 108px; height: 108px;
    border: 3px solid rgba(220,38,38,.75); border-radius: 50%;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: rgba(220,38,38,.85); transform: rotate(-14deg); font-weight: 900;
    letter-spacing: 2px; opacity: .9;
}
.stamp .st-main { font-size: 1.05rem; }
.stamp .st-sub { font-size: .58rem; letter-spacing: 1px; margin-top: 3px; }

/* ---------- 响应式微调 ---------- */
@media (max-width: 1020px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .form-row, .form-row-3 { grid-template-columns: 1fr; }
    .flow-node { grid-template-columns: 120px 26px 1fr; }
}
@media (max-width: 680px) {
    .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
    .nav-links { display: none; }
    .step-line { width: 30px; }
}
