/* ==========================================
   NRCrobo 联核机器人 · 统一 PC 外壳（B端桌面）
   适用：supplier-pc / channel-pc（供应商门户 + 渠道伙伴 PC 版）
   依赖：design-system.css · layout.css · components.css
   设计约束：内容区 max-width 1440px 居中，宽屏不再全屏拉伸
   ========================================== */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg-primary); font-family: var(--font-sans, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif); }

/* ---------- 桌面外壳 ---------- */
.pc-shell { display: flex; min-height: 100vh; min-height: 100dvh; background: var(--bg-primary); }
.pc-nav {
  width: var(--nav-w); flex-shrink: 0; background: var(--secondary);
  display: flex; flex-direction: column; align-items: stretch;
  padding: 14px 10px 16px; gap: 4px; overflow-y: auto;
  position: sticky; top: 0; height: 100vh; height: 100dvh; z-index: 20;
}
.pc-nav::-webkit-scrollbar { display: none; }
.pc-logo {
  width: auto; height: 46px; border-radius: 12px; background: transparent;
  color: #fff; display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 6px;
  padding: 0; margin-bottom: 14px; flex-shrink: 0; cursor: default;
}
.pc-logo .en { font-size: 13px; font-weight: 700; letter-spacing: .3px; line-height: 1.1; }
.pc-logo .cn { font-size: 15px; font-weight: 600; color: rgba(255,255,255,.9); line-height: 1.1; }
.pc-logo .pc-logo-img { display: block; height: 30px; width: auto; max-width: 100%; }
.pc-logo .pc-logo-txt { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; white-space: nowrap; }
.pc-logo .pc-logo-txt b { font-size: 13.5px; font-weight: 700; letter-spacing: .4px; color: #fff; }
.pc-logo .pc-logo-txt i { font-style: normal; font-size: 10.5px; font-weight: 500; letter-spacing: .3px; color: rgba(255,255,255,.55); }
.pc-nav-item {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  display: flex; flex-direction: row; align-items: center; gap: 10px;
  color: rgba(255,255,255,.6); text-decoration: none; transition: all .18s;
}
.pc-nav-item svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.pc-nav-item span { font-size: 13px; line-height: 1.2; transform: none; white-space: nowrap; }
.pc-nav-item:hover { background: rgba(255,255,255,.08); color: rgba(255,255,255,.92); }
.pc-nav-item.active { background: var(--primary); color: #fff; }

.pc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.pc-header {
  flex-shrink: 0; height: 56px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; background: var(--bg-secondary); border-bottom: 1px solid var(--border-light);
}
.pc-header-title { font-size: 17px; font-weight: 600; color: var(--text-primary); }
.pc-header-sub { font-size: 12px; color: var(--text-muted); margin-left: 10px; font-weight: 400; }
.pc-header-right { display: flex; align-items: center; gap: 16px; color: var(--text-secondary); }
.pc-header-right svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; cursor: pointer; }
.pc-header-right svg:hover { color: var(--primary); }
.pc-avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--primary-bg); color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; cursor: pointer;
}
/* 内容区：限制最大宽度并居中，避免宽屏全屏拉伸 */
.pc-content { flex: 1; overflow-y: auto; padding: 24px; }
.pc-content::-webkit-scrollbar { width: 6px; }
.pc-content::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
.pc-inner { max-width: 1440px; margin: 0 auto; width: 100%; }
.page-wrap { max-width: 1440px; margin: 0 auto; width: 100%; }

/* ---------- 页面容器 ---------- */
.row { display: flex; gap: 16px; }
.row > * { min-width: 0; }
.col-8 { flex: 2; }
.col-4 { flex: 1; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mt-20 { margin-top: 20px; }

/* ---------- 角色信息头（供应商/渠道） ---------- */
.vendor-head {
  display: flex; align-items: center; gap: 16px;
  background: linear-gradient(135deg, var(--secondary), #142B4A);
  border-radius: var(--radius-lg); padding: 20px 24px; margin-bottom: 20px;
}
.vendor-ava {
  width: 54px; height: 54px; border-radius: 14px; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; flex-shrink: 0;
}
.vendor-name { color: #fff; font-size: 18px; font-weight: 600; }
.vendor-code { color: rgba(255,255,255,.7); font-size: 12px; margin-top: 4px; }
.vendor-tag {
  margin-left: auto; background: rgba(255,255,255,.15); color: #fff;
  font-size: 12px; padding: 5px 14px; border-radius: var(--radius-full);
}

/* ---------- KPI ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 20px; }
.kpi-grid.k4 { grid-template-columns: repeat(4, 1fr); }
.kpi-grid.k3 { grid-template-columns: repeat(3, 1fr); }
.kpi-card { background: var(--bg-card); border-radius: var(--radius-md); padding: 16px 18px; box-shadow: var(--shadow-sm); border: 1px solid var(--border-light); }
a.kpi-card { display: block; color: inherit; transition: box-shadow .18s, transform .18s; }
a.kpi-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.kpi-ico { width: 32px; height: 32px; border-radius: 9px; background: var(--primary-bg); color: var(--primary); display: flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.kpi-ico svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.kpi-label { font-size: 12px; color: var(--text-secondary); margin-bottom: 5px; }
.kpi-value { font-size: 24px; font-weight: 700; color: var(--text-primary); line-height: 1; }
.kpi-value.primary { color: var(--primary); }
.kpi-trend { font-size: 11px; margin-top: 7px; }
.kpi-trend.up { color: var(--success); }
.kpi-trend.down { color: var(--danger); }

/* ---------- 面板 ---------- */
.panel { background: var(--bg-card); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); border: 1px solid var(--border-light); margin-bottom: 20px; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 15px 18px; border-bottom: 1px solid var(--border-light); }
.panel-title { font-size: 15px; font-weight: 600; color: var(--text-primary); display: flex; align-items: center; gap: 7px; }
.panel-title svg { width: 16px; height: 16px; stroke: var(--primary); fill: none; stroke-width: 1.8; }
.panel-more { font-size: 12px; color: var(--text-muted); cursor: pointer; }
.panel-more:hover { color: var(--primary); }
.panel-body { padding: 16px 18px; }
.panel-body.flush { padding: 0; }

/* FAQ（方案详情常见问题） */
.faq-item { padding: 13px 0; border-bottom: 1px solid var(--border-light); }
.faq-item:last-child { border-bottom: none; }
.faq-q { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; display: flex; align-items: flex-start; gap: 8px; }
.faq-q::before { content: ''; flex-shrink: 0; width: 4px; height: 16px; border-radius: 2px; background: var(--primary); margin-top: 2px; }
.faq-a { font-size: 13px; color: var(--text-secondary); line-height: 1.65; padding-left: 12px; }

/* ---------- 数据表格 ---------- */
.table-scroll { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table thead th {
  text-align: left; font-weight: 600; color: var(--text-secondary);
  font-size: 12px; padding: 12px 16px; background: var(--bg-primary);
  border-bottom: 1px solid var(--border-light); white-space: nowrap;
}
.table tbody td { padding: 13px 16px; border-bottom: 1px solid var(--border-light); color: var(--text-primary); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--bg-primary); }
.table .cell-sub { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.cell-strong { font-weight: 600; }
.cell-money { font-weight: 700; color: var(--text-primary); }
.cell-money.primary { color: var(--primary); }

/* ---------- 徽章 ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: var(--radius-full); white-space: nowrap; }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--success-bg); color: var(--success); }
.badge.warn { background: var(--warning-bg); color: var(--warning); }
.badge.danger { background: var(--danger-bg); color: var(--danger); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.mute { background: var(--secondary-bg); color: var(--text-secondary); }
.badge.brand { background: var(--primary-bg); color: var(--primary); }

/* ---------- Tab ---------- */
.tabs { display: flex; gap: 4px; background: var(--bg-primary); padding: 4px; border-radius: var(--radius-md); margin-bottom: 16px; width: fit-content; }
.tab { padding: 7px 16px; border-radius: var(--radius-sm); font-size: 13px; color: var(--text-secondary); cursor: pointer; transition: all .15s; border: none; background: none; font-family: inherit; }
.tab:hover { color: var(--text-primary); }
.tab.active { background: var(--bg-card); color: var(--primary); font-weight: 600; box-shadow: var(--shadow-sm); }
.tab-pane { display: block; }

/* ---------- 工具栏 / 筛选 ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.input, .select {
  height: 36px; border: 1px solid var(--border-color); border-radius: var(--radius-sm);
  padding: 0 12px; font-size: 13px; color: var(--text-primary); background: var(--bg-card);
  font-family: inherit;
}
.input { min-width: 200px; }
.input::placeholder { color: var(--text-muted); }
.input:focus, .select:focus { border-color: var(--primary); }

/* ---------- 按钮 ---------- */
.btn { height: 36px; padding: 0 18px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; border: 1px solid transparent; transition: all .15s; font-family: inherit; }
.btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost { background: var(--bg-card); color: var(--text-primary); border-color: var(--border-color); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: .9; }
.btn-sm { height: 30px; padding: 0 12px; font-size: 12px; }
.link-btn { color: var(--primary); font-size: 13px; font-weight: 600; cursor: pointer; background: none; border: none; font-family: inherit; }
.link-btn:hover { text-decoration: underline; }

/* ---------- 三大约束卡（供应商） ---------- */
.constraint-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.constraint-card { background: var(--bg-card); border-radius: var(--radius-md); padding: 18px; box-shadow: var(--shadow-sm); border: 1px solid var(--border-light); }
.constraint-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.constraint-ico { width: 40px; height: 40px; border-radius: 11px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.constraint-ico svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.constraint-ico.ok { background: var(--success-bg); color: var(--success); }
.constraint-ico.warn { background: var(--warning-bg); color: var(--warning); }
.constraint-name { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.constraint-status { font-size: 11px; margin-top: 2px; }
.constraint-status.ok { color: var(--success); }
.constraint-status.warn { color: var(--warning); }
.constraint-line { display: flex; justify-content: space-between; font-size: 12px; padding: 7px 0; border-top: 1px solid var(--border-light); }
.constraint-line:first-of-type { border-top: none; }
.constraint-line .k { color: var(--text-muted); }
.constraint-line .v { color: var(--text-primary); font-weight: 600; }

/* ---------- 待办 / 列表项 ---------- */
.todo-row { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--border-light); cursor: pointer; transition: background .15s; }
.todo-row:last-child { border-bottom: none; }
.todo-row:hover { background: var(--bg-primary); }
.todo-ico { width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.todo-ico svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.todo-ico.warn { background: var(--warning-bg); color: var(--warning); }
.todo-ico.danger { background: var(--danger-bg); color: var(--danger); }
.todo-ico.info { background: var(--info-bg); color: var(--info); }
.todo-body { flex: 1; min-width: 0; }
.todo-title { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.todo-sub { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.todo-arrow { color: var(--primary); font-size: 13px; font-weight: 600; flex-shrink: 0; }

/* ---------- 进度条 ---------- */
.progress { height: 7px; border-radius: var(--radius-full); background: var(--bg-primary); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: var(--radius-full); background: var(--primary); }
.progress.ok > i { background: var(--success); }
.progress.warn > i { background: var(--warning); }
.progress.danger > i { background: var(--danger); }

/* ---------- 公告 / 通知项 ---------- */
.notice-row { display: flex; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--border-light); }
.notice-row:last-child { border-bottom: none; }
.notice-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); margin-top: 6px; flex-shrink: 0; }
.notice-title { font-size: 13px; color: var(--text-primary); line-height: 1.5; }
.notice-time { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

/* ---------- 信息定义列表 ---------- */
.def-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
.def-row { display: flex; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--border-light); font-size: 13px; }
.def-row .k { color: var(--text-muted); }
.def-row .v { color: var(--text-primary); font-weight: 600; text-align: right; }

/* ---------- 快捷入口网格（渠道常用功能） ---------- */
.quick-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.quick-item {
  background: var(--bg-card); border-radius: var(--radius-md); padding: 16px 8px; text-align: center;
  border: 1px solid var(--border-light); text-decoration: none; color: var(--text-primary); transition: all .15s;
}
.quick-item:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.quick-ico { width: 38px; height: 38px; border-radius: 10px; background: var(--primary-bg); color: var(--primary); display: flex; align-items: center; justify-content: center; margin: 0 auto 8px; }
.quick-ico svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.quick-label { font-size: 12px; }

/* ---------- 响应式（窄屏降级） ---------- */
@media (max-width: 1280px) {
  .kpi-grid, .kpi-grid.k4 { grid-template-columns: repeat(3, 1fr); }
  .constraint-grid { grid-template-columns: 1fr; }
  .row { flex-direction: column; }
  .quick-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
  .pc-content { padding: 14px; }
  .kpi-grid, .kpi-grid.k4, .kpi-grid.k3 { grid-template-columns: 1fr 1fr; }
  .def-list { grid-template-columns: 1fr; }
  .table-scroll { overflow-x: auto; }
}

/* ---------- 通用弹层 / 表单 / 轻提示（供应商·渠道 PC 复用） ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: none; align-items: center; justify-content: center; z-index: 60; padding: 20px; }
.modal-mask.show { display: flex; }
.modal { width: 560px; max-width: 92vw; max-height: 86vh; overflow: auto; background: var(--bg-card); border-radius: var(--radius-lg); box-shadow: var(--shadow-2xl); animation: modalIn .18s ease; }
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border-light); }
.modal-title { font-size: 18px; font-weight: 700; color: var(--text-primary); }
.modal-close { cursor: pointer; color: var(--text-muted); display: flex; transition: color .15s; }
.modal-close:hover { color: var(--primary); }
.modal-body { padding: 20px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px 20px; }

/* 表单 */
.form-row { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 7px; font-weight: 600; }
.form-input, .form-select, .form-textarea { width: 100%; height: 38px; border: 1px solid var(--border-color); border-radius: var(--radius-sm); padding: 0 12px; font-size: 13px; color: var(--text-primary); background: var(--bg-card); font-family: inherit; }
.form-textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 72px; }
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--primary); outline: none; }
.form-input:disabled { background: var(--bg-primary); color: var(--text-muted); cursor: not-allowed; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

/* 弹窗内只读信息行 */
.info-row { display: flex; justify-content: space-between; padding: 9px 0; font-size: 13px; border-bottom: 1px solid var(--border-light); }
.info-row:last-child { border-bottom: none; }
.info-row .k { color: var(--text-secondary); }
.info-row .v { font-weight: 600; color: var(--text-primary); text-align: right; max-width: 62%; }

/* 弹窗底部按钮行 */
.btn-row { display: flex; gap: 10px; }
.btn-row.justify-end { justify-content: flex-end; }

/* 轻提示 */
.toast { position: fixed; top: auto; left: 50%; bottom: 32px; transform: translateX(-50%) translateY(20px); background: rgba(26,54,93,.96); color: #fff; font-size: 13px; font-weight: 600; padding: 11px 20px; border-radius: var(--radius-full); box-shadow: var(--shadow-2xl); opacity: 0; pointer-events: none; transition: all .25s; z-index: 80; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 权限 / 说明提示（B 端统一 · 此前 customer-pc 缺样式导致黑圆） ---------- */
.perm-note { display: flex; gap: 10px; align-items: flex-start; background: var(--info-bg); border: 1px solid rgba(59,130,246,.25); border-radius: var(--radius-md); padding: 14px 16px; margin-bottom: 20px; }
.perm-note svg { width: 18px; height: 18px; stroke: var(--info); fill: none; stroke-width: 1.8; flex-shrink: 0; margin-top: 1px; }
.perm-note b { color: #1d4ed8; }
.perm-note p { font-size: 12.5px; color: var(--text-secondary); line-height: 1.6; margin: 0; }

/* =====================================================================
   响应式兜底（2026-09-23 · 三端 PC 页：客户 PC / 渠道 PC / 厂商 PC）
   注意：本段**必须置于文末** —— 页面是「<link> 在前、页内 <style> 在后」，
   同优先级下后出现的规则才生效；页内若另有覆盖，需在页内同断点补齐。
   只做展示层收敛，不改任何业务行为。
   ===================================================================== */
@media (max-width: 1280px) {
  .kpi-grid, .kpi-grid.k4 { grid-template-columns: repeat(3, 1fr); }
  .kpi-grid.k3 { grid-template-columns: repeat(3, 1fr); }
  /* 纵向堆叠后，.col-* 的 flex:2/1 会变成「纵向伸缩」导致两栏高度不均 → 必须复位 */
  .row { flex-direction: column; }
  .col-8, .col-4 { flex: none; width: 100%; }
  .constraint-grid { grid-template-columns: 1fr; }
  .quick-grid { grid-template-columns: repeat(3, 1fr); }
  .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .panel-head { flex-wrap: wrap; row-gap: 8px; }
  .lu-tools { gap: 8px; }
  .lu-input { flex: 1 1 180px; }
}
@media (max-width: 1024px) {
  .panel-head { align-items: flex-start; }
  .def-list { grid-template-columns: 1fr; }
  .lu-tools { align-items: stretch; }
  .lu-pager { flex-wrap: wrap; justify-content: center; gap: 8px; }
}
@media (max-width: 860px) {
  .pc-content { padding: 14px; }
  .kpi-grid, .kpi-grid.k4, .kpi-grid.k3 { grid-template-columns: 1fr 1fr; }
  .quick-grid { grid-template-columns: repeat(2, 1fr); }
  .table-scroll { overflow-x: auto; }
  .lu-tools { flex-direction: column; }
  .lu-input, .lu-select, .lu-date, .lu-btn { width: 100%; }
  .lu-count { margin-left: 0; }
}

/* ---------- k6：六卡栅格（渠道工作台 / 前置工作站） ---------- */
.kpi-grid.k6 { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 1280px) { .kpi-grid.k6 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 860px)  { .kpi-grid.k6 { grid-template-columns: 1fr 1fr; } }
