/* 采控宝 客户端样式：手机 / 平板 / PC 自适应 */
:root {
  --primary: #0f6cbd;
  --primary-dark: #0b5497;
  --primary-light: #e8f2fc;
  --success: #0a8a52;
  --warning: #e08a1e;
  --danger: #d93a3a;
  --gray: #8a94a6;
  --text: #1d2733;
  --text-2: #5b6675;
  --border: #e4e8ef;
  --bg: #f4f6fa;
  --card: #ffffff;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(20, 40, 80, .06);
  --tabbar-h: 60px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; font-size: 14px; color: inherit; }
.hide { display: none !important; }

/* ---------- 布局 ---------- */
.layout { min-height: 100vh; }
/* 侧边栏仅桌面端显示（>=1024px 在下方 media query 中展开）；手机端隐藏，避免骨架堆叠在页面上方 */
.sidebar { display: none; }
.header {
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff; padding: 10px 14px;
  display: flex; align-items: center; gap: 10px;
}
.header .logo { font-size: 17px; font-weight: 700; letter-spacing: 1px; }
.header .sub { font-size: 12px; opacity: .85; }
/* 银购商标（顶部栏） */
.header .hd-l { display: flex; align-items: center; gap: 9px; }
.header .hd-logo {
  width: 36px; height: 36px; border-radius: 9px; object-fit: cover; background: #fff;
  box-shadow: 0 1px 6px rgba(0,0,0,.25);
}
.header .spacer { flex: 1; }
.header .hi { text-align: right; font-size: 12px; line-height: 1.3; opacity: .95; }
.header .btn-out {
  background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.3);
  color: #fff; padding: 4px 10px; border-radius: 20px; cursor: pointer; font-size: 12px;
}
.content { padding: 12px 12px calc(var(--tabbar-h) + 24px); max-width: 1200px; margin: 0 auto; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  height: var(--tabbar-h); background: #fff; border-top: 1px solid var(--border);
  display: flex; box-shadow: 0 -2px 10px rgba(20,40,80,.05);
}
.tabbar .tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size: 11px; color: var(--gray); cursor: pointer; position: relative;
}
.tabbar .tab.active { color: var(--primary); font-weight: 600; }
.tabbar .tab .ic { font-size: 20px; line-height: 1; }
.tabbar .badge {
  position: absolute; top: 6px; right: 50%; margin-right: -22px;
  background: var(--danger); color: #fff; font-size: 10px; min-width: 16px; height: 16px;
  border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 0 4px;
}

/* ---------- 卡片 / 组件 ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; margin-bottom: 12px; }
.card-title { font-size: 15px; font-weight: 600; margin: 0 0 10px; display: flex; align-items: center; gap: 6px; }
.card-title .more { margin-left: auto; font-size: 12px; font-weight: 400; color: var(--gray); }
.banner {
  background: linear-gradient(135deg, #0f6cbd, #17a2b8); color: #fff;
  border-radius: var(--radius); padding: 16px; margin-bottom: 12px;
}
.banner h3 { margin: 0 0 6px; font-size: 16px; }
.banner p { margin: 0; font-size: 12px; opacity: .9; }

.grid-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.grid-quick .q {
  position: relative;
  background: #fff; border-radius: 10px; padding: 12px 4px; text-align: center;
  box-shadow: var(--shadow); cursor: pointer;
}
.grid-quick .q:active { background: #f2f5fb; }
.grid-quick .q .ic { font-size: 22px; }
.grid-quick .q .t { font-size: 12px; margin-top: 4px; color: var(--text-2); }
/* 快捷卡片右上角的动态数字角标（待审批数 / 购物车件数 / 订单数等） */
.grid-quick .q .q-num {
  position: absolute; top: 4px; right: 6px; min-width: 18px; height: 18px;
  padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff;
  font-size: 11px; line-height: 18px; font-weight: 700; text-align: center;
}

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
/* 消息条目可点击：点击直达对应审批步骤 */
.notice-item { cursor: pointer; }
.notice-item:active { background: #f2f5fb; }
/* 从消息跳转过来时，高亮定位到对应审批卡片 */
.card.flash {
  box-shadow: 0 0 0 2px var(--primary), var(--shadow);
  transition: box-shadow .2s;
}
.stat { background: #fff; border-radius: 10px; padding: 12px; text-align: center; box-shadow: var(--shadow); }
.stat[data-go] { cursor: pointer; }
.stat[data-go]:active { background: #f2f5fb; }
.stat .n { font-size: 20px; font-weight: 700; color: var(--primary); }
.stat .l { font-size: 11px; color: var(--gray); }

/* 商品 */
.prod-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.prod {
  background: #fff; border-radius: 10px; overflow: hidden; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}
.prod .img {
  height: 150px; background: #f0f3f7; display: flex; align-items: center; justify-content: center;
  color: #b9c2ce; font-size: 12px; overflow: hidden; position: relative;
}
.prod .img img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.prod .bd { padding: 8px 10px; flex: 1; display: flex; flex-direction: column; }
.prod .nm { font-size: 13px; font-weight: 600; line-height: 1.4; height: 36px; overflow: hidden; }
.prod .meta { font-size: 11px; color: var(--gray); margin: 2px 0; }
.prod .price { color: var(--danger); font-weight: 700; font-size: 16px; margin-top: 4px; }
.prod .price small { font-size: 11px; }
.prod .ft { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.btn-add {
  background: var(--primary); color: #fff; border: none; border-radius: 20px;
  padding: 5px 12px; font-size: 12px; cursor: pointer;
}
.stock-tag { font-size: 11px; color: var(--gray); margin-left: auto; }

/* 表单 */
.form-item { margin-bottom: 12px; }
.form-item label { display: block; font-size: 13px; margin-bottom: 5px; color: var(--text-2); }
.form-item label .req { color: var(--danger); }
.form-item input, .form-item select, .form-item textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px;
  background: #fff; outline: none;
}
.form-item input:focus, .form-item select:focus, .form-item textarea:focus { border-color: var(--primary); }
textarea { resize: vertical; min-height: 70px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 10px 16px; border-radius: 8px; border: none; cursor: pointer;
  background: var(--primary); color: #fff; font-size: 14px;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.block { width: 100%; }
.btn.ghost { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn.gray { background: #eef1f6; color: var(--text-2); }
.btn.danger { background: var(--danger); }
.btn.sm { padding: 5px 12px; font-size: 12px; border-radius: 6px; }

/* APP 下载卡片（我的 → 退出登录上方） */
.appdl { display: flex; gap: 12px; align-items: center; }
.appdl-qr {
  flex: 0 0 auto; width: 96px; height: 96px; border-radius: 8px;
  border: 1px solid var(--border); background: #fff; padding: 4px; display: block;
}
.appdl-qr img { width: 100%; height: 100%; object-fit: contain; display: block; }
.appdl-tx { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--gray); line-height: 1.5; }
.appdl-tx b { font-size: 14px; color: var(--text); }
.appdl-btns { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }

/* 商品评价（商品详情弹窗内） */
.pv-reviews { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
.pv-atts { margin-top: 10px; border-top: 1px dashed var(--border); padding-top: 10px; font-size: 13px; }
.pv-atts b { display: block; margin-bottom: 6px; color: var(--text-2); font-size: 12px; }
.pv-att { display: inline-block; margin: 0 8px 6px 0; padding: 6px 10px; background: var(--primary-light); color: var(--primary); border-radius: 8px; text-decoration: none; font-size: 13px; }
.pv-att:hover { background: #d6e4ff; }
.pv-rv-hd { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.pv-rv-hd b { font-size: 14px; }
.rv-avg { font-size: 12px; color: var(--text-2); }
.pv-rv-hd .lk { margin-left: auto; font-size: 13px; }
.rv-buy { font-size: 12px; color: #2b7a3d; background: #eaf7ee; border-radius: 8px; padding: 6px 8px; margin-bottom: 8px; }
.rv-tip { font-size: 12px; color: var(--gray); background: var(--bg); border-radius: 8px; padding: 6px 8px; margin-bottom: 8px; }
.rv-mine { font-size: 12px; color: var(--text-2); background: var(--primary-light); border-radius: 8px; padding: 6px 8px; margin-bottom: 8px; line-height: 1.8; }
.rv-item { padding: 8px 0; border-bottom: 1px dashed var(--border); }
.rv-item:last-child { border-bottom: none; }
.rv-hd { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.rv-hd .rv-date { margin-left: auto; font-size: 11px; color: var(--gray); }
.rv-ct { font-size: 13px; color: var(--text-2); line-height: 1.6; margin-top: 2px; }
.rv-star-row { font-size: 26px; line-height: 1; display: flex; gap: 4px; }
.rv-star { color: #d9dde3; cursor: pointer; }
.rv-star.on { color: #f5a623; }

/* 列表 */
.list-item {
  background: #fff; border-radius: 10px; padding: 12px; margin-bottom: 10px; box-shadow: var(--shadow);
}
.list-item .t { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.list-item .d { font-size: 12px; color: var(--text-2); margin-top: 3px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.tag { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11px; }
.tag.blue { background: var(--primary-light); color: var(--primary); }
.tag.green { background: #e6f6ee; color: var(--success); }
.tag.orange { background: #fdf1e0; color: var(--warning); }
.tag.red { background: #fdeaea; color: var(--danger); }
.tag.gray { background: #eef1f6; color: var(--text-2); }

.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 10px; padding-bottom: 2px; }
.tabs .t {
  padding: 5px 12px; border-radius: 20px; background: #fff; border: 1px solid var(--border);
  font-size: 12px; white-space: nowrap; cursor: pointer; color: var(--text-2);
}
.tabs .t.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.empty { text-align: center; padding: 40px 20px; color: var(--gray); font-size: 13px; }
/* 审核提取：分段标题 */
.section-t { font-size: 14px; font-weight: 700; color: var(--primary); margin: 16px 2px 8px; padding-left: 8px; border-left: 3px solid var(--primary); }
.empty .ic { font-size: 40px; display: block; margin-bottom: 8px; opacity: .5; }

/* 弹窗 */
.mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 100;
  display: flex; align-items: flex-end; justify-content: center;
}
.modal {
  background: #fff; width: 100%; max-width: 640px; border-radius: 16px 16px 0 0;
  max-height: 88vh; overflow-y: auto; padding: 16px 16px 24px;
}
.modal h3 { margin: 0 0 12px; font-size: 16px; }
.modal .close { float: right; color: var(--gray); cursor: pointer; font-size: 20px; line-height: 1; }

/* 时间轴 */
.timeline { border-left: 2px solid var(--border); padding-left: 14px; margin-left: 4px; }
.timeline .node { position: relative; padding-bottom: 14px; }
.timeline .node::before {
  content: ''; position: absolute; left: -21px; top: 4px; width: 9px; height: 9px;
  border-radius: 50%; background: var(--primary);
}
.timeline .node .tt { font-size: 13px; font-weight: 600; }
.timeline .node .td { font-size: 11px; color: var(--gray); }

/* 购物车条 */
.cart-bar {
  position: fixed; left: 0; right: 0; bottom: var(--tabbar-h); z-index: 55;
  background: #fff; border-top: 1px solid var(--border); padding: 8px 14px;
  display: flex; align-items: center; gap: 10px;
}
.cart-bar .sum { flex: 1; font-size: 13px; }
.cart-bar .sum b { color: var(--danger); font-size: 17px; }

/* 登录 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-box { width: 100%; max-width: 380px; }
.login-box .brand { text-align: center; margin-bottom: 22px; }
.login-box .brand .n { font-size: 26px; font-weight: 800; color: var(--primary); letter-spacing: 3px; }
/* 登录页版本号：独立徽标，醒目但不过大 */
.login-box .brand .ver {
  display: inline-block; margin-top: 6px; padding: 2px 10px; border-radius: 12px;
  font-size: 14px; font-weight: 700; letter-spacing: .5px; color: #fff;
  background: linear-gradient(135deg, var(--primary), #2f7be0);
  box-shadow: 0 2px 8px rgba(20, 40, 80, .18);
}
.login-box .brand .s { font-size: 12px; color: var(--gray); margin-top: 10px; }
/* 登录页：客户使用端 / 管理端 分段切换，做得明显（默认停客户使用端） */
.portal-switch { display: flex; background: #eef1f6; border-radius: 10px; padding: 4px; margin-bottom: 16px; }
.portal-switch .ps-tab {
  flex: 1; text-align: center; padding: 10px 0; border-radius: 7px; font-size: 14px;
  font-weight: 600; color: var(--text-2); cursor: pointer; user-select: none; transition: all .15s;
}
.portal-switch .ps-tab.active { background: #fff; color: var(--primary); box-shadow: 0 1px 5px rgba(20, 40, 80, .14); }
.portal-switch .ps-tab[data-act="go-admin"]:hover { color: var(--primary); }
/* 银购商标（登录页） */
.login-box .brand .brand-logo {
  display: block; width: 78px; height: 78px; margin: 0 auto 12px; border-radius: 18px; object-fit: cover;
  background: linear-gradient(135deg,#fdf6e8,#f3e3c3); box-shadow: 0 6px 18px rgba(176,127,38,.28);
}

.toast {
  position: fixed; left: 50%; top: 30%; transform: translateX(-50%);
  background: rgba(0,0,0,.82); color: #fff; padding: 10px 18px; border-radius: 8px;
  z-index: 999; font-size: 13px; max-width: 80%;
}

/* 平板/PC 适配 */
@media (min-width: 768px) {
  .prod-grid { grid-template-columns: repeat(3, 1fr); }
  .grid-quick { grid-template-columns: repeat(6, 1fr); }
  .content { padding: 16px 20px 30px; }
}
@media (min-width: 1024px) {
  .layout { display: flex; }
  .header { display: none; }
  .sidebar {
    display: block; /* 覆盖移动端的默认隐藏，仅桌面端展开侧边栏 */
    width: 210px; flex: 0 0 210px; background: #0b5497; color: #fff;
    min-height: 100vh; padding: 18px 12px; position: sticky; top: 0; height: 100vh;
  }
  .sidebar .logo { font-size: 20px; font-weight: 800; letter-spacing: 2px; padding: 6px 8px 18px; display: flex; align-items: center; gap: 8px; }
  .sidebar .logo .side-logo { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; background: #fff; box-shadow: 0 1px 6px rgba(0,0,0,.25); }
  .sidebar .logo small {
    display: inline-block; margin-left: 6px; font-size: 12px; font-weight: 600;
    letter-spacing: 0; color: rgba(255,255,255,.72); vertical-align: middle;
  }
  /* 左下角退出按钮 */
  .sidebar .sb-logout {
    position: absolute; bottom: 56px; left: 12px; right: 12px; padding: 8px;
    border-radius: 8px; border: 1px solid rgba(255,255,255,.35);
    background: rgba(255,255,255,.12); color: #fff; cursor: pointer; font-size: 13px;
    text-align: center; transition: background .15s;
  }
  .sidebar .sb-logout:hover { background: rgba(255,255,255,.24); }
  /* 退出按钮上方的 APP 下载二维码 */
  .sidebar .sb-appdl {
    position: absolute; bottom: 104px; left: 12px; right: 12px;
    display: flex; align-items: center; gap: 8px; padding: 8px;
    background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.25);
    border-radius: 10px; color: #fff; text-decoration: none;
  }
  .sidebar .sb-appdl img { width: 56px; height: 56px; border-radius: 6px; background: #fff; padding: 3px; flex: 0 0 auto; }
  .sidebar .sb-appdl span { font-size: 11px; line-height: 1.6; opacity: .92; }
  .sidebar .me { bottom: 12px; }
  .sidebar .nav-item {
    padding: 10px 12px; border-radius: 8px; cursor: pointer; margin-bottom: 4px;
    display: flex; align-items: center; gap: 8px; font-size: 14px; opacity: .88;
  }
  .sidebar .nav-item:hover { background: rgba(255,255,255,.12); }
  .sidebar .nav-item.active { background: #fff; color: var(--primary-dark); font-weight: 700; opacity: 1; }
  .sidebar .nav-item .badge { margin-left: auto; background: var(--danger); color: #fff;
    border-radius: 10px; padding: 0 6px; font-size: 11px; }
  .sidebar .me { position: absolute; bottom: 16px; left: 12px; right: 12px; font-size: 12px; opacity: .9; }
  .main { flex: 1; min-width: 0; }
  .tabbar { display: none; }
  .content { padding: 20px 24px 40px; }
  .cart-bar { left: 210px; bottom: 0; }
  .prod-grid { grid-template-columns: repeat(4, 1fr); }
  .modal { border-radius: 12px; max-width: 720px; }
  .mask { align-items: center; }
}

/* ============ v1.5.1：卡片悬浮放大（所有卡片统一） ============ */
.prod, .list-item, .stat, .grid-quick .q, .timeline .node {
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.prod:hover, .list-item:hover, .stat:hover, .grid-quick .q:hover {
  transform: translateY(-3px) scale(1.015);
  box-shadow: 0 10px 22px rgba(20, 40, 80, .16);
}
.prod:active, .list-item:active, .stat:active, .grid-quick .q:active { transform: scale(.99); }
.prod, .list-item[data-act], .list-item[data-go], .notice-item, .tabs .t { cursor: pointer; }
.tabs .t:hover { border-color: var(--primary); color: var(--primary); }
.lk { color: var(--primary); cursor: pointer; }

/* 未读消息卡片 */
.notice-item { border-left: 3px solid var(--primary); }
.notice-item .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); margin-right: 6px; vertical-align: middle; }
.notice-item:hover { background: #f7f9fd; }

/* 商品搜索条（采购人以「输入名称搜索」为第一入口） */
.search-bar { display: flex; align-items: center; gap: 6px; background: #f2f5fb; border: 1px solid var(--border); border-radius: 24px; padding: 3px 4px 3px 12px; }
.search-bar .s-ic { font-size: 14px; opacity: .65; }
.search-bar input { flex: 1; border: none; background: transparent; padding: 8px 4px; font-size: 14px; outline: none; }
.search-bar .s-clr { width: 20px; height: 20px; line-height: 19px; text-align: center; border-radius: 50%; background: #d8dfe9; color: #667; font-size: 13px; }
.search-bar .s-btn { border: none; background: var(--primary); color: #fff; border-radius: 18px; padding: 8px 16px; font-size: 13px; white-space: nowrap; }

/* 商品图片：无图时用占位图，多图标角标 */
.prod .img .img-num { position: absolute; right: 6px; bottom: 6px; background: rgba(0, 0, 0, .5); color: #fff; font-size: 10px; padding: 2px 6px; border-radius: 10px; }

/* 商品详情图廊 */
.pv-main-wrap { border-radius: 10px; overflow: hidden; margin-bottom: 8px; background: #f0f3f7; }
.pv-main-wrap img { width: 100%; display: block; max-height: 320px; object-fit: contain; }
.pv-thumbs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 8px; padding-bottom: 2px; }
.pv-th { width: 58px; height: 58px; object-fit: cover; border-radius: 6px; border: 2px solid transparent; flex: none; }
.pv-th.on { border-color: var(--primary); }
