/* =========================================================
   内部运营后台（Web）公共样式 —— 浅色专业 / 高信息密度
   ========================================================= */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { font-family: var(--font); background: var(--a-bg); color: var(--a-text); font-size: 14px; }
a { text-decoration: none; color: inherit; }
button { font-family: var(--font); cursor: pointer; border: none; background: none; color: inherit; }
img { display: block; }
ul { list-style: none; }

/* 布局：左导航 + 主区 */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 224px; background: var(--a-sidebar); color: var(--a-sidebar-text); flex: 0 0 224px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 16px; border-bottom: 1px solid rgba(255,255,255,.06); }
.side-brand .lg { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(120deg, #7C4DFF, #FF2E88); display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 15px; }
.side-brand .tt { color: #fff; font-weight: 700; font-size: 14px; }
.side-brand .st { font-size: 10px; color: #6d6d7c; margin-top: 1px; letter-spacing: .5px; }
.side-nav { padding: 12px 10px; flex: 1; }
.nav-g { font-size: 10.5px; color: #565664; letter-spacing: 1.5px; padding: 14px 10px 6px; }
.nav-i { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; font-size: 13px; color: var(--a-sidebar-text); margin-bottom: 2px; transition: background .12s; cursor: pointer; }
.nav-i .ni { width: 17px; text-align: center; color: #6f6f7e; }
.nav-i:hover { background: rgba(255,255,255,.05); color: #d6d6de; }
.nav-i.on { background: linear-gradient(90deg, rgba(124,77,255,.28), rgba(124,77,255,.08)); color: #fff; font-weight: 600; }
.nav-i.on .ni { color: #B3A2FF; }
.side-user { border-top: 1px solid rgba(255,255,255,.06); padding: 12px 14px; display: flex; gap: 10px; align-items: center; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(120deg,#7C4DFF,#FF2E88); display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 700; flex: 0 0 30px; }
.side-user .un { font-size: 12.5px; color: #e8e8ee; }
.side-user .ur { font-size: 10.5px; color: #6d6d7c; margin-top: 1px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 58px; background: #fff; border-bottom: 1px solid var(--a-line); display: flex; align-items: center; gap: 14px; padding: 0 22px; position: sticky; top: 0; z-index: 40; }
.topbar .pg { font-size: 15px; font-weight: 700; }
.topbar .crumb { font-size: 12px; color: var(--a-text-3); }
.search { flex: 0 0 300px; margin-left: auto; position: relative; }
.search input { width: 100%; height: 34px; background: var(--a-bg); border: 1px solid transparent; border-radius: 8px; padding: 0 12px 0 32px; font-size: 13px; outline: none; font-family: var(--font); }
.search input:focus { border-color: var(--a-primary); background: #fff; }
.search .sic { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--a-text-3); display: flex; }
.role-sel { display: flex; align-items: center; gap: 8px; background: var(--a-bg); border-radius: 8px; padding: 5px 10px; font-size: 12px; color: var(--a-text-2); }
.role-sel select { border: none; background: transparent; font-size: 12.5px; color: var(--a-text); outline: none; font-family: var(--font); font-weight: 600; cursor: pointer; }
.bell { position: relative; width: 34px; height: 34px; border-radius: 8px; background: var(--a-bg); display: grid; place-items: center; color: var(--a-text-2); }
.bell .bdg { position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; background: var(--c-error); border-radius: 50%; border: 1.5px solid #fff; }
.logout { font-size: 12px; color: var(--a-text-2); cursor: pointer; padding: 6px 10px; border-radius: 8px; background: var(--a-bg); white-space: nowrap; }
.logout:hover { color: var(--c-error); }

.content { padding: 20px 22px 40px; flex: 1; }
.page-hd { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; gap: 16px; flex-wrap: wrap; }
.page-hd h1 { font-size: 20px; font-weight: 800; }
.page-hd .desc { font-size: 12.5px; color: var(--a-text-2); margin-top: 4px; }
.page-hd .ops { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- 组件 ---------- */
.card { background: var(--a-card); border: 1px solid var(--a-line); border-radius: var(--a-radius); padding: 16px; margin-bottom: 16px; }
.card-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card-hd h3 { font-size: 14.5px; font-weight: 700; }
.card-hd .extra { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--a-text-3); }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; transition: all .12s; white-space: nowrap; border: 1px solid transparent; }
.btn:hover { opacity: .9; }
.btn-p { background: var(--a-primary); color: #fff; }
.btn-pg { background: linear-gradient(120deg,#7C4DFF,#FF2E88); color: #fff; }
.btn-o { border-color: var(--a-line); background: #fff; color: var(--a-text); }
.btn-d { color: var(--a-text-3); }
.btn-danger { color: var(--c-error); }
.btn-danger-solid { background: #FEE9E9; color: #D63A3A; }
.btn-warn { background: #FFF3DC; color: #B26A00; }
.btn-ok { background: #E1F7F0; color: #00845F; }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn-xs { padding: 3px 8px; font-size: 11px; border-radius: 5px; }

/* 表格 */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 12px; color: var(--a-text-2); font-weight: 500; padding: 9px 12px; background: #FAFAFC; border-bottom: 1px solid var(--a-line); white-space: nowrap; }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--a-line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: #FBFAFF; }
.tbl .tt { font-weight: 600; font-size: 13px; }
.tbl .tt2 { font-size: 11.5px; color: var(--a-text-3); margin-top: 2px; }
.tbl .ops-td { white-space: nowrap; text-align: right; }
.tbl .ops-td .btn { margin-left: 6px; }
.cell-name { display: flex; align-items: center; gap: 10px; }
.thumb { width: 40px; height: 40px; border-radius: 8px; display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 800; flex: 0 0 40px; }
.thumb-lg { width: 54px; height: 54px; border-radius: 10px; }

/* 状态标签（与第7章枚举对应） */
.st { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.st .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-draft { color: #7c7c88; background: #F0F0F4; }
.st-ok { color: #00845F; background: #E1F7F0; }
.st-ok.bd { border: 1px solid #BDEBDD; }
.st-warn { color: #B26A00; background: #FFF3DC; }
.st-err { color: #D63A3A; background: #FEE9E9; }
.st-info { color: #4F46E5; background: #EEEDFD; }
.st-pink { color: #C2255C; background: #FDE7EF; }

/* 指标卡 */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.kpi { background: #fff; border: 1px solid var(--a-line); border-radius: 12px; padding: 15px 16px; position: relative; overflow: hidden; }
.kpi::after { content: ""; position: absolute; right: -18px; top: -18px; width: 74px; height: 74px; border-radius: 50%; background: var(--kw, #EEEDFD); opacity: .7; }
.kpi .k-lb { font-size: 12px; color: var(--a-text-2); display: flex; align-items: center; gap: 6px; }
.kpi .k-v { font-size: 24px; font-weight: 800; margin-top: 8px; font-variant-numeric: tabular-nums; }
.kpi .k-v small { font-size: 12px; color: var(--a-text-3); font-weight: 400; margin-left: 2px; }
.kpi .k-d { font-size: 11px; color: var(--a-text-3); margin-top: 6px; }
.trend-up { color: #00845F; }
.trend-down { color: #D63A3A; }

/* 任务卡（工作台待办） */
.todo-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; }
.todo-card { background: #fff; border: 1px solid var(--a-line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; cursor: pointer; transition: transform .12s, box-shadow .12s; }
.todo-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(30,30,60,.07); }
.todo-card .t-num { font-size: 26px; font-weight: 800; }
.todo-card .t-lb { font-size: 13px; font-weight: 600; }
.todo-card .t-desc { font-size: 11.5px; color: var(--a-text-3); line-height: 1.5; }
.todo-card .t-go { font-size: 11.5px; color: var(--a-primary); font-weight: 600; }

/* 筛选栏 */
.filter-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.f-input { height: 32px; border: 1px solid var(--a-line); border-radius: 7px; padding: 0 10px; font-size: 12.5px; background: #fff; color: var(--a-text); outline: none; font-family: var(--font); min-width: 160px; }
.f-input:focus { border-color: var(--a-primary); }
.f-select { height: 32px; border: 1px solid var(--a-line); border-radius: 7px; padding: 0 8px; font-size: 12.5px; background: #fff; color: var(--a-text); outline: none; font-family: var(--font); }
.f-pagination { display: flex; align-items: center; justify-content: space-between; padding-top: 12px; font-size: 12px; color: var(--a-text-2); }
.page-nav { display: flex; gap: 6px; }
.page-nav .pn { min-width: 26px; height: 26px; padding: 0 6px; border-radius: 6px; border: 1px solid var(--a-line); background: #fff; display: grid; place-items: center; font-size: 12px; }
.page-nav .pn.on { background: var(--a-primary); border-color: var(--a-primary); color: #fff; }
.page-nav .pn.dim { color: var(--a-text-3); }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(20,20,40,.45); z-index: 100; display: flex; align-items: center; justify-content: center; }
.modal { width: 480px; max-width: calc(100vw - 40px); max-height: 86vh; overflow-y: auto; background: #fff; border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,.18); animation: pop .16s ease; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } }
.modal.w-lg { width: 760px; }
.modal-hd { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 0; }
.modal-hd h3 { font-size: 15px; font-weight: 700; }
.modal-hd .x { width: 28px; height: 28px; border-radius: 8px; background: var(--a-bg); display: grid; place-items: center; color: var(--a-text-2); cursor: pointer; }
.modal-bd { padding: 14px 18px; }
.modal-ft { display: flex; justify-content: flex-end; gap: 10px; padding: 0 18px 16px; }
.m-field { margin-bottom: 14px; }
.m-field label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; color: var(--a-text); }
.m-field label .req { color: #D63A3A; margin-left: 2px; }
.m-field .f-hint { font-size: 11.5px; color: var(--a-text-3); margin-top: 5px; line-height: 1.5; }
.m-input { width: 100%; height: 34px; border: 1px solid var(--a-line); border-radius: 7px; padding: 0 10px; font-size: 13px; outline: none; font-family: var(--font); }
.m-input:focus { border-color: var(--a-primary); }
textarea.m-input { height: 74px; padding: 9px 10px; resize: none; line-height: 1.6; }
.m-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* 弹层内报价行 */
.q-row { display: grid; grid-template-columns: 120px 1fr 1fr 1fr 1fr; gap: 8px; align-items: center; margin-bottom: 8px; }
.q-row.hd { font-size: 11px; color: var(--a-text-3); font-weight: 600; }
.q-row .m-input { min-width: 0; }

/* 表单详情布局 */
.desc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }
.desc-item { display: flex; gap: 10px; padding: 7px 0; font-size: 13px; border-bottom: 1px dashed #F0F0F4; }
.desc-item .k { color: var(--a-text-3); flex: 0 0 84px; }
.desc-item .v { font-weight: 500; }
.desc-item .v.weak { color: var(--a-text-2); font-weight: 400; }

/* toast */
.toast { position: fixed; top: 26px; left: 50%; transform: translateX(-50%) translateY(-8px); background: #1d1d2b; color: #fff; padding: 10px 20px; border-radius: 9px; font-size: 13px; z-index: 200; opacity: 0; transition: all .2s; box-shadow: 0 10px 30px rgba(0,0,0,.2); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 成本可见性 */
.cost-hide { filter: blur(6px); user-select: none; pointer-events: none; position: relative; display: inline-block; }
.cost-hide::after { content: "🔒 无权限"; font-size: 10px; color: #aaa; position: absolute; inset: 0; display: grid; place-items: center; letter-spacing: 1px; }
.cost-val { font-variant-numeric: tabular-nums; }

/* 审计时间线 */
.timeline { position: relative; padding-left: 20px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--a-line); }
.tl-item { position: relative; padding: 0 0 16px 8px; }
.tl-item::before { content: ""; position: absolute; left: -18px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 3px solid var(--a-primary); }
.tl-item.rej::before { border-color: #D63A3A; }
.tl-item.warn::before { border-color: #FFB020; }
.tl-item .tl-t { font-size: 13px; font-weight: 600; }
.tl-item .tl-s { font-size: 12px; color: var(--a-text-2); margin-top: 2px; }
.tl-item .tl-m { font-size: 12px; color: var(--a-text-3); margin-top: 4px; line-height: 1.6; background: var(--a-bg); border-radius: 8px; padding: 8px 10px; }
.tl-item .tl-time { font-size: 11px; color: var(--a-text-3); margin-top: 4px; }
.tl-ops { display: flex; gap: 8px; margin-top: 8px; }

/* 比价表高亮 */
.qcmp thead .win { background: #F1FBF6; }
.qcmp tr.win td { background: #F5FCF9; }
.win-mark { color: #00845F; font-weight: 800; }

.progress { height: 6px; border-radius: 4px; background: var(--a-line); overflow: hidden; width: 120px; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg,#7C4DFF,#FF2E88); border-radius: 4px; }

.empty { text-align: center; color: var(--a-text-3); font-size: 13px; padding: 46px 0; }
.empty .ei { font-size: 30px; margin-bottom: 8px; display: block; }

/* 补充：演示分段切换 / 灰色标签 / 核销码 / 提示条 / 柱条 */
.seg { display: inline-flex; background: #EFEFF4; border-radius: 10px; padding: 3px; gap: 2px; margin-bottom: 14px; flex-wrap: wrap; }
.seg button { padding: 7px 15px; border-radius: 8px; font-size: 12.5px; color: #6B6B76; font-weight: 600; background: transparent; }
.seg button:hover { color: #1A1A1A; }
.seg button.on { background: #fff; color: #1A1A1A; box-shadow: 0 1px 4px rgba(30,30,60,.1); }
.st-gray { color: #6B6B76; background: #F0F0F0; }
.tl-item.ok::before { border-color: #00845F; }
.num-plus { color: #00845F; font-weight: 700; }
.num-minus { color: #D63A3A; font-weight: 700; }
.note-box { font-size: 12px; color: #6B6B76; background: #F8F8FB; border: 1px dashed #DCDCE6; border-radius: 8px; padding: 10px 12px; line-height: 1.8; }
.pick-code { font-size: 30px; font-weight: 800; letter-spacing: 10px; font-variant-numeric: tabular-nums; color: #1A1A1A; font-family: "DIN Next", var(--font); }
.qr-box { width: 118px; height: 118px; background: repeating-conic-gradient(#1A1A1A 0 25%, #fff 0 50%) 0 0 / 18px 18px; border-radius: 8px; position: relative; }
.qr-box::after { content: ""; position: absolute; inset: 40px; background: #fff; }
.bar-track { height: 8px; border-radius: 5px; background: #F0F0F4; overflow: hidden; min-width: 120px; }
.bar-fill { height: 100%; border-radius: 5px; background: linear-gradient(90deg, #7C4DFF, #4F46E5); }
.bar-fill.warn { background: linear-gradient(90deg, #FFB020, #FF7A2E); }
.bar-fill.ok { background: linear-gradient(90deg, #00C48C, #2EBC8E); }
.tot-row td { background: #FAFAFC; font-weight: 700; }
