:root {
  --brand: #2563eb;
  --brand-2: #4f46e5;
  --ink: #0f172a;
  --ink-2: #475569;
  --ink-3: #94a3b8;
  --line: #e2e8f0;
  --bg: #f1f5f9;
  --card: #ffffff;
  --danger: #dc2626;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(15, 23, 42, .08);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
a { cursor: pointer; }

/* ================= 登录页 ================= */
.login-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 18px calc(24px + env(safe-area-inset-bottom));
  background:
    radial-gradient(900px 420px at 50% -12%, rgba(37, 99, 235, .35), transparent 62%),
    radial-gradient(700px 380px at 100% 108%, rgba(79, 70, 229, .30), transparent 60%),
    linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border-radius: 22px;
  padding: 32px 24px 22px;
  box-shadow: 0 24px 60px rgba(2, 6, 23, .45);
  animation: rise .45s cubic-bezier(.2, .8, .2, 1);
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.brand { text-align: center; margin-bottom: 26px; }
.brand .logo {
  width: 58px; height: 58px; margin: 0 auto 12px;
  border-radius: 17px;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 800; color: #fff; font-style: italic;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 10px 22px rgba(37, 99, 235, .42);
}
.brand h1 { margin: 0 0 6px; font-size: 25px; letter-spacing: 2px; }
.brand p { margin: 0; color: var(--ink-3); font-size: 13px; letter-spacing: .5px; }
.brand .tag {
  display: inline-block; margin-top: 12px; padding: 4px 14px; border-radius: 20px;
  font-size: 12.5px; font-weight: 600; color: var(--brand); background: #eff6ff;
}

.field { display: block; margin-bottom: 14px; }
.field .lab { display: block; font-size: 12.5px; color: var(--ink-2); margin: 0 0 6px 2px; font-weight: 600; }
input {
  width: 100%; padding: 13px 14px; font-size: 15px; color: var(--ink);
  border: 1.5px solid var(--line); border-radius: 12px; background: #fff;
  transition: border-color .16s, box-shadow .16s;
}
input::placeholder { color: #b6c0cd; }
input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(37, 99, 235, .12); }

.btn-primary {
  width: 100%; margin-top: 6px; padding: 14px; font-size: 16px; font-weight: 700; letter-spacing: 3px;
  color: #fff; border: 0; border-radius: 12px; cursor: pointer;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 10px 22px rgba(37, 99, 235, .34);
  transition: transform .12s, box-shadow .12s;
}
.btn-primary:active { transform: translateY(1px) scale(.995); box-shadow: 0 6px 14px rgba(37, 99, 235, .3); }
.btn-ghost {
  width: 100%; margin-top: 8px; padding: 11px; font-size: 14px; font-weight: 600;
  color: var(--brand); background: #eff6ff; border: 1.5px solid #dbeafe; border-radius: 10px; cursor: pointer;
}
.btn-ghost:active { background: #dbeafe; }

.msg { color: var(--danger); font-size: 13px; min-height: 18px; margin-top: 8px; }
/* ================= 应用内 ================= */
.appbar {
  display: flex; align-items: center; gap: 10px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff;
  position: sticky; top: 0; z-index: 10;
}
.app-logo { font-weight: 800; font-size: 17px; letter-spacing: 1px; }
.role-tag { font-size: 12px; background: rgba(255, 255, 255, .22); padding: 3px 10px; border-radius: 20px; }
.logout { margin-left: auto; color: #e0e7ff; font-size: 13px; text-decoration: none; cursor: pointer; }

.tabs { display: flex; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 9; }
.tabs span { flex: 1; text-align: center; padding: 13px 0; color: var(--ink-2); font-size: 14px; font-weight: 600; cursor: pointer; }
.tabs span.active { color: var(--brand); box-shadow: inset 0 -2px 0 var(--brand); }

.tab { padding: 14px; }
.panel { background: var(--card); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.panel + .panel { margin-top: 12px; }
.panel h4 { margin: 2px 0 12px; font-size: 14px; color: var(--ink); }
.row2 { display: flex; gap: 8px; min-width: 0; }
/* min-width:0 是关键：flex 子项默认 min-width:auto，输入框的内在宽度会把整行撑出屏幕 */
.row2 input { flex: 1 1 0; min-width: 0; }

.item { background: var(--card); border-radius: 12px; padding: 13px 14px; margin-bottom: 10px; box-shadow: 0 2px 8px rgba(15, 23, 42, .05); font-size: 13.5px; line-height: 1.7; color: var(--ink-2); }
.item b { color: var(--brand); font-size: 15px; }
.item .badge { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 11.5px; background: #eff6ff; color: var(--brand); font-weight: 600; margin-left: 4px; }
/* soft 用于物料分类标签 —— 它只是信息标注，不该跟「待报价 / 已中标」这类状态徽标抢视觉 */
.item .badge.soft { background: #f1f5f9; color: var(--ink-3); font-weight: 500; }

/* 三列输入：单价 / 配送费 / 配送时间。min-width:0 同 .row2，否则输入框内在宽度会把行撑出屏幕 */
.row3 { display: flex; gap: 8px; min-width: 0; }
.row3 input { flex: 1 1 0; min-width: 0; }

/* 经营分类勾选组 */
.catgroup { border-top: 1px solid var(--line); padding: 9px 0; }
.catgroup:first-child { border-top: 0; }
.catmain { display: flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--ink); }
.catmain input { width: auto; margin: 0; }
.catsubs { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 7px 0 0 22px; }
.catsubs label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); }
.catsubs input { width: auto; margin: 0; }
.act { border: 1.5px dashed #cbd5e1; }
.urg { display: flex; align-items: center; gap: 7px; font-size: 14px; color: var(--ink-2); margin: 10px 0 2px; }
.urg input { width: auto; margin: 0; }

/* ================= 入口页（三端分开） ================= */
.entry-wrap {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 22px; padding: 30px 20px;
  background:
    radial-gradient(900px 420px at 50% -12%, rgba(37, 99, 235, .32), transparent 62%),
    linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
}
.entry-head { text-align: center; color: #fff; }
.entry-head .logo {
  width: 58px; height: 58px; margin: 0 auto 12px; border-radius: 17px;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 800; font-style: italic;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  box-shadow: 0 12px 26px rgba(59, 130, 246, .42);
}
.entry-head h1 { margin: 0 0 6px; font-size: 26px; letter-spacing: 3px; }
.entry-head p { margin: 0; color: #94a3b8; font-size: 13px; }
.entry-list { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 12px; }
.entry {
  display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink);
  background: #fff; border-radius: 16px; padding: 16px 18px;
  box-shadow: 0 14px 34px rgba(2, 6, 23, .35); transition: transform .14s;
}
.entry:active { transform: scale(.985); }
.entry .ic {
  width: 44px; height: 44px; border-radius: 12px; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  background: #eff6ff;
}
.entry .tt { flex: 1; }
.entry .tt b { display: block; font-size: 16px; margin-bottom: 3px; }
.entry .tt span { color: var(--ink-3); font-size: 12.5px; }
.entry .go { color: var(--brand); font-size: 20px; font-weight: 700; }

/* ================= 文件上传 / 明细行（工地端发单） ================= */
.file-drop { display: block; margin-bottom: 10px; }
.file-drop input[type=file] { display: none; }
.file-drop span {
  display: block; padding: 20px 14px; text-align: center; font-size: 13.5px; color: var(--ink-2);
  border: 1.5px dashed #cbd5e1; border-radius: 12px; background: #f8fafc; cursor: pointer;
  transition: .16s; word-break: break-all;
}
.file-drop span:active { background: #eff6ff; border-color: var(--brand); color: var(--brand); }
.hint { margin-top: 10px; font-size: 12.5px; line-height: 1.7; color: var(--ink-3); word-break: break-all; }
.irow { position: relative; padding: 11px 12px 12px; margin-bottom: 10px; background: #f8fafc; border-radius: 12px; }
.irow input { background: #fff; }
.irow .del { display: inline-block; margin-top: 8px; color: var(--danger); font-size: 12.5px; font-weight: 600; }

/* ================= 商家上传报价单 / 合并报价清单 ================= */
.seg { display: flex; flex-direction: column; gap: 9px; margin: 6px 0 12px; }
.seg label { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); }
.seg input { width: auto; margin: 0; }
.mut { color: var(--ink-3); font-size: 12.5px; }
.mini { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.mini th, .mini td { padding: 6px 5px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.mini th { color: var(--ink-3); font-weight: 600; white-space: nowrap; }
.mini td.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pop { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding: 5px 0; border-top: 1px dashed var(--line); font-size: 12.5px; color: var(--ink-2); }
.pop:first-of-type { border-top: 0; }
.pop .win { color: #16a34a; font-weight: 600; }
.pop .n { font-variant-numeric: tabular-nums; }
.pop .calc { flex-basis: 100%; font-size: 11.5px; color: var(--ink-3); line-height: 1.5; }
.pop .calc b { color: var(--brand); }
.sug { background: #fffbeb; border: 1px dashed #fcd34d; border-radius: 9px; padding: 7px 10px; margin-top: 8px; font-size: 12.5px; color: #92400e; }
.sug.pend { background: #fef2f2; border-color: #fca5a5; color: #b91c1c; }
.sumgrid { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.sumgrid div { flex: 1 1 30%; background: #f8fafc; border-radius: 10px; padding: 8px 10px; text-align: center; }
.sumgrid b { display: block; font-size: 16px; color: var(--brand); }
.sumgrid span { font-size: 11.5px; color: var(--ink-3); }
/* 跟踪页「最新动态」条：刚进来的报价/定标摆在清单最上面 */
.evline { font-size: 12.5px; line-height: 1.9; color: var(--ink-2); }
.evline .mut { margin-left: 4px; }

/* ===== 工地端实时跟踪：进度条 / 逐行定标 / 收货 / 评价 ===== */
.trackhead { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.trackhead h4 { margin: 0; flex: 1; }
.livedot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #16a34a; margin-right: 5px; animation: pulse 1.6s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.btn-xs { padding: 4px 10px; border-radius: 8px; border: 1px solid var(--brand); background: #fff; color: var(--brand); font-size: 12px; font-weight: 600; cursor: pointer; }
.btn-xs.solid { background: var(--brand); color: #fff; }
.btn-xs.solid:active { opacity: .85; }
.btn-xs.plain { border-color: #cbd5e1; color: var(--ink-3); }
.btn-xs:disabled { opacity: .45; cursor: not-allowed; }

.stat3 { display: flex; gap: 8px; margin-bottom: 10px; }
.stat3 > div { flex: 1; background: #f8fafc; border-radius: 10px; padding: 9px 8px; text-align: center; border-left: 3px solid #cbd5e1; }
.stat3 > div.warn { border-left-color: #f59e0b; background: #fffbeb; }
.stat3 > div.ok { border-left-color: #16a34a; background: #f0fdf4; }
.stat3 b { display: block; font-size: 19px; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat3 span { font-size: 11.5px; color: var(--ink-3); }

.pl { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); margin: 6px 0 2px; }
.pl b { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.pbar { height: 7px; background: #e2e8f0; border-radius: 6px; overflow: hidden; }
.pbar > i { display: block; height: 100%; background: var(--brand); border-radius: 6px; transition: width .35s ease; }
.pbar > i.done { background: #16a34a; }
.pbar > i.warn { background: #f59e0b; }

.item.awarded { border-left: 3px solid #16a34a; }
.item .opt { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px dashed var(--line); font-size: 12.5px; }
.item .opt:first-of-type { border-top: 0; }
.item .opt .nm { flex: 1; min-width: 0; }
.item .opt .pr { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; }
.item .opt .pr.rec { color: #16a34a; }
.item .opt .calc { flex-basis: 100%; font-size: 11.5px; color: var(--ink-3); line-height: 1.5; }
.recflag { font-size: 11px; background: #dcfce7; color: #15803d; border-radius: 5px; padding: 1px 6px; font-weight: 600; }
.winflag { font-size: 11px; background: #dcfce7; color: #15803d; border-radius: 5px; padding: 1px 6px; font-weight: 600; }
.recvline { background: #f0fdf4; border: 1px dashed #86efac; border-radius: 9px; padding: 8px 10px; margin-top: 8px; font-size: 12.5px; color: #166534; }
.recvline input { margin: 6px 0 0; }

.shopcard { background: var(--card); border-radius: 12px; padding: 13px 14px; margin-bottom: 10px; box-shadow: 0 2px 8px rgba(15, 23, 42, .05); font-size: 13px; color: var(--ink-2); line-height: 1.6; }
.shopcard .nm { font-size: 15px; color: var(--ink); font-weight: 700; }
.stars { display: flex; align-items: center; gap: 4px; margin: 6px 0 0; }
.stars .star { font-size: 23px; line-height: 1; color: #cbd5e1; cursor: pointer; user-select: none; }
.stars .star.on { color: #f59e0b; }
.stars .mut { margin-left: 4px; }
.evbox { background: #f8fafc; border-radius: 9px; padding: 8px 10px; margin-top: 8px; font-size: 12.5px; }
.evbox .sc { color: #f59e0b; font-weight: 700; letter-spacing: 1px; }
