/* ============================================================
 * styles.css — 智能化投标管理工具 全局样式（南网绿主题）
 * ============================================================ */
:root {
  --green: #00786b; --green-d: #005a50; --green-l: #e6f4f2;
  --bg: #f4f7f6; --panel: #ffffff; --line: #e4ecea;
  --ink: #1f2d2b; --ink2: #4f6663; --ink3: #8aa09d;
  --blue: #2563eb; --orange: #d97706; --red: #dc2626; --purple: #7c3aed; --gray: #6b7280;
  --radius: 10px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif; background: var(--bg); color: var(--ink); font-size: 14px; }
a { text-decoration: none; color: inherit; }
.link { color: var(--green); cursor: pointer; font-weight: 600; }
.link:hover { text-decoration: underline; }
.muted { color: var(--ink3); }
.red-text { color: var(--red); font-weight: 600; }
.ic { width: 16px; height: 16px; flex-shrink: 0; }

/* ---------- 登录 ---------- */
.login-wrap { position: fixed; inset: 0; background: linear-gradient(135deg, var(--green-d), var(--green) 60%, #0a9a88); display: flex; align-items: center; justify-content: center; z-index: 200; }
.login-box { background: #fff; border-radius: 16px; padding: 34px 38px; width: 860px; max-width: 94vw; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.login-logo { font-size: 26px; font-weight: 800; color: var(--green-d); display: flex; align-items: center; gap: 10px; }
.login-logo svg { width: 30px; height: 30px; color: var(--green); }
.login-sub { color: var(--ink2); margin: 8px 0 20px; }
.login-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.login-card { border: 1.5px solid var(--line); border-radius: var(--radius); padding: 14px; cursor: pointer; transition: all .15s; }
.login-card:hover { border-color: var(--green); background: var(--green-l); transform: translateY(-2px); }
.login-name { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.login-role { margin-bottom: 4px; }

/* ---------- 框架 ---------- */
.frame { height: 100vh; display: flex; flex-direction: column; }
.topbar { height: 54px; background: linear-gradient(90deg, var(--green-d), #0a8f7e); color: #fff; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; flex-shrink: 0; box-shadow: 0 1px 6px rgba(0,0,0,.12); }
.brand { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 9px; letter-spacing: .5px; }
.brand svg { width: 20px; height: 20px; }
.top-right { display: flex; align-items: center; gap: 8px; }
.user-chip { font-size: 13px; opacity: .95; margin-right: 6px; }
.bell { position: relative; cursor: pointer; opacity: .92; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; transition: background .15s; }
.bell:hover { background: rgba(255,255,255,.16); }
.bell svg { width: 17px; height: 17px; }
.badge { position: absolute; top: 2px; right: 1px; background: var(--red); color: #fff; font-size: 10px; border-radius: 9px; min-width: 16px; height: 16px; display: inline-flex; align-items: center; justify-content: center; padding: 0 4px; font-style: normal; }
.body { flex: 1; display: flex; min-height: 0; }
.sidebar { width: 208px; background: #fff; border-right: 1px solid var(--line); overflow-y: auto; padding: 14px 10px; flex-shrink: 0; }
.sidebar::-webkit-scrollbar { width: 5px; }
.sidebar::-webkit-scrollbar-thumb { background: #d8e4e1; border-radius: 3px; }
.side-cap { font-size: 11px; color: var(--ink3); font-weight: 700; letter-spacing: 2px; padding: 0 12px 8px; }
.nav-group { margin-bottom: 2px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; margin: 2px 4px; border-radius: 8px; color: var(--ink2); cursor: pointer; font-weight: 600; font-size: 13.5px; position: relative; transition: background .15s, color .15s; }
.nav-item:hover { background: var(--green-l); color: var(--green-d); }
.nav-item.on { background: var(--green); color: #fff; box-shadow: 0 2px 8px rgba(0,120,107,.28); }
.nav-sub { margin: 2px 10px 8px 26px; border-left: 2px solid var(--green-l); padding-left: 5px; display: flex; flex-direction: column; gap: 1px; }
.nav-sub .nav-item { padding: 7px 10px; font-weight: 500; font-size: 13px; margin: 0; }
.nav-sub .nav-item.on { background: var(--green-l); color: var(--green-d); box-shadow: none; }
.main { flex: 1; overflow-y: auto; padding: 18px 22px 40px; }

/* ---------- 页面通用 ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; gap: 12px; flex-wrap: wrap; }
.page-title { font-size: 19px; font-weight: 800; }
.page-sub { color: var(--ink3); margin-top: 4px; font-size: 12.5px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumb { color: var(--ink3); font-size: 12.5px; margin-bottom: 8px; }
.crumb .link { cursor: pointer; }

.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; }
.panel.hl { border-color: var(--green); box-shadow: 0 0 0 2px var(--green-l); }
.panel.disabled { opacity: .55; }
.panel-title { font-weight: 700; margin-bottom: 10px; font-size: 14.5px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-2 .panel { margin-bottom: 0; }
.grid-side { display: grid; grid-template-columns: 260px 1fr; gap: 14px; }

/* ---------- 按钮 ---------- */
.btn { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 8px; padding: 8px 14px; cursor: pointer; font-size: 13.5px; font-weight: 600; transition: all .12s; }
.btn:hover { border-color: var(--green); color: var(--green-d); }
.btn-primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-d); color: #fff; }
.btn-danger { background: #fff; border-color: #fecaca; color: var(--red); }
.btn-danger:hover { background: #fef2f2; border-color: var(--red); color: var(--red); }
.btn-outline { border-color: var(--green); color: var(--green-d); background: #fff; }
.btn-warn { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink2); }
.btn.sm { padding: 4px 9px; font-size: 12.5px; border-radius: 6px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- 表格 ---------- */
.tbl-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; background: #f8faf9; color: var(--ink2); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid #f0f4f3; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: #fafcfb; }
.empty { padding: 34px; text-align: center; color: var(--ink3); background: #fff; border: 1px dashed var(--line); border-radius: var(--radius); }
.panel .empty { border: none; background: transparent; }

/* ---------- 标签 ---------- */
.tag { display: inline-flex; align-items: center; border-radius: 6px; padding: 2px 8px; font-size: 12px; font-weight: 600; background: #eef2f1; color: var(--ink2); white-space: nowrap; }
.tag.blue { background: #e0eaff; color: var(--blue); }
.tag.green { background: #dcf5e7; color: #047857; }
.tag.orange { background: #fdeeda; color: var(--orange); }
.tag.red { background: #fee2e2; color: var(--red); }
.tag.gray { background: #eef2f1; color: var(--gray); }
.tag.purple { background: #ede9fe; color: var(--purple); }

/* ---------- 表单 ---------- */
.ui-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.f-item { display: flex; flex-direction: column; gap: 5px; }
.f-item.half { grid-column: span 1; }
.f-item:has([data-fkey]) { }
.f-label { font-size: 12.5px; color: var(--ink2); font-weight: 600; }
.req { color: var(--red); font-style: normal; }
.f-ctrl .ipt, .f-ctrl input, .f-ctrl select, .f-ctrl textarea { width: 100%; }
.ipt { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13.5px; background: #fff; color: var(--ink); outline: none; }
.ipt:focus { border-color: var(--green); box-shadow: 0 0 0 2px var(--green-l); }
.ipt.sm { padding: 5px 8px; font-size: 12.5px; }
textarea.ipt { resize: vertical; }
.f-note { color: var(--ink3); font-size: 12px; line-height: 1.6; }
.f-static { padding: 8px 0; color: var(--ink2); }
.chk { display: flex; gap: 6px; align-items: center; cursor: pointer; }

/* ---------- 弹窗 ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; align-items: flex-start; justify-content: center; background: rgba(15,40,36,.45); overflow-y: auto; padding: 6vh 16px 16px; }
#confirmWrap { z-index: 120; }
.modal { background: #fff; border-radius: 14px; width: 680px; max-width: 96vw; box-shadow: 0 18px 50px rgba(0,0,0,.22); animation: pop .16s ease-out; }
@keyframes pop { from { transform: translateY(8px); opacity: .6; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); font-weight: 800; font-size: 15px; }
.modal-head.danger { color: var(--red); }
.modal-x { cursor: pointer; color: var(--ink3); font-size: 15px; }
.modal-body { padding: 16px 18px; max-height: 66vh; overflow-y: auto; }
.modal-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.confirm-text { line-height: 1.8; }

/* ---------- 标签页 ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--line); margin-bottom: 0; flex-wrap: wrap; }
.tab { padding: 9px 14px; cursor: pointer; color: var(--ink2); font-weight: 600; border-radius: 8px 8px 0 0; font-size: 13.5px; }
.tab:hover { color: var(--green-d); background: var(--green-l); }
.tab.on { color: var(--green-d); box-shadow: inset 0 -2px 0 var(--green); background: var(--green-l); }
/* ---------- 台账详情：纵向页签 ---------- */
.ld-layout { display: flex; gap: 14px; align-items: flex-start; }
.ld-tabs { display: flex; flex-direction: column; width: 150px; flex-shrink: 0; gap: 2px; position: sticky; top: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 6px; box-shadow: 0 1px 4px rgba(0,0,0,.04); }
.ld-tabs .tab { position: relative; padding: 9px 12px 9px 16px; border-radius: 7px; font-size: 13px; color: var(--ink2); white-space: nowrap; }
.ld-tabs .tab:hover { color: var(--green-d); background: var(--green-l); }
.ld-tabs .tab.on { background: var(--green-l); color: var(--green-d); box-shadow: none; font-weight: 700; }
.ld-tabs .tab.on::before { content: ''; position: absolute; left: 4px; top: 22%; bottom: 22%; width: 3px; border-radius: 2px; background: var(--green); }
.ld-panel { flex: 1; min-width: 0; }
.arch-stage { margin-bottom: 14px; }
.arch-stage-head { font-weight: 700; margin-bottom: 8px; }

/* ---------- 卡片 / 统计 ---------- */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; cursor: default; }
.stat-card.blue .stat-num { color: var(--blue); } .stat-card.green .stat-num { color: #047857; }
.stat-card.orange .stat-num { color: var(--orange); } .stat-card.red .stat-num { color: var(--red); }
.stat-card.purple .stat-num { color: var(--purple); }
.stat-num { font-size: 22px; font-weight: 800; }
.stat-label { color: var(--ink3); font-size: 12.5px; margin-top: 3px; }

/* ---------- KV ---------- */
.kv-grid { display: grid; gap: 10px 18px; }
.kv { border-bottom: 1px dashed #eef2f1; padding-bottom: 6px; }
.kv-l { color: var(--ink3); font-size: 12px; margin-bottom: 2px; }
.kv-v { font-size: 13.5px; font-weight: 600; line-height: 1.5; }

/* ---------- 时间轴 ---------- */
.timeline { position: relative; padding-left: 18px; }
.tl-item { position: relative; padding: 0 0 14px 12px; border-left: 2px solid var(--green-l); }
.tl-item:last-child { border-left-color: transparent; }
.tl-dot { position: absolute; left: -7px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--green); border: 2.5px solid #fff; box-shadow: 0 0 0 1.5px var(--green-l); }
.tl-head { font-weight: 700; font-size: 13.5px; }
.tl-time { color: var(--ink3); font-weight: 500; font-size: 12px; margin-left: 8px; }
.tl-desc { color: var(--ink2); font-size: 12.5px; margin-top: 3px; line-height: 1.7; }

/* ---------- 工作台待办 ---------- */
.todo-list { display: flex; flex-direction: column; gap: 8px; }
.todo-item { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; cursor: pointer; font-weight: 600; transition: all .12s; }
.todo-item:hover { border-color: var(--green); transform: translateX(3px); }
.todo-item.orange { border-left: 4px solid var(--orange); }
.todo-item.red { border-left: 4px solid var(--red); }
.todo-item.blue { border-left: 4px solid var(--blue); }
.todo-num { font-size: 18px; font-weight: 800; color: var(--green-d); min-width: 26px; }
.todo-go { margin-left: auto; color: var(--ink3); display: inline-flex; }
.todo-go .ic { width: 14px; height: 14px; }
.msg-item { padding: 10px 6px; border-bottom: 1px dashed var(--line); cursor: pointer; }
.msg-item:last-child { border-bottom: none; }
.msg-item.un { background: #fffdf3; }
.msg-title { font-weight: 700; font-size: 13.5px; }
.msg-body { color: var(--ink2); font-size: 12.5px; margin-top: 3px; line-height: 1.6; }
.msg-time { color: var(--ink3); font-size: 12px; margin-top: 3px; }

/* ---------- 提示 ---------- */
.toast-box { position: fixed; top: 66px; right: 20px; z-index: 300; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--green-d); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13px; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.18); animation: slidein .2s ease-out; max-width: 420px; }
.toast.warn { background: var(--orange); }
.toast.err { background: var(--red); }
.toast.out { opacity: 0; transform: translateX(20px); transition: all .3s; }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- 向导步骤 ---------- */
.steps { display: flex; gap: 10px; margin-bottom: 12px; }
.steps span { background: #fff; border: 1px solid var(--line); color: var(--ink3); border-radius: 20px; padding: 6px 16px; font-weight: 700; font-size: 13px; }
.steps span.on { background: var(--green); border-color: var(--green); color: #fff; }

/* ---------- 商机阶段条 ---------- */
.stage-bar { display: flex; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; flex-wrap: wrap; gap: 4px; }
.stage { text-align: center; padding: 6px 10px; border-radius: 8px; }
.stage-name { font-weight: 700; font-size: 12.5px; color: var(--ink3); }
.stage.done .stage-name { color: var(--green-d); }
.stage.cur { background: var(--green-l); }
.stage.cur .stage-name { color: var(--green-d); font-size: 13.5px; }
.stage-days { font-size: 11px; color: var(--orange); }
.stage-arrow { color: var(--ink3); }

/* ---------- 干系人图谱 ---------- */
.stake-tree { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stake-root { background: var(--green); color: #fff; display: inline-block; padding: 8px 18px; border-radius: 8px; font-weight: 700; }
.stake-node { margin: 14px 0 0 34px; display: flex; align-items: center; gap: 10px; position: relative; }
.stake-node::before { content: ''; position: absolute; left: -20px; top: -12px; width: 18px; height: 26px; border-left: 2px solid var(--green-l); border-bottom: 2px solid var(--green-l); }
.stake-card { background: #f8faf9; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }

/* ---------- 审查行 ---------- */
.check-row { display: flex; gap: 12px; align-items: flex-start; padding: 9px 6px; border-bottom: 1px dashed var(--line); }
.check-row.bad { background: #fff7f7; }
.check-text { flex: 1; line-height: 1.7; font-size: 13px; }
.check-ops { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.layer-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px; }
.layer-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.layer-head b { font-size: 15px; }
.result-btns { display: flex; gap: 10px; flex-wrap: wrap; margin: 8px 0; }
.gate-bar { background: #f8faf9; border: 1px dashed var(--line); color: var(--ink3); border-radius: 8px; padding: 7px 12px; font-size: 12.5px; margin-bottom: 10px; display: flex; align-items: center; gap: 7px; }
.gate-bar .ic { width: 14px; height: 14px; }
.must-do { background: #fff8f0; border: 1px solid #fde3c3; border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.must-do .ic { width: 15px; height: 15px; color: var(--orange); }
.must-do.warn { background: #fffdf3; border-color: #f5e6a8; }
.warn-note { color: var(--orange); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.warn-note .ic { width: 14px; height: 14px; }
.pager { display: flex; gap: 6px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.pg-btn { min-width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; font-size: 12.5px; padding: 0 7px; background: #fff; color: var(--ink2); font-weight: 600; }
.pg-btn:hover { border-color: var(--green); color: var(--green-d); }
.pg-btn.on { background: var(--green); border-color: var(--green); color: #fff; }
.pg-btn.dis { opacity: .4; pointer-events: none; }
.pg-ellipsis { color: var(--ink3); }
/* ---------- 附件预览 ---------- */
.pv-meta { margin-bottom: 10px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pv-page { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 6px; min-height: 300px; padding: 28px 26px; box-shadow: 0 2px 10px rgba(0,0,0,.06); overflow: hidden; }
.pv-doc-type { display: inline-block; background: var(--green-l); color: var(--green-d); font-weight: 700; font-size: 12px; border-radius: 4px; padding: 2px 8px; }
.pv-doc-name { font-size: 17px; font-weight: 800; margin-top: 12px; }
.pv-doc-line { width: 56px; height: 3px; background: var(--green); margin: 10px 0 14px; }
.pv-doc-meta { color: var(--ink2); font-size: 12.5px; line-height: 1.8; }
.pv-doc-text { margin-top: 26px; color: var(--ink3); font-size: 12.5px; border-top: 1px dashed var(--line); padding-top: 16px; line-height: 1.9; }
.pv-wm { position: absolute; right: 18px; bottom: 12px; font-size: 42px; font-weight: 800; color: rgba(0,120,107,.08); transform: rotate(-18deg); pointer-events: none; white-space: nowrap; }
.people-pick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; border: 1px solid var(--line); border-radius: 8px; padding: 10px; max-height: 220px; overflow-y: auto; }
.pp-item { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; font-size: 12.5px; transition: all .12s; }
.pp-item:hover { border-color: var(--green); }
.pp-item.on { border-color: var(--green); background: var(--green-l); }
.pp-item input { margin: 0; }
.pp-name { font-weight: 600; color: var(--ink); }
.pp-role { color: var(--ink3); margin-left: auto; font-size: 11.5px; }
input[type="datetime-local"] { min-height: 34px; }
.seq-chip { background: var(--green-d); color: #fff; border-radius: 8px; padding: 3px 10px; font-size: 14px; vertical-align: 3px; }
.dict-item { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; cursor: pointer; }
.dict-item:hover { border-color: var(--green); }
.dict-item.on { border-color: var(--green); background: var(--green-l); }
.row-edit { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; }
.row-edit-head { display: flex; justify-content: flex-end; margin-bottom: 6px; }
.spin { width: 34px; height: 34px; border: 3.5px solid var(--green-l); border-top-color: var(--green); border-radius: 50%; margin: 0 auto; animation: rot .8s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: flex; align-items: center; gap: 10px; }
.bar-label { width: 130px; font-size: 12.5px; color: var(--ink2); text-align: right; flex-shrink: 0; }
.bar-track { flex: 1; background: #eef2f1; border-radius: 6px; height: 16px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--green); border-radius: 6px; min-width: 2px; }
.bar-fill.blue { background: var(--blue); } .bar-fill.green { background: #059669; }
.bar-fill.red { background: var(--red); } .bar-fill.orange { background: var(--orange); }
.bar-val { width: 70px; font-size: 12.5px; font-weight: 700; color: var(--ink2); }

@media (max-width: 1000px) {
  .grid-2, .grid-side, .login-grid { grid-template-columns: 1fr; }
  .sidebar { width: 150px; }
  .ld-layout { flex-direction: column; }
  .ld-tabs { flex-direction: row; width: 100%; flex-wrap: wrap; position: static; }
}

.cost-items-box { border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.cost-head { display: flex; gap: 8px; font-size: 12px; color: var(--ink3); font-weight: 600; margin-bottom: 6px; }
.cost-head span:first-child { flex: 1; }
.cost-head span:nth-child(2) { width: 120px; }
.cost-row { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.cost-row .ipt:first-child { flex: 1; }
.cost-row .ipt:nth-child(2) { width: 120px; }
