/* ──  FDE 中台 · 设计系统  ── */
:root{
  --bg:#f5f6f3; --paper:#fff; --ink:#24342e; --muted:#7c8881;
  --line:#e5e9e3; --green:#237557; --light:#eaf3ec; --orange:#c38035;
  --nav:#172f27; --radius:14px
}
*, *::before, *::after{box-sizing:border-box; margin:0}
body{
  margin:0; background:var(--bg); color:var(--ink);
  font:14px -apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif
}
button,input,select,textarea{font:inherit}
button,a{-webkit-tap-highlight-color:transparent}
button{cursor:pointer; border:0; background:none; color:inherit}
button:focus-visible,a:focus-visible{outline:3px solid #dfaa52; outline-offset:3px}
a{color:var(--green); text-decoration:none}
a.btn{text-decoration:none}
button:disabled{opacity:.55; cursor:wait}

/* ── 布局 ── */
.app{display:flex; min-height:100vh}
aside{width:222px; background:var(--nav); color:#b7c7bd; padding:32px 17px; position:fixed; inset:0 auto 0 0; display:flex; flex-direction:column}
main{margin-left:222px; width:calc(100% - 222px)}
header{height:78px; border-bottom:1px solid var(--line); padding:0 38px; display:flex; align-items:center; justify-content:space-between; background:#fafbf8}
.workspace{padding:32px 38px; max-width:1700px; margin:auto}
.footer-note{font-size:10px; color:#9aa397; margin:28px 0 0; display:flex; justify-content:space-between; gap:10px}

/* ── 品牌 ── */
.brand{display:flex; gap:11px; align-items:center; color:#fff; padding:0 10px 34px 4px; font-size:20px; font-weight:650; letter-spacing:1px}
.brand-logo{width:34px; height:34px; border-radius:8px; display:block; flex-shrink:0}
.brand-name{font-size:17px; color:#fff; font-weight:600; letter-spacing:.5px}
.nav-label{font-size:10px; letter-spacing:2px; padding:15px 14px 12px; color:#799489}

/* ── 导航 ── */
nav button{display:flex; align-items:center; gap:12px; width:100%; padding:13px 15px; text-align:left; border-radius:8px; margin:3px 0; font-size:13px; transition:all .15s ease}
nav button.active{background:#2a493b; color:#f4f7ec}
nav button:hover{background:#244235}
.ico{width:20px; height:20px; display:inline-flex; align-items:center; justify-content:center; flex-shrink:0}
.ico svg{width:18px; height:18px}
.sidebar-note{margin-top:auto; padding:18px 12px; border-top:1px solid #355044; font-size:11px; line-height:1.9; color:#92ab9a}
.profile{display:flex; align-items:center; gap:10px; margin:20px 10px 0; color:#e2e9df}
.avatar{display:inline-grid; place-items:center; width:30px; height:30px; border-radius:50%; background:#e6eee2; color:#557148; font-size:11px}
.profile small{display:block; color:#88a291; font-size:10px; margin-top:3px}
.user-role{font-size:10px; color:#99b49f}

/* ── 头部 ── */
.crumb{font-size:12px; color:#849087}
.crumb strong{color:#344b3c; font-weight:500}
.top-actions{display:flex; align-items:center; gap:18px; font-size:11px; color:var(--muted)}

/* ── 排版 ── */
.heading{display:flex; align-items:center; justify-content:space-between; gap:20px; margin-bottom:25px}
.eyebrow{font-size:10px; letter-spacing:2px; color:var(--green); font-weight:600; margin-bottom:9px}
h1{margin:0; font-size:27px; font-weight:600; letter-spacing:-.5px}
h2{font-size:16px; font-weight:600}
h3{font-size:14px}
p{line-height:1.8}
.subtitle{font-size:12px; color:var(--muted); margin:10px 0 0}

/* ── 按钮 ── */
.btn{display:inline-flex; align-items:center; justify-content:center; gap:7px; background:#fff; border:1px solid var(--line); border-radius:7px; padding:10px 15px; font-size:12px; white-space:nowrap; transition:all .15s ease}
.btn.primary{background:var(--green); border-color:var(--green); color:#fff}
.btn:hover{filter:brightness(.97); transform:translateY(-1px)}
.btn:active{transform:translateY(0); filter:brightness(.93)}
.link{color:var(--green); font-size:11px; cursor:pointer; background:none; border:0}

/* ── 标签 ── */
.tag{font-size:10px; padding:4px 7px; background:#eef2ed; border-radius:4px; color:#6f8072; display:inline-block}
.tag.green{background:#eaf3eb; color:#47805a}
.tag.orange{background:#fbf1df; color:#aa7a39}

/* ── 指标卡 ── */
.metrics{display:grid; grid-template-columns:repeat(4,1fr); gap:16px; margin-bottom:24px}
.metric{padding:21px 23px; background:#fff; border:1px solid var(--line); border-radius:var(--radius)}
.metric-label{font-size:12px; color:var(--muted); display:flex; justify-content:space-between}
.number{font:36px Georgia,serif; margin:13px 0 10px; letter-spacing:-1px}
.number small{font:12px sans-serif; color:var(--muted); margin-left:5px; letter-spacing:0}
.money-number{font-size:28px}
.metric-foot{font-size:10px; color:var(--muted)}
.warn{color:#b27830}

/* ── 面板 ── */
.columns{display:grid; grid-template-columns:minmax(0,1.65fr) minmax(280px,1fr); gap:22px}
.panel{background:#fff; border:1px solid var(--line); border-radius:var(--radius); overflow:hidden}
.panel-head{padding:22px 23px; display:flex; align-items:center; justify-content:space-between; gap:12px}

/* ── 任务列表 ── */
.task{display:flex; align-items:flex-start; gap:13px; padding:19px 23px; border-top:1px solid #eff1ed}
.task-title{font-size:12px; font-weight:550; cursor:pointer}
.task-meta{font-size:10px; color:var(--muted); margin-top:8px}
.task-time{font-size:10px; margin-left:auto; white-space:nowrap}
.check{width:18px; height:18px; border:1px solid #ccd8ce; border-radius:5px; flex:none; display:grid; place-items:center; color:var(--green); margin-top:1px}

/* ── 洞察 ── */
.insight{background:#eef3e8; padding:23px; border-radius:var(--radius); border:1px solid #dce7d5; margin-bottom:20px}
.insight .eyebrow{font-size:9px}
.insight p{font-size:12px; color:#5f725c; margin:14px 0 18px}

/* ── 漏斗 ── */
.funnel{padding:0 23px 24px}
.funnel-row{display:flex; gap:14px; align-items:center; font-size:11px; margin-top:20px}
.funnel-row>span{width:55px; color:var(--muted)}
.funnel-row b{width:20px; text-align:right; font-weight:500}

/* ── 搜索与过滤 ── */
.toolbar{display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:20px; flex-wrap:wrap}
.filters{display:flex; gap:6px; flex-wrap:wrap}
.filter{padding:8px 13px; border:1px solid transparent; border-radius:6px; font-size:12px; color:#7a887f; cursor:pointer}
.filter.on{background:#fff; border-color:var(--line); color:var(--green)}
.search{position:relative}
.search input{background:#fff; border:1px solid var(--line); border-radius:7px; padding:10px 14px; width:240px; color:var(--ink); font-size:12px}
.subnav{display:flex; gap:10px; flex-wrap:wrap; margin:0 0 22px}

/* ── 表格 ── */
table{width:100%; border-collapse:collapse; text-align:left}
th{font-size:10px; font-weight:500; color:#839083; padding:15px 20px; background:#fafbf8; white-space:nowrap}
td{padding:19px 20px; border-top:1px solid #eff1ed; font-size:11px}
td strong{display:block; font-weight:550; font-size:12px}
td small{display:block; color:var(--muted); margin-top:6px; font-size:10px}
tr.clickable{cursor:pointer}
tr.clickable:hover{background:#fbfcf9}
.table-wrap{overflow:auto}

/* ── 看板 ── */
.board{display:grid; grid-template-columns:repeat(7,minmax(190px,1fr)); gap:14px; overflow:auto; padding-bottom:15px}
.lane{background:#edf0ea; border-radius:10px; padding:13px; min-height:420px}
.lane-title{display:flex; justify-content:space-between; font-size:12px; padding:4px 0 17px}
.deal{width:100%; display:block; background:#fff; border:1px solid #e1e6dd; box-shadow:0 3px 8px #21302104; padding:16px; text-align:left; border-radius:9px; margin-bottom:12px; cursor:pointer}
.deal h3{font-size:12px; margin:11px 0}
.deal p{font-size:10px; color:var(--muted); margin:5px 0}
.deal-footer{display:flex;justify-content:space-between;align-items:center;margin-top:18px;font-size:10px;color:#668267}
.deal[draggable="true"]{cursor:grab}
.deal[draggable="true"]:active{cursor:grabbing;opacity:.55}
.lane.drag-over{background:#dce7d7;outline:2px dashed #9fbd97;outline-offset:-6px}

/* ── 知识库 ── */
.library{display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px}
.knowledge{background:#fff; border:1px solid var(--line); border-radius:12px; padding:23px; display:flex; flex-direction:column; text-align:left; min-height:228px; cursor:pointer; transition:border-color .2s}
.knowledge:hover{border-color:#a7bfa2}
.knowledge h3{font-size:16px; line-height:1.7; margin:15px 0 10px}
.knowledge p{font-size:12px; color:#839083; margin:0 0 22px}
.knowledge footer{font-size:10px;color:var(--muted);margin-top:auto;display:flex;justify-content:space-between;align-items:center}
.knowledge .hint{font-size:10px;color:var(--muted)}
.copy-btn{font-size:11px;padding:5px 10px}
.notice{padding:13px 17px; border:1px solid #e3e8d9; background:#f2f5ec; border-radius:8px; color:#788367; font-size:11px; line-height:1.8; margin-bottom:22px}

/* ── 弹窗/抽屉 ── */
.overlay{display:none; position:fixed; inset:0; background:#12221d55; z-index:10}
.overlay.open{display:block}
.drawer{position:absolute; right:0; top:0; height:100%; width:min(570px,100%); background:#fafbf8; overflow:auto; box-shadow:-10px 0 60px #14251e20; padding:30px}
.drawer-head{display:flex; justify-content:space-between; align-items:center; margin-bottom:25px}
.close{font-size:23px; color:#889488; padding:3px 9px}
.detail-heading{margin:18px 0 12px; font-size:24px}

/* ── 详情 ── */
.detail-grid{display:grid; grid-template-columns:1fr 1fr; gap:22px; background:#fff; border:1px solid var(--line); padding:22px; border-radius:10px; margin:23px 0}
.detail-grid label{display:block; font-size:10px; color:var(--muted); margin-bottom:8px}
.detail-grid b{font-size:12px; font-weight:500}
.detail-section{margin:25px 0}
.detail-section h3{margin-bottom:14px}
.detail-section p{font-size:12px; color:#6c7d6e}
.detail-actions{display:flex; gap:10px; flex-wrap:wrap; margin:22px 0}

/* ── 表单 ── */
.field{display:block; margin-bottom:17px; font-size:12px}
.field input,.field textarea,.field select{display:block; width:100%; border:1px solid #dce3d8; padding:11px; border-radius:7px; background:#fff; margin-top:8px; color:var(--ink)}
.field input:focus,.field select:focus,.field textarea:focus{outline:2px solid #9fbd97; border-color:#9fbd97}
.field textarea{min-height:90px; resize:vertical}
.field small{color:var(--muted)}
.field select[multiple]{min-height:90px}
.form-row{display:grid; grid-template-columns:1fr 1fr; gap:15px}
.checkline{display:flex; align-items:center; gap:10px; margin:18px 0}
.checkline input{width:18px; height:18px}
.error-box{background:#fff0e8; color:#a84d31; padding:14px; border-radius:8px; margin:15px 0}

/* ── Toast ── */
.toast{position:fixed; bottom:28px; left:50%; transform:translateX(-50%); padding:13px 22px; background:#203c2f; color:#fff; border-radius:9px; font-size:12px; z-index:25; box-shadow:0 5px 25px #0002; display:none; max-width:90%; line-height:1.6}
.toast.show{display:block}

/* ── 时间线 ── */
.timeline{border-left:1px solid #cfdbca; padding-left:18px; margin:20px 0; overflow-wrap:anywhere}
.timeline article{margin-bottom:22px; position:relative}
.timeline article:before{content:''; position:absolute; left:-22px; top:5px; width:7px; height:7px; background:#91ad86; border-radius:50%}
.timeline small{font-size:10px; color:var(--muted)}
.timeline p{font-size:12px; margin:6px 0}

/* ── 设置 ── */
.connect-grid{display:grid; grid-template-columns:repeat(3,1fr); gap:17px; margin-top:21px}
.connector{padding:23px; border:1px solid var(--line); background:#fff; border-radius:12px}
.connector-head{display:flex; gap:13px; align-items:center}
.connector p{font-size:12px; color:var(--muted); min-height:62px; margin:17px 0}
.logo{width:39px; height:39px; display:grid; place-items:center; background:#e9f1fb; color:#4779af; border-radius:11px; font-weight:650; font-size:18px}
.section-row{display:flex; align-items:center; justify-content:space-between; margin:28px 0 17px}

/* ── 空状态 ── */
.view-empty{padding:35px; text-align:center; color:var(--muted)}
.empty{padding:50px; text-align:center; color:var(--muted)}
.hidden{display:none!important}

/* ── 工具类 ── */
.status{font-size:10px; color:var(--muted)}
.audit-note{font-size:11px; color:var(--muted)}
.preview-text{white-space:pre-wrap; overflow-wrap:anywhere}
.login-note{font-size:11px; color:var(--muted); line-height:1.8}
body.dialog-open{overflow:hidden}
#library-state{border:1px solid var(--line); border-radius:6px; background:#fff; padding:8px; color:var(--ink)}

/* ── MCP ── */
.config-code{font:11px/1.8 ui-monospace,monospace; background:#f2f5ee; border:1px solid var(--line); border-radius:8px; padding:15px; white-space:pre-wrap; overflow-wrap:anywhere; word-break:break-word; color:#31533d; max-width:100%}
.integration-top{display:flex; align-items:center; justify-content:space-between; padding:22px; background:#e9f0e5; border-radius:12px; margin-bottom:24px; gap:20px}
.switch{display:flex; background:#dce7d7; padding:4px; border-radius:8px}
.switch button{padding:10px 20px; border-radius:6px; font-size:12px}
.switch .selected{background:#fff; color:var(--green); box-shadow:0 2px 4px #00000008}

/* ── 响应式 ── */
@media(min-width:1500px){.workspace{padding-top:40px}}
@media(max-width:1100px){
  aside{width:185px; padding-left:10px; padding-right:10px}
  main{margin-left:185px; width:calc(100% - 185px)}
  .workspace{padding:25px}
  .columns{grid-template-columns:1.3fr 1fr}
  .metric{padding:17px}
  .library,.connect-grid{grid-template-columns:repeat(2,1fr)}
  header{padding:0 25px}
}
@media(max-width:760px){
  aside{position:static; width:100%; padding:15px; display:block}
  .brand{padding:0 0 16px; font-size:16px}
  .sidebar-note,.profile,.nav-label{display:none}
  .app{display:block}
  nav{display:flex; overflow:auto; gap:3px}
  nav button{white-space:nowrap; width:auto; padding:9px; font-size:11px; gap:5px}
  .ico{width:15px; height:15px}
  .ico svg{width:14px; height:14px}
  main{margin:0; width:100%}
  header{height:55px; padding:0 18px}
  .workspace{padding:22px 16px}
  .heading{align-items:flex-start}
  h1{font-size:23px}
  .subtitle{font-size:11px}
  .metrics{grid-template-columns:repeat(2,1fr); gap:10px}
  .columns{grid-template-columns:1fr}
  .library,.connect-grid{grid-template-columns:1fr}
  .number{font-size:30px}
  .toolbar{align-items:flex-start}
  .search,.search input{width:100%}
  .filters{flex-wrap:wrap}
  .drawer{padding:23px}
  .footer-note{display:block}
  .board{grid-template-columns:repeat(5,220px)}
  .form-row{grid-template-columns:1fr}
  .metric-foot{line-height:1.7}
}
