:root {
  --navy-900: #0b2740;
  --navy-800: #103b5c;
  --navy-700: #164a6e;
  --navy-600: #1d5a83;
  --blue-500: #2b7fb8;
  --blue-400: #4a9fd0;
  --blue-100: #e6f1f9;
  --teal-700: #0f6b57;
  --teal-600: #14856c;
  --teal-500: #1ba184;
  --teal-400: #34b898;
  --teal-100: #e4f5ef;
  --mint-50: #f2faf7;
  --ink: #1b2d3a;
  --ink-2: #40586a;
  --ink-3: #7b8f9d;
  --line: #dae5ec;
  --line-2: #eef3f7;
  --bg: #f4f8fa;
  --white: #ffffff;
  --warn: #d98324;
  --warn-bg: #fdf4e7;
  --danger: #c0392b;
  --danger-bg: #fdeeec;
  --ok: #14856c;
  --shadow-sm: 0 1px 2px rgba(16, 59, 92, .06), 0 2px 8px rgba(16, 59, 92, .04);
  --shadow: 0 4px 16px rgba(16, 59, 92, .08), 0 12px 32px rgba(16, 59, 92, .06);
  --shadow-lg: 0 12px 40px rgba(11, 39, 64, .14);
  --radius: 14px;
  --radius-sm: 9px;
  --grad: linear-gradient(125deg, #0e3350 0%, #14618a 48%, #12886f 100%);
  --grad-soft: linear-gradient(135deg, #eaf4fb 0%, #e6f6f1 100%);
  font-synthesis: none;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body.login-page-bg { background: #0b2740; }

button { font-family: inherit; font-size: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; color: var(--ink); }
a { color: var(--blue-500); text-decoration: none; }
table { border-collapse: collapse; width: 100%; }
::selection { background: #bfe6d8; }

/* ---------------- 布局骨架 ---------------- */
.app { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  height: 60px;
  background: var(--grad);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 22px;
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 2px 14px rgba(11, 39, 64, .18);
}
.topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; letter-spacing: .3px; }
.topbar .brand .logo-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: rgba(255,255,255,.16);
  display: grid; place-items: center;
  border: 1px solid rgba(255,255,255,.28);
}
.topbar .nav { display: flex; gap: 4px; margin-left: 18px; flex: 1; }
.topbar .nav a {
  color: rgba(255,255,255,.78);
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  transition: .18s;
  white-space: nowrap;
}
.topbar .nav a:hover { background: rgba(255,255,255,.12); color: #fff; }
.topbar .nav a.active { background: rgba(255,255,255,.18); color: #fff; font-weight: 600; box-shadow: inset 0 0 0 1px rgba(255,255,255,.16); }
.topbar .user-box { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, #7fd0b6, #4a9fd0);
  color: #0b2740; font-weight: 700; font-size: 12px;
  display: grid; place-items: center;
}

.page { flex: 1; width: 100%; max-width: 1320px; margin: 0 auto; padding: 22px 22px 60px; }
.page--narrow { max-width: 900px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-title { font-size: 22px; font-weight: 700; letter-spacing: .2px; color: var(--navy-900); margin: 0; }
.page-desc { color: var(--ink-3); font-size: 13px; margin-top: 4px; }

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--white);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card--pad { padding: 20px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 18px; border-bottom: 1px solid var(--line-2); gap: 12px; flex-wrap: wrap;
}
.card-title { font-weight: 700; font-size: 15px; color: var(--navy-800); display: flex; align-items: center; gap: 8px; }
.card-title .bar { width: 3px; height: 15px; border-radius: 2px; background: linear-gradient(180deg, var(--blue-500), var(--teal-500)); }
.card-body { padding: 18px; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 16px; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 600; transition: .16s; white-space: nowrap;
  border: 1px solid transparent;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(120deg, var(--blue-500), var(--teal-500)); color: #fff; box-shadow: 0 3px 10px rgba(27, 161, 132, .28); }
.btn-primary:hover { filter: brightness(1.06); box-shadow: 0 5px 16px rgba(27, 161, 132, .34); }
.btn-outline { border-color: var(--line); background: #fff; color: var(--navy-700); }
.btn-outline:hover { border-color: var(--blue-400); background: #f8fbfd; color: var(--blue-500); }
.btn-ghost { color: var(--ink-2); }
.btn-ghost:hover { background: var(--line-2); }
.btn-danger { background: var(--danger-bg); color: var(--danger); border-color: #f3cfc9; }
.btn-danger:hover { background: #fbe2de; }
.btn-sm { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: 7px; gap: 5px; }
.btn-lg { height: 46px; padding: 0 26px; font-size: 15px; border-radius: 11px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }

/* ---------------- 表单 ---------------- */
.field { margin-bottom: 14px; }
.label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.label .req { color: var(--danger); margin-left: 2px; }
.input, .select, .textarea {
  width: 100%; height: 38px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; transition: .16s; outline: none;
}
.textarea { height: auto; min-height: 76px; padding: 9px 12px; resize: vertical; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--teal-500); box-shadow: 0 0 0 3px rgba(27, 161, 132, .12); }
.input.err, .select.err { border-color: #e0a39a; background: #fffafa; }
.input::placeholder { color: #a9b8c4; }
.select { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2 4.5L6 8.5L10 4.5' stroke='%237b8f9d' stroke-width='1.6' fill='none' stroke-linecap='round'/></svg>"); background-repeat: no-repeat; background-position: right 11px center; padding-right: 30px; }
.input-sm { height: 32px; font-size: 13px; padding: 0 9px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.hint { font-size: 12px; color: var(--ink-3); margin-top: 5px; }

/* ---------------- 标签 / 徽章 ---------------- */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px; border-radius: 6px;
  font-size: 11.5px; font-weight: 600;
  background: var(--blue-100); color: var(--navy-700);
}
.tag--teal { background: var(--teal-100); color: var(--teal-700); }
.tag--warn { background: var(--warn-bg); color: var(--warn); }
.tag--gray { background: #eef2f5; color: var(--ink-3); }
.tag--danger { background: var(--danger-bg); color: var(--danger); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; border-radius: 0 0 var(--radius) var(--radius); }
.tbl { font-size: 13px; min-width: 760px; }
.tbl th {
  background: #f7fafc; color: var(--ink-2); font-weight: 600; font-size: 12px;
  text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--line);
  white-space: nowrap; position: sticky; top: 0; z-index: 2;
}
.tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tbody tr:hover { background: #fbfdfe; }
.tbl tbody tr.is-off { opacity: .55; }
.tbl tbody tr.is-off .c-name { text-decoration: line-through; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.cell-input {
  width: 100%; border: 1px solid transparent; border-radius: 6px;
  padding: 5px 6px; background: transparent; outline: none; font-size: 13px;
  min-width: 0;
}
.cell-input:hover { border-color: var(--line); background: #fff; }
.cell-input:focus { border-color: var(--teal-500); background: #fff; box-shadow: 0 0 0 2px rgba(27,161,132,.1); }
.cell-input.missing { border-color: #f0c9a0; background: var(--warn-bg); }
.cell-input.missing::placeholder { color: #c99a63; }
.cell-num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------------- 空状态 / 加载 ---------------- */
.empty { text-align: center; padding: 54px 20px; color: var(--ink-3); }
.empty .ico { font-size: 40px; opacity: .5; margin-bottom: 10px; }
.empty h4 { margin: 0 0 6px; color: var(--ink-2); font-size: 15px; }

.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.35); border-top-color: #fff;
  animation: spin .7s linear infinite; display: inline-block;
}
.spinner--dark { border-color: rgba(16,59,92,.18); border-top-color: var(--teal-500); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- 弹层 ---------------- */
.mask {
  position: fixed; inset: 0; background: rgba(9, 30, 47, .5);
  backdrop-filter: blur(2px); z-index: 90;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.modal {
  background: #fff; border-radius: 16px; width: 100%; max-width: 520px;
  max-height: 88vh; display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg); animation: pop .2s cubic-bezier(.2,.9,.3,1.2);
}
.modal--wide { max-width: 860px; }
.modal--full { max-width: 1180px; }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0 } to { transform: none; opacity: 1 } }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { margin: 0; font-size: 16px; color: var(--navy-900); }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line-2); display: flex; justify-content: flex-end; gap: 10px; background: #fcfdfe; border-radius: 0 0 16px 16px; }
.x-btn { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: var(--ink-3); font-size: 18px; }
.x-btn:hover { background: var(--line-2); color: var(--ink); }

.toast-wrap { position: fixed; top: 74px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: var(--navy-900); color: #fff; padding: 10px 18px; border-radius: 10px;
  font-size: 13.5px; box-shadow: var(--shadow-lg); animation: toastIn .22s ease;
  display: flex; align-items: center; gap: 8px; max-width: 88vw;
}
.toast--ok { background: #0f6b57; }
.toast--err { background: #a93226; }
@keyframes toastIn { from { transform: translateY(-8px); opacity: 0 } to { transform: none; opacity: 1 } }

/* ---------------- 登录页 ---------------- */
.auth-wrap { min-height: 100vh; display: flex; }
.auth-left {
  flex: 1.15; background: var(--grad); color: #fff; padding: 52px 56px;
  display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden;
}
.auth-left::after {
  content: ""; position: absolute; right: -120px; bottom: -140px; width: 420px; height: 420px;
  border-radius: 50%; background: radial-gradient(circle, rgba(52,184,152,.35), transparent 68%);
}
.auth-left::before {
  content: ""; position: absolute; left: -80px; top: -100px; width: 340px; height: 340px;
  border-radius: 50%; background: radial-gradient(circle, rgba(74,159,208,.3), transparent 70%);
}
.auth-brand { display: flex; align-items: center; gap: 12px; font-size: 17px; font-weight: 700; position: relative; z-index: 1; }
.auth-hero { position: relative; z-index: 1; max-width: 460px; }
.auth-hero h1 { font-size: 34px; line-height: 1.3; margin: 0 0 16px; letter-spacing: .5px; font-weight: 700; }
.auth-hero p { color: rgba(255,255,255,.72); font-size: 14.5px; line-height: 1.9; margin: 0 0 26px; }
.auth-feats { display: flex; flex-direction: column; gap: 14px; }
.auth-feat { display: flex; gap: 11px; align-items: flex-start; font-size: 13.5px; color: rgba(255,255,255,.9); }
.auth-feat .fi {
  width: 26px; height: 26px; border-radius: 8px; flex: none; display: grid; place-items: center;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.2); font-size: 13px;
}
.auth-foot { position: relative; z-index: 1; color: rgba(255,255,255,.45); font-size: 12px; }

.auth-right { width: 470px; background: #fff; display: flex; align-items: center; justify-content: center; padding: 40px; }
.auth-form { width: 100%; max-width: 340px; }
.auth-form h2 { font-size: 24px; margin: 0 0 6px; color: var(--navy-900); }
.auth-form .sub { color: var(--ink-3); font-size: 13px; margin-bottom: 26px; }

.tabs { display: flex; background: #eef4f8; padding: 3px; border-radius: 9px; margin-bottom: 20px; }
.tabs button { flex: 1; height: 32px; border-radius: 7px; font-size: 13px; color: var(--ink-2); font-weight: 600; transition: .16s; }
.tabs button.active { background: #fff; color: var(--navy-800); box-shadow: var(--shadow-sm); }

.code-row { display: flex; gap: 8px; }
.code-row .input { flex: 1; }
.demo-tip {
  background: var(--teal-100); border: 1px dashed #a8ddca; color: var(--teal-700);
  border-radius: 9px; padding: 9px 12px; font-size: 12.5px; margin-top: 14px; line-height: 1.7;
}
.divider-or { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 12px; margin: 18px 0; }
.divider-or::before, .divider-or::after { content: ""; height: 1px; background: var(--line); flex: 1; }

/* ---------------- 首页 ---------------- */
.hero {
  background: var(--grad); border-radius: 18px; color: #fff; padding: 30px 32px;
  display: flex; justify-content: space-between; align-items: center; gap: 26px;
  box-shadow: 0 10px 30px rgba(11,39,64,.16); position: relative; overflow: hidden;
}
.hero::after { content: ""; position: absolute; right: -60px; top: -80px; width: 300px; height: 300px; border-radius: 50%; background: radial-gradient(circle, rgba(52,184,152,.32), transparent 70%); }
.hero h1 { font-size: 26px; margin: 0 0 10px; font-weight: 700; }
.hero p { margin: 0; color: rgba(255,255,255,.75); font-size: 13.5px; }
.hero .hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-white { background: #fff; color: var(--navy-800); box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.btn-white:hover { background: #f2fbf7; }
.btn-glass { background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.28); }
.btn-glass:hover { background: rgba(255,255,255,.22); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 18px 0; }
.stat {
  background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.stat .k { font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.stat .v { font-size: 25px; font-weight: 700; color: var(--navy-800); margin-top: 6px; letter-spacing: -.4px; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: 12px; font-weight: 500; color: var(--ink-3); margin-left: 4px; }
.stat .ico-bg { position: absolute; right: 12px; top: 14px; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--grad-soft); font-size: 16px; }

.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.proj-card {
  background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 17px 18px; box-shadow: var(--shadow-sm); transition: .18s; cursor: pointer; position: relative;
}
.proj-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #cfe3ee; }
.proj-card h4 { margin: 0 0 5px; font-size: 15.5px; color: var(--navy-900); display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.proj-card .meta { color: var(--ink-3); font-size: 12.5px; display: flex; flex-direction: column; gap: 3px; margin: 8px 0 12px; }
.proj-card .foot { display: flex; justify-content: space-between; align-items: center; border-top: 1px dashed var(--line); padding-top: 11px; font-size: 12.5px; }
.proj-card .amount { font-size: 18px; font-weight: 700; color: var(--teal-700); font-variant-numeric: tabular-nums; }
.proj-card .amount span { font-size: 12px; color: var(--ink-3); font-weight: 400; }

/* ---------------- 导入工作台 ---------------- */
.dropzone {
  border: 2px dashed #b9d5e4; border-radius: 16px; background: linear-gradient(180deg, #fbfdfe, #f4fbf8);
  padding: 38px 24px; text-align: center; transition: .18s; cursor: pointer;
}
.dropzone:hover, .dropzone.drag { border-color: var(--teal-500); background: #f1fbf7; }
.dropzone .di { font-size: 38px; margin-bottom: 8px; }
.dropzone h4 { margin: 0 0 6px; font-size: 16px; color: var(--navy-800); }
.dropzone p { margin: 0; color: var(--ink-3); font-size: 12.8px; }
.file-types { display: flex; gap: 8px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }

.progress { height: 5px; background: #e8eff4; border-radius: 4px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue-500), var(--teal-400)); border-radius: 4px; transition: width .3s; }

.review-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 16px; background: #f7fafc; border: 1px solid var(--line-2);
  border-radius: 11px; margin-bottom: 12px;
}
.review-toolbar .grow { flex: 1; }
.badge-count { background: var(--navy-800); color: #fff; border-radius: 20px; padding: 2px 9px; font-size: 12px; font-weight: 600; }

.issue-legend { display: flex; gap: 14px; font-size: 12px; color: var(--ink-3); align-items: center; flex-wrap: wrap; }
.issue-legend .k { display: inline-flex; align-items: center; gap: 5px; }
.issue-legend .sw { width: 10px; height: 10px; border-radius: 3px; }

.sticky-foot {
  position: sticky; bottom: 0; background: rgba(255,255,255,.96); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line); padding: 12px 16px; display: flex; gap: 10px;
  align-items: center; justify-content: space-between; margin: 14px -18px -18px; flex-wrap: wrap;
}

.thumb-list { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.thumb { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); }

/* ---------------- 报价单（右侧汇总） ---------------- */
.summary-box { position: sticky; top: 76px; }
.sum-row { display: flex; justify-content: space-between; padding: 7px 0; font-size: 13px; color: var(--ink-2); }
.sum-row.total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 12px; font-size: 17px; font-weight: 700; color: var(--navy-900); }
.sum-row.total b { color: #c0392b; font-variant-numeric: tabular-nums; }
.sum-row b { font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---------------- 管理后台 ---------------- */
.admin-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.admin-tabs button {
  padding: 10px 16px; font-size: 13.5px; font-weight: 600; color: var(--ink-3);
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.admin-tabs button.active { color: var(--teal-700); border-bottom-color: var(--teal-500); }

.kv-list { display: grid; grid-template-columns: 90px 1fr; gap: 8px 12px; font-size: 13px; }

/* ---------------- 报价库选择器 ---------------- */
.picker { display: grid; grid-template-columns: 300px 1fr; gap: 16px; }
.picker-list { max-height: 52vh; overflow-y: auto; border: 1px solid var(--line-2); border-radius: 10px; }
.pick-item { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.pick-item:hover { background: #f8fbfd; }
.pick-item.on { background: var(--teal-100); }
.pick-item .nm { font-weight: 600; font-size: 13px; color: var(--navy-800); }
.pick-item .sub { font-size: 11.5px; color: var(--ink-3); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  height: 28px; padding: 0 11px; border-radius: 20px; font-size: 12.5px;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2); display: inline-flex; align-items: center;
}
.chip.on { background: var(--navy-800); color: #fff; border-color: var(--navy-800); }

/* ---------------- 移动端 ---------------- */
@media (max-width: 1080px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .picker { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .auth-left { display: none; }
  .auth-right { width: 100%; padding: 26px 20px; }
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar .nav { margin-left: 0; overflow-x: auto; }
  .topbar .brand span.txt { display: none; }
  .page { padding: 14px 12px 80px; }
  .hero { flex-direction: column; align-items: flex-start; padding: 22px; }
  .hero h1 { font-size: 21px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .proj-grid { grid-template-columns: 1fr; }
  .page-title { font-size: 19px; }
  .modal-body { padding: 14px; }
  .sticky-foot { margin: 14px -14px -14px; }
}
@media (max-width: 520px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat .v { font-size: 20px; }
  .topbar .user-box .uname { display: none; }
}

/* ================= 选材大厅（小程序风格） ================= */
.hall {
  max-width: 560px; margin: 0 auto; min-height: 100vh; background: var(--bg);
  padding-bottom: 86px; position: relative;
}
.hall-head {
  background: linear-gradient(135deg, #1157a5 0%, #1478c8 55%, #159a80 130%);
  color: #fff; padding: 18px 18px 62px; border-radius: 0 0 22px 22px;
  position: relative;
}
.hall-brand { display: flex; align-items: center; gap: 10px; }
.hall-brand .hb-ico {
  width: 40px; height: 40px; border-radius: 12px; background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.3); display: grid; place-items: center; font-size: 20px;
}
.hall-brand h1 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: .5px; }
.hall-brand p { margin: 2px 0 0; font-size: 11.5px; opacity: .8; }
.hall-user {
  position: absolute; right: 16px; top: 20px; display: flex; align-items: center; gap: 7px;
  font-size: 12px; cursor: pointer; opacity: .95;
}
.hall-search {
  margin: 16px 18px -30px; position: relative; z-index: 3;
}
.hall-search .box {
  display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 24px;
  height: 44px; padding: 0 16px; box-shadow: 0 6px 18px rgba(10,50,90,.14);
}
.hall-search input { border: none; outline: none; flex: 1; font-size: 13.5px; background: transparent; }
.hall-search .si { color: #9ab; font-size: 15px; }
.hall-chips {
  display: flex; gap: 8px; padding: 42px 14px 12px; overflow-x: auto; scrollbar-width: none;
}
.hall-chips::-webkit-scrollbar { display: none; }
.hchip {
  flex: none; height: 34px; padding: 0 15px; border-radius: 18px; background: #fff;
  border: 1px solid var(--line); color: var(--ink-2); font-size: 13px; font-weight: 500;
  display: inline-flex; align-items: center; transition: .15s;
}
.hchip.on { background: #1157a5; color: #fff; border-color: #1157a5; box-shadow: 0 4px 12px rgba(17,87,165,.3); }
.hall-list { padding: 4px 14px 10px; display: flex; flex-direction: column; gap: 12px; }
.mat-card {
  background: #fff; border-radius: 16px; padding: 12px; display: flex; gap: 12px;
  box-shadow: 0 2px 10px rgba(16,59,92,.06); cursor: pointer; transition: .16s;
  border: 1px solid transparent;
}
.mat-card:active { transform: scale(.985); }
.mat-card:hover { box-shadow: 0 6px 18px rgba(16,59,92,.1); }
.mat-img {
  width: 104px; height: 84px; border-radius: 10px; object-fit: cover; flex: none; background: #eef4f8;
}
.mat-img.ph { display: grid; place-items: center; overflow: hidden; }
.mat-img.ph svg { width: 100%; height: 100%; }
.mat-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mat-name { font-size: 15px; font-weight: 700; color: var(--navy-900); margin: 2px 0 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mat-spec { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mat-foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; }
.mat-price { color: #12a07a; font-weight: 700; font-size: 16px; }
.mat-price small { font-size: 11px; color: var(--ink-3); font-weight: 400; }
.mat-view {
  height: 28px; padding: 0 12px; border-radius: 15px; border: 1px solid #cfe0ee;
  color: #1157a5; font-size: 12.5px; font-weight: 600; background: #f6fafd;
  display: inline-flex; align-items: center; gap: 3px;
}
.hall-fab {
  position: fixed; right: calc(50% - 260px + 18px); bottom: 104px; width: 50px; height: 50px;
  border-radius: 50%; background: linear-gradient(135deg, #1478c8, #12a07a); color: #fff;
  display: grid; place-items: center; font-size: 21px; box-shadow: 0 8px 22px rgba(18,120,160,.4);
  z-index: 30; border: 3px solid #fff; cursor: pointer; transition: .15s;
}
.hall-fab:active { transform: scale(.93); }
@media (max-width: 560px) { .hall-fab { right: 16px; } }

.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 560px; background: #fff; z-index: 40;
  display: flex; border-top: 1px solid var(--line-2);
  box-shadow: 0 -4px 16px rgba(16,59,92,.05); padding-bottom: env(safe-area-inset-bottom);
}
.tabbar button {
  flex: 1; height: 60px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px; color: #93a5b1; font-size: 11px; transition: .15s;
}
.tabbar button .ti { font-size: 21px; line-height: 1; }
.tabbar button.on { color: #12a07a; font-weight: 600; }

/* 材料详情弹层 */
.mat-detail-top { border-radius: 14px; overflow: hidden; height: 190px; margin-bottom: 14px; background: #eef4f8; }
.mat-detail-top img, .mat-detail-top svg.ph-big { width: 100%; height: 100%; object-fit: cover; display: block; }
.price-big { font-size: 24px; color: #12a07a; font-weight: 700; }

/* 我的页 */
.mine-wrap { max-width: 560px; margin: 0 auto; min-height: 100vh; padding-bottom: 96px; }
.mine-head {
  background: linear-gradient(135deg, #1157a5, #159a80); color: #fff;
  padding: 34px 22px 46px; border-radius: 0 0 22px 22px; display: flex; align-items: center; gap: 14px;
}
.mine-head .avatar { width: 56px; height: 56px; font-size: 22px; background: rgba(255,255,255,.22); color: #fff; border: 1px solid rgba(255,255,255,.35); }
.mine-cards { padding: 0 14px; margin-top: -24px; display: flex; flex-direction: column; gap: 12px; }
.mine-item {
  background: #fff; border-radius: 14px; padding: 15px 17px; display: flex; align-items: center;
  gap: 12px; box-shadow: 0 2px 10px rgba(16,59,92,.06); cursor: pointer; font-size: 14px;
}
.mine-item:active { background: #f7fafc; }
.mine-item .mi { width: 34px; height: 34px; border-radius: 10px; background: var(--grad-soft); display: grid; place-items: center; font-size: 16px; }
.mine-item .arrow { margin-left: auto; color: #b7c6d1; }
.mine-item .sub { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }

/* 图片上传 */
.img-pick { display: flex; gap: 12px; align-items: center; }
.img-prev {
  width: 92px; height: 70px; border-radius: 10px; object-fit: cover; background: #eef4f8;
  border: 1px solid var(--line); display: grid; place-items: center; color: #a9b8c4; font-size: 11px;
  overflow: hidden;
}
.img-pick .ops { flex: 1; display: flex; flex-direction: column; gap: 8px; }

/* 报价库缩略图 */
.qthumb { width: 46px; height: 36px; border-radius: 6px; object-fit: cover; background: #eef4f8; display: block; }

/* ================= 电脑端手机预览壳 ================= */
.phone-stage { display: contents; }
.phone-cap { display: none; }

@media (min-width: 900px) {
  body:has(.phone-shell) {
    background:
      radial-gradient(800px 400px at 12% -5%, rgba(20,120,200,.10), transparent 60%),
      radial-gradient(700px 420px at 92% 105%, rgba(21,154,128,.12), transparent 60%),
      #eef3f7;
  }
  .phone-stage {
    display: flex; flex-direction: column; align-items: center; gap: 14px;
    padding: 26px 0 40px; min-height: 100vh;
  }
  .phone-shell {
    width: 412px; height: min(880px, 90vh);
    border-radius: 48px; border: 11px solid #0b2740;
    background: var(--bg); overflow: hidden; position: relative;
    box-shadow: 0 34px 90px rgba(11, 39, 64, .30), 0 4px 18px rgba(11,39,64,.12), inset 0 0 0 2px rgba(255,255,255,.5);
  }
  .phone-shell::before {
    content: ""; position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
    width: 110px; height: 22px; border-radius: 12px; background: #0b2740; z-index: 60;
  }
  .phone-screen { height: 100%; overflow-y: auto; position: relative; scrollbar-width: thin; }
  .hall { max-width: none; padding-bottom: 84px; }
  .mine-wrap { max-width: none; padding-bottom: 84px; }
  .tabbar { position: absolute; bottom: 0; left: 0; right: 0; max-width: none; transform: none; }
  .hall-fab { position: absolute; right: 18px; bottom: 88px; }
  .hall-head { padding-top: 44px; border-radius: 0 0 22px 22px; }
  .mine-head { padding-top: 58px; }
  .phone-cap {
    display: inline-flex; align-items: center; gap: 7px;
    background: #fff; border: 1px solid var(--line); border-radius: 20px;
    padding: 7px 16px; font-size: 12.5px; color: var(--ink-3); box-shadow: var(--shadow-sm);
  }
}

/* ================= 报价库多选操作 ================= */
.tbl tr.tr--sel > td { background: #eaf6f2 !important; }
.tbl tbody tr > td:first-child { text-align: center; }
.sel-bar {
  position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 20px);
  display: none; align-items: center; gap: 18px;
  background: #0b2740; color: #fff; border-radius: 14px;
  padding: 10px 12px 10px 20px; z-index: 80;
  box-shadow: 0 18px 44px rgba(11, 39, 64, .34);
  animation: selIn .18s ease-out forwards;
}
.sel-bar.on { display: flex; }
@keyframes selIn { to { transform: translate(-50%, 0); opacity: 1; } }
.sel-info { font-size: 13.5px; color: #cfe0ec; white-space: nowrap; }
.sel-info b { color: #fff; font-size: 16px; margin: 0 2px; }
.sel-act { display: flex; align-items: center; gap: 6px; }
.sel-bar .btn-ghost { color: #cfe0ec; border-color: transparent; }
.sel-bar .btn-ghost:hover { color: #fff; background: rgba(255, 255, 255, .12); }
.btn-danger { background: #d64541; color: #fff; border: 1px solid #d64541; }
.btn-danger:hover { background: #bf3a36; border-color: #bf3a36; }
@media (max-width: 640px) {
  .sel-bar { left: 10px; right: 10px; bottom: 10px; transform: none; padding: 10px 12px; gap: 10px; flex-wrap: wrap; }
  .sel-bar.on { display: flex; }
  @keyframes selIn { from { opacity: 0; } to { opacity: 1; } }
}

/* ================= 小程序 web-view 模式 ================= */
body.wxmp .topbar { display: none; }
body.wxmp .app { padding-top: 0; }
body.wxmp .page { padding-top: 14px; }
