/* ============================================================
   项目跟进与客户资源管理系统 · 样式
   设计基调：商务、稳重、清晰（深海军蓝 + 香槟金）
   ============================================================ */

:root {
  --brand: #1B3A5C;
  --brand-2: #2C5C8A;
  --brand-3: #EAF0F7;
  --accent: #C89B3C;
  --accent-soft: #FBF4E4;

  --bg: #F4F6F9;
  --card: #FFFFFF;
  --text: #16232F;
  --text-2: #5A6B7C;
  --text-3: #93A1B0;
  --border: #E4E9F0;
  --border-2: #EFF3F8;

  --ok: #1E9E5A;
  --warn: #E08B2E;
  --danger: #D9483B;
  --info: #3B7DD8;

  --lvl-s: #C89B3C;
  --lvl-a: #D9483B;
  --lvl-b: #E08B2E;
  --lvl-c: #3B7DD8;
  --lvl-d: #8C97A4;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow-1: 0 1px 2px rgba(22, 35, 47, .05), 0 2px 8px rgba(22, 35, 47, .045);
  --shadow-2: 0 4px 16px rgba(22, 35, 47, .10);
  --shadow-3: 0 16px 48px rgba(22, 35, 47, .18);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p { margin: 0; }
input, select, textarea, button { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: var(--brand-2); text-decoration: none; }
[hidden] { display: none !important; }

/* ============================ 登录页 ============================ */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px 20px;
  background:
    radial-gradient(900px 460px at 12% -10%, #23496F 0%, transparent 60%),
    radial-gradient(760px 420px at 100% 108%, #2C5C8A 0%, transparent 62%),
    linear-gradient(160deg, #16304D 0%, #1B3A5C 55%, #22456B 100%);
}
.login-card {
  width: 100%; max-width: 388px; background: #fff; border-radius: 20px;
  padding: 34px 28px 26px; box-shadow: var(--shadow-3);
  animation: riseIn .45s cubic-bezier(.2, .8, .25, 1);
}
@keyframes riseIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.login-brand { display: flex; align-items: center; gap: 13px; margin-bottom: 26px; }
.login-brand svg { flex: 0 0 auto; border-radius: 13px; }
.login-brand h1 { font-size: 20px; font-weight: 700; letter-spacing: .4px; }
.login-brand p { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.login-error {
  background: #FDECEA; color: var(--danger); border: 1px solid #F7CDC7;
  padding: 9px 12px; border-radius: 9px; font-size: 13px; margin-bottom: 12px;
}
.login-tip { font-size: 11.5px; color: var(--text-3); text-align: center; margin-top: 18px; line-height: 1.7; }
/* 备案信息（v178）：工信部要求页脚展示备案号并链接至 beian.miit.gov.cn */
.icp-footer a { color: inherit; text-decoration: none; border-bottom: 1px dotted currentColor; }
.icp-footer a:hover { color: var(--brand-1); border-bottom-style: solid; }

.qr-card {
  margin-top: 16px;
  padding: 14px;
  background: var(--brand-3);
  border: 1px solid #D6E0EB;
  border-radius: 12px;
  animation: floatIn .35s .1s both cubic-bezier(.2, .8, .25, 1);
}
@keyframes floatIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.qr-head {
  display: flex; align-items: center; gap: 7px;
  font-weight: 600; font-size: 13px; color: var(--brand);
  margin-bottom: 10px;
}
.qr-body { display: flex; align-items: flex-start; gap: 14px; }
.qr-body img {
  width: 92px; height: 92px; border-radius: 8px;
  background: #fff; padding: 5px; border: 1px solid var(--border);
  flex: 0 0 auto; max-width: 100%; object-fit: contain;
}
.qr-desc { font-size: 12px; color: var(--text-2); line-height: 1.65; margin: 0 0 8px; }
/* v82 微信扫码提示：微信会拦截纯 IP 链接，醒目提示改用相机扫码 */
.qr-warn {
  color: #B23B2E; background: #FDF3F1; border-left: 3px solid #E0764F;
  border-radius: 4px; padding: 7px 10px; margin-top: 2px;
}
.qr-warn strong { color: #9C3226; }
.qr-url  { font-size: 11px; color: var(--brand-2); word-break: break-all; font-family: ui-monospace, monospace; }
.qr-info { flex: 1; min-width: 0; }
.qr-url-row { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.qr-url-row .qr-url { flex: 1; min-width: 0; }
.qr-copy {
  flex: 0 0 auto; padding: 3px 9px;
  background: var(--brand); color: #fff;
  border-radius: 6px; font-size: 11px;
  font-weight: 500;
  transition: background .15s;
}
.qr-copy:hover { background: var(--brand-2); }
.qr-copy:active { transform: scale(0.95); }
.qr-tip { margin-top: 6px; font-size: 11px; color: var(--text-3); }
.qr-public { background: #F0F9FF; border-color: #BAE6FD; }
.qr-public .qr-head { color: #0369A1; }
.qr-public .qr-url { color: #0369A1; }
.qr-public .qr-copy { background: #0EA5E9; }
.qr-public .qr-copy:hover { background: #0284C7; }
.qr-public .qr-tip summary:hover { color: #0284C7; }
.qr-tip summary { cursor: pointer; user-select: none; padding: 2px 0; }
.qr-tip summary:hover { color: var(--brand-2); }
.qr-tip ol { margin: 4px 0 0; padding-left: 18px; line-height: 1.7; }
.qr-tip li { margin-bottom: 1px; }

/* v81 登录页：本机测试环境提示条 */
.env-tip {
  display: flex; align-items: flex-start; gap: 7px;
  margin-top: 14px; padding: 10px 12px;
  background: #FFF7ED; border: 1px solid #FED7AA; border-radius: 10px;
  font-size: 11.5px; line-height: 1.6; color: #9A3412;
}
.env-tip svg { flex: 0 0 auto; margin-top: 1px; color: #EA580C; }

/* v81 登录页：一键安装按钮 */
.install-one {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; padding: 10px 14px; margin-bottom: 10px;
  background: var(--brand); color: #fff; border-radius: 9px;
  font-size: 13px; font-weight: 600; transition: background .15s, transform .1s;
}
.install-one:hover { background: var(--brand-2); }
.install-one:active { transform: scale(.99); }
.qr-dim { color: var(--text-3) !important; font-size: 11.5px !important; margin-bottom: 0 !important; }
#installBody .qr-desc:last-child { margin-bottom: 0; }

@media (max-width: 420px) {
  .qr-body { flex-direction: column; align-items: center; text-align: center; gap: 10px; }
  .qr-body img { width: 84px; height: 84px; }
  .qr-desc { font-size: 11.5px; }
  .qr-url  { font-size: 10px; }
}

/* ============================ 表单控件 ============================ */
.field { margin-bottom: 15px; }
.field > label {
  display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2);
  margin-bottom: 6px; letter-spacing: .2px;
}
.field .req::after { content: ' *'; color: var(--danger); }
input[type=text], input[type=password], input[type=number], input[type=date],
input[type=tel], select, textarea {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); background: #fff; outline: none;
  transition: border-color .16s, box-shadow .16s, background .16s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--brand-2); box-shadow: 0 0 0 3.5px rgba(44, 92, 138, .12);
}
input:disabled, select:disabled { background: #F7F9FB; color: var(--text-3); cursor: not-allowed; }
textarea { resize: vertical; min-height: 92px; line-height: 1.65; }
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' stroke='%235A6B7C' stroke-width='2.2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; background-size: 17px;
  padding-right: 34px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
/* v162 团队管理顶部筛选：部门 / 岗位 / 姓名 三个维度固定一行内展示 */
.form-row-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.hint { font-size: 11.5px; color: var(--text-3); margin-top: 5px; line-height: 1.55; }

/* ============================ 按钮 ============================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 18px; border-radius: var(--radius-sm); font-weight: 600;
  font-size: 14px; transition: transform .1s, box-shadow .16s, background .16s, opacity .16s;
  white-space: nowrap;
}
.btn:active { transform: scale(.978); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 2px 8px rgba(27, 58, 92, .24); }
.btn-primary:hover { background: #16314E; }
.btn-accent { background: var(--accent); color: #fff; box-shadow: 0 2px 8px rgba(200, 155, 60, .3); }
.btn-accent:hover { background: #B98B2E; }
.btn-success { background: var(--ok); color: #fff; box-shadow: 0 2px 8px rgba(30, 158, 90, .28); }
.btn-success:hover { background: #17864C; }
.btn-ghost { background: #fff; color: var(--text-2); border: 1.5px solid var(--border); }
.btn-ghost:hover { background: #F7F9FC; color: var(--text); }
.btn-danger { background: #fff; color: var(--danger); border: 1.5px solid #F4C7C1; }
.btn-danger:hover { background: #FDF3F2; }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 13px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; display: inline-flex;
  align-items: center; justify-content: center; color: var(--text-2);
  transition: background .16s, color .16s;
}
.icon-btn:hover { background: var(--border-2); color: var(--brand); }

/* ============================ 布局 ============================ */
.app { display: flex; min-height: 100%; }
.sidebar {
  width: 226px; flex: 0 0 226px; background: var(--brand); color: #fff;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.side-brand {
  display: flex; align-items: center; gap: 9px; padding: 20px 18px 18px;
  font-weight: 700; font-size: 15.5px; letter-spacing: .5px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}
.side-nav { flex: 1; padding: 12px 10px; overflow-y: auto; }
.side-nav .nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10.5px 12px; border-radius: 10px; color: rgba(255, 255, 255, .78);
  font-size: 14px; font-weight: 500; margin-bottom: 3px; transition: background .16s, color .16s;
  text-align: left;
}
.side-nav .nav-item svg { flex: 0 0 auto; opacity: .9; }
.side-nav .nav-item:hover { background: rgba(255, 255, 255, .09); color: #fff; }
.side-nav .nav-item.active { background: rgba(200, 155, 60, .2); color: #fff; }
.side-nav .nav-item.active svg { color: var(--accent); }
.side-nav .nav-badge {
  margin-left: auto; background: rgba(255, 255, 255, .16); border-radius: 20px;
  padding: 1px 8px; font-size: 11.5px; font-weight: 600;
}
/* v89 审批管理待审批红点：未审批单据数量 */
.side-nav .nav-badge.num {
  background: #E5484D; color: #fff; min-width: 20px; padding: 1px 6px;
  text-align: center; font-style: normal; font-weight: 700;
  box-shadow: 0 0 0 2px rgba(229, 72, 77, .25);
}
.side-foot { padding: 14px 14px calc(14px + var(--safe-b)); border-top: 1px solid rgba(255, 255, 255, .1); }
.side-user { display: flex; align-items: center; gap: 9px; margin-bottom: 11px; }
.side-user .avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--brand);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px;
}
.side-user .u-name { font-size: 13.5px; font-weight: 600; }
.side-user .u-role { font-size: 11.5px; color: rgba(255, 255, 255, .62); }
.side-foot .btn-ghost { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .18); color: rgba(255, 255, 255, .9); }
.side-foot .btn-ghost:hover { background: rgba(255, 255, 255, .18); color: #fff; }

.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 58px; flex: 0 0 58px; background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px; padding: 0 16px;
  position: sticky; top: 0; z-index: 30;
}
.topbar h2 { font-size: 16.5px; font-weight: 700; letter-spacing: .3px; }
.topbar-right { margin-left: auto; display: flex; gap: 2px; }
.menu-btn { display: none; }
.page-content { flex: 1; padding: 18px; max-width: 1180px; width: 100%; margin: 0 auto; }
.tabbar { display: none; }
.scrim {
  display: none; position: fixed; inset: 0; background: rgba(16, 28, 42, .45);
  z-index: 90; backdrop-filter: blur(2px);
}
.scrim.show { display: block; }

/* ============================ 卡片 ============================ */
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-1);
  border: 1px solid var(--border-2); overflow: hidden;
}
.card + .card { margin-top: 14px; }
.card-head {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px;
  border-bottom: 1px solid var(--border-2);
}
.card-head h3 { font-size: 14.5px; font-weight: 700; }
.card-head .spacer { flex: 1; }
.card-body { padding: 16px; }

.section-title {
  font-size: 13px; font-weight: 700; color: var(--text-2); letter-spacing: .6px;
  margin: 22px 0 10px; display: flex; align-items: center; gap: 8px;
}
.section-title::before { content: ''; width: 3px; height: 13px; background: var(--accent); border-radius: 2px; }
.section-title:first-child { margin-top: 0; }

/* ============================ 统计看板 ============================ */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat {
  background: #fff; border-radius: var(--radius); padding: 15px 16px;
  border: 1px solid var(--border-2); box-shadow: var(--shadow-1); position: relative; overflow: hidden;
}
.stat::after {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--brand-2); border-radius: 0 3px 3px 0;
}
.stat.s-won::after { background: var(--ok); }
.stat.s-s::after { background: var(--lvl-s); }
.stat.s-budget::after { background: var(--accent); }
.stat .s-label { font-size: 12px; color: var(--text-3); font-weight: 500; letter-spacing: .2px; }
.stat .s-value { font-size: 24px; font-weight: 800; letter-spacing: -.5px; margin-top: 3px; font-variant-numeric: tabular-nums; }
.stat .s-unit { font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-left: 3px; }
.stat .s-sub { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }

.bar-list { display: flex; flex-direction: column; gap: 11px; }
.bar-item .b-top { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 5px; }
.bar-item .b-top b { font-weight: 700; font-variant-numeric: tabular-nums; }
.bar-track { height: 7px; background: var(--border-2); border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; background: var(--brand-2); transition: width .6s cubic-bezier(.2, .8, .25, 1); }

/* ============================ 项目卡片 ============================ */
.filters {
  display: flex; gap: 9px; flex-wrap: wrap; align-items: center; margin-bottom: 14px;
}
.search-box { position: relative; flex: 0 1 380px; min-width: 190px; }
.search-box svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.search-box input { padding-left: 36px; }
.filters select { width: auto; min-width: 106px; padding: 9px 30px 9px 11px; font-size: 13px; }

.proj-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 13px; }
.proj {
  background: #fff; border: 1px solid var(--border-2); border-radius: var(--radius);
  padding: 15px 16px; box-shadow: var(--shadow-1); cursor: pointer;
  transition: transform .16s, box-shadow .18s, border-color .18s; position: relative;
}
.proj:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: #D8E2ED; }
.proj:active { transform: translateY(0); }
.proj .p-top { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 9px; }
.proj .p-name {
  font-size: 15px; font-weight: 700; line-height: 1.42; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.proj .p-cust { font-size: 12.5px; color: var(--text-2); margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.proj .p-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 11px; }
.proj .p-foot {
  display: flex; align-items: center; gap: 8px; padding-top: 10px;
  border-top: 1px dashed var(--border); font-size: 12px; color: var(--text-3);
}
.proj .p-foot .money { font-weight: 700; color: var(--text); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.proj .p-foot .owner { margin-left: auto; display: flex; align-items: center; gap: 5px; }
.mini-avatar {
  width: 21px; height: 21px; border-radius: 50%; background: var(--brand-3); color: var(--brand);
  display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700;
}
.proj .health-ring {
  position: absolute; right: 14px; top: 14px; width: 40px; height: 40px;
}

/* ============================ 徽章 ============================ */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2.5px 8px;
  border-radius: 6px; font-size: 11.5px; font-weight: 600; line-height: 1.5;
}
.badge-type { background: var(--brand-3); color: var(--brand-2); }
.badge-area { background: #F1F4F8; color: var(--text-2); }
.badge-lvl { color: #fff; font-weight: 700; min-width: 22px; justify-content: center; }
.lvl-S { background: var(--lvl-s); }
.lvl-A { background: var(--lvl-a); }
.lvl-B { background: var(--lvl-b); }
.lvl-C { background: var(--lvl-c); }
.lvl-D { background: var(--lvl-d); }
.badge-st-跟进中 { background: #E8F1FD; color: var(--info); }
.badge-st-中标 { background: #E4F6EC; color: var(--ok); }
.badge-st-未中标 { background: #F1F4F8; color: var(--text-2); }
.badge-st-停止跟进 { background: #FDECEA; color: var(--danger); }
.badge-stage { background: var(--accent-soft); color: #9A7524; }
.badge-stage-fs { background: #EDF2FF; color: #3B5BDB; border: 1px solid #D6E0FF; }
.badge-senti-积极 { background: #E4F6EC; color: var(--ok); }
.badge-senti-偏积极 { background: #EDF8F1; color: #2E9E6B; }
.badge-senti-中性 { background: #F1F4F8; color: var(--text-2); }
.badge-senti-偏风险 { background: #FDF2E5; color: var(--warn); }
.badge-senti-风险 { background: #FDECEA; color: var(--danger); }

/* ============================ 详情页 ============================ */
.detail-hero {
  background: linear-gradient(135deg, #1B3A5C 0%, #26496F 100%);
  border-radius: var(--radius); padding: 20px; color: #fff; margin-bottom: 14px;
  position: relative; overflow: hidden;
}
.detail-hero::after {
  content: ''; position: absolute; right: -50px; top: -50px; width: 190px; height: 190px;
  border-radius: 50%; background: rgba(200, 155, 60, .14);
}
.detail-hero .d-code { font-size: 12px; color: rgba(255, 255, 255, .6); letter-spacing: .8px; margin-bottom: 7px; }
.detail-hero h2 { font-size: 19px; font-weight: 700; line-height: 1.45; margin-bottom: 7px; position: relative; }
.detail-hero .d-cust { font-size: 13.5px; color: rgba(255, 255, 255, .82); position: relative; }
.detail-hero .d-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 13px; position: relative; }
.detail-hero .d-tags .badge { background: rgba(255, 255, 255, .17); color: #fff; }

.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--border-2); }
.info-item { background: #fff; padding: 13px 15px; }
.info-item .i-label { font-size: 11.5px; color: var(--text-3); margin-bottom: 3px; }
.info-item .i-value { font-size: 14.5px; font-weight: 600; word-break: break-all; }
.info-item .i-value.big { font-size: 19px; font-weight: 800; letter-spacing: -.3px; font-variant-numeric: tabular-nums; }

/* ============================ 跟进时间线 ============================ */
.timeline { position: relative; padding-left: 26px; }
.timeline::before {
  content: ''; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px;
  background: linear-gradient(180deg, var(--brand-2) 0%, var(--border) 100%);
  border-radius: 2px;
}
.tl-item { position: relative; padding-bottom: 20px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute; left: -26px; top: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; border: 2.5px solid var(--brand-2); display: flex; align-items: center;
  justify-content: center; z-index: 1;
}
.tl-dot::after { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--brand-2); }
.tl-item.is-won .tl-dot { border-color: var(--ok); }
.tl-item.is-won .tl-dot::after { background: var(--ok); }
.tl-item.is-lost .tl-dot { border-color: var(--text-3); }
.tl-item.is-lost .tl-dot::after { background: var(--text-3); }
.tl-item.is-stop .tl-dot { border-color: var(--danger); }
.tl-item.is-stop .tl-dot::after { background: var(--danger); }

.tl-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 7px; }
.tl-date { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tl-content {
  background: #F8FAFC; border: 1px solid var(--border-2); border-radius: var(--radius-sm);
  padding: 11px 13px; font-size: 13.5px; line-height: 1.72; white-space: pre-wrap;
  word-break: break-word; color: #2A3B4C;
}

/* 分析面板 */
.analysis {
  margin-top: 9px; border: 1px solid #E3EBF4; border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #F7FAFD 0%, #FBFCFE 100%); padding: 12px 13px;
}
.analysis .a-head {
  display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700;
  color: var(--brand-2); margin-bottom: 9px; letter-spacing: .3px;
}
.analysis .a-head .src {
  margin-left: auto; font-weight: 500; font-size: 11px; color: var(--text-3);
  background: #fff; border: 1px solid var(--border); padding: 1px 7px; border-radius: 20px;
}
.a-summary {
  font-size: 13px; line-height: 1.72; color: #24405C; background: #fff;
  border-left: 3px solid var(--accent); padding: 9px 12px; border-radius: 0 8px 8px 0; margin-bottom: 10px;
}
.a-block { margin-bottom: 9px; }
.a-block:last-child { margin-bottom: 0; }
.a-label {
  font-size: 11.5px; font-weight: 700; color: var(--text-2); margin-bottom: 5px;
  display: flex; align-items: center; gap: 5px; letter-spacing: .3px;
}
.a-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.a-tag {
  font-size: 11.5px; padding: 2.5px 8px; border-radius: 6px;
  background: #fff; border: 1px solid var(--border); color: var(--text-2);
}
.a-tag.risk { background: #FDECEA; border-color: #F7CDC7; color: var(--danger); font-weight: 600; }
.a-tag.good { background: #E4F6EC; border-color: #C6E9D6; color: var(--ok); font-weight: 600; }
.a-tag.comp { background: #FDF2E5; border-color: #F6DFC0; color: #A96A18; font-weight: 600; }
.a-list { margin: 0; padding: 0; list-style: none; }
.a-list li {
  font-size: 12.5px; line-height: 1.66; color: #35485A; padding-left: 15px; position: relative; margin-bottom: 4px;
}
.a-list li::before {
  content: ''; position: absolute; left: 2px; top: 8.5px; width: 5px; height: 5px;
  border-radius: 50%; background: var(--brand-2);
}
.a-list li.risk::before { background: var(--danger); }
.score-wrap { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.score-num { font-size: 26px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -1px; }
.score-bar { flex: 1; height: 6px; background: #E7EDF4; border-radius: 5px; overflow: hidden; }
.score-bar i { display: block; height: 100%; border-radius: 5px; }

/* 附件 */
.attach-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; }
.attach {
  display: flex; align-items: center; gap: 7px; background: #fff;
  border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px;
  font-size: 12px; color: var(--text-2); max-width: 100%;
}
.attach:hover { border-color: var(--brand-2); color: var(--brand-2); }
.attach .a-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 178px; }
.attach .a-size { color: var(--text-3); font-size: 11px; }
.attach.thumb { padding: 0; border: none; background: none; }
.attach.thumb img { width: 76px; height: 76px; object-fit: cover; border-radius: 9px; border: 1px solid var(--border); }

.upload-zone {
  border: 1.5px dashed var(--border); border-radius: var(--radius-sm); padding: 16px;
  text-align: center; color: var(--text-3); font-size: 12.5px; cursor: pointer;
  transition: border-color .16s, background .16s;
}
.upload-zone:hover, .upload-zone.drag { border-color: var(--brand-2); background: #F7FAFD; color: var(--brand-2); }
.file-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.file-chip {
  display: flex; align-items: center; gap: 6px; background: var(--brand-3);
  border-radius: 8px; padding: 5px 8px; font-size: 12px; color: var(--brand-2); max-width: 100%;
}
.file-chip .x {
  width: 16px; height: 16px; border-radius: 50%; background: rgba(27, 58, 92, .14);
  display: inline-flex; align-items: center; justify-content: center; font-size: 11px; line-height: 1; flex: 0 0 auto;
}
.file-chip .x:hover { background: var(--danger); color: #fff; }

/* ============================ 人员/表格 ============================ */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 560px; }
table.tbl th {
  text-align: left; padding: 10px 13px; background: #F8FAFC; color: var(--text-2);
  font-weight: 600; font-size: 12.5px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.tbl td { padding: 11px 13px; border-bottom: 1px solid var(--border-2); vertical-align: middle; }
table.tbl tr:last-child td { border-bottom: none; }
table.tbl tr:hover td { background: #FAFCFE; }
.tbl-empty { text-align: center; padding: 40px 20px; color: var(--text-3); font-size: 13.5px; }

/* ============================ 空状态 / 加载 ============================ */
.empty {
  text-align: center; padding: 54px 20px; color: var(--text-3);
}
.empty svg { opacity: .34; margin-bottom: 12px; }
.empty h4 { font-size: 14.5px; color: var(--text-2); font-weight: 600; margin-bottom: 5px; }
.empty p { font-size: 12.5px; }
.spinner {
  width: 22px; height: 22px; border: 2.5px solid var(--border);
  border-top-color: var(--brand-2); border-radius: 50%;
  animation: spin .7s linear infinite;
}
.spinner.center { margin: 46px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-wrap { text-align: center; padding: 46px 0; }

/* ============================ 弹层 ============================ */
.modal-root { position: fixed; inset: 0; z-index: 200; display: flex; align-items: flex-end; justify-content: center; }
.modal-mask { position: absolute; inset: 0; background: rgba(16, 28, 42, .5); backdrop-filter: blur(2px); animation: fadeIn .18s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-box {
  position: relative; background: #fff; width: 100%; max-width: 620px;
  border-radius: 18px 18px 0 0; max-height: 92vh; overflow-y: auto;
  animation: slideUp .26s cubic-bezier(.2, .8, .25, 1); padding-bottom: var(--safe-b);
}
@keyframes slideUp { from { transform: translateY(30px); opacity: .6; } to { transform: none; opacity: 1; } }
.modal-head {
  display: flex; align-items: center; gap: 10px; padding: 17px 18px 13px;
  border-bottom: 1px solid var(--border-2); position: sticky; top: 0; background: #fff; z-index: 2;
}
.modal-head h3 { font-size: 16px; font-weight: 700; flex: 1; }
.modal-close { width: 32px; height: 32px; border-radius: 9px; display: flex; align-items: center; justify-content: center; color: var(--text-3); }
.modal-close:hover { background: var(--border-2); color: var(--text); }
.modal-body { padding: 17px 18px; }
.modal-foot {
  padding: 13px 18px calc(17px + var(--safe-b)); display: flex; gap: 10px;
  border-top: 1px solid var(--border-2); position: sticky; bottom: 0; background: #fff;
}
.modal-foot .btn { flex: 1; }

/* ============================ Toast ============================ */
.toast-root {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  z-index: 400; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none; width: calc(100% - 32px); max-width: 420px;
}
.toast {
  background: rgba(22, 35, 47, .94); color: #fff; padding: 10px 17px; border-radius: 10px;
  font-size: 13.5px; box-shadow: var(--shadow-2); animation: toastIn .24s cubic-bezier(.2, .8, .25, 1);
  max-width: 100%; word-break: break-word; text-align: center; backdrop-filter: blur(6px);
}
.toast.ok { background: rgba(30, 158, 90, .96); }
.toast.err { background: rgba(217, 72, 59, .96); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }

/* ====================== 供应商 + 成本分析 专属样式 ====================== */
.kpi-mini {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 80px;
  padding: 10px 14px;
  background: var(--bg-2);
  border-radius: 10px;
  border: 1px solid var(--border-2);
}
.kpi-mini-num { font-size: 17px; font-weight: 700; color: var(--text); line-height: 1.2; }
.kpi-mini-lbl { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }

.badge-st-won { background: #1E9E5A; color: #fff; }
.badge-st-lost { background: #D9483B; color: #fff; }
.badge-st-follow { background: #C89B3C; color: #fff; }
.badge-st-stopped { background: #8C97A4; color: #fff; }

/* ============================ 资源客户多选 ============================ */
.cust-pick {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  max-height: 168px;
  overflow-y: auto;
  padding: 6px;
}
.cust-pick-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 9px; border-radius: 8px; cursor: pointer;
  transition: background .14s;
  flex-wrap: wrap;
}
.cust-pick-item:hover { background: var(--brand-3); }
.cust-pick-item input[type="checkbox"] {
  width: 16px; height: 16px; accent-color: var(--brand); flex: 0 0 auto; cursor: pointer;
}
.cust-pick-item .cp-name { font-size: 13.5px; font-weight: 600; }
.cust-pick-item .cp-sub {
  font-size: 12px; color: var(--text-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px;
}

/* ============================ 响应式 ============================ */
/* 平板：601–900px：两列卡片、侧边栏保留 */
@media (min-width: 601px) and (max-width: 900px) {
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .proj-list { grid-template-columns: repeat(2, 1fr); gap: 13px; }
  .detail-meta { grid-template-columns: repeat(2, 1fr); }
}

/* 桌面：≥901px：完整多列布局 */
@media (min-width: 901px) {
  .detail-meta { grid-template-columns: repeat(3, 1fr); }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
}

/* 手机：≤900px：单列、底部 tabbar、抽屉式侧边栏 */
@media (max-width: 900px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 100; width: 258px;
    flex-basis: 258px; transform: translateX(-100%); transition: transform .26s cubic-bezier(.2, .8, .25, 1);
    height: 100dvh;
  }
  .sidebar.open { transform: none; box-shadow: 4px 0 30px rgba(16, 28, 42, .28); }
  .menu-btn { display: inline-flex; }
  .page-content { padding: 14px 13px calc(74px + var(--safe-b)); }
  .topbar { padding: 0 10px 0 6px; }
  .topbar h2 { font-size: 15.5px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .proj-list { grid-template-columns: 1fr; gap: 11px; }
  .modal-box { border-radius: 18px 18px 0 0; }

  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
    background: rgba(255, 255, 255, .97); border-top: 1px solid var(--border);
    padding: 6px 4px calc(6px + var(--safe-b)); backdrop-filter: blur(12px);
  }
  .tabbar .tab {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 5px 2px; color: var(--text-3); font-size: 10.5px; font-weight: 500;
    transition: color .16s;
  }
  .tabbar .tab.active { color: var(--brand); }
  .tabbar .tab.active svg { color: var(--accent); }
  .tabbar .tab svg { width: 21px; height: 21px; }
}

/* 移动端触感增强 + 输入框字号≥16px 防止 iOS 自动放大 */
@media (hover: none) and (pointer: coarse) {
  .btn:active { transform: scale(0.97); opacity: .85; }
  .proj-card:active { transform: scale(.99); }
  input, select, textarea { font-size: 16px !important; }
}

/* v162 窄屏下三维筛选改为纵向堆叠（避免三列挤压） */
@media (max-width: 720px) {
  .form-row-3 { grid-template-columns: 1fr; gap: 0; }
}

@media (max-width: 420px) {
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .form-row-3 { grid-template-columns: 1fr; gap: 0; }
  .stat .s-value { font-size: 21px; }
  .detail-hero h2 { font-size: 17px; }
}

@media (min-width: 901px) {
  .modal-root { align-items: center; }
  .modal-box { border-radius: 18px; max-height: 86vh; }
  .modal-foot { padding-bottom: 17px; }
  .modal-body { padding: 20px 22px; }
  .modal-head { padding: 19px 22px 15px; }
}

/* 打印 */
@media print {
  .sidebar, .topbar, .tabbar, .filters, .btn, .imp-bar { display: none !important; }
  .page-content { padding: 0; }
}

/* v69 系统设置 · 左侧栏模块开关 */
.mod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)); gap: 10px 18px; }
.mod-item { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; user-select: none; padding: 7px 10px; border: 1px solid var(--border); border-radius: 9px; }
.mod-item:hover { border-color: var(--accent); }
.mod-item input { width: 16px; height: 16px; accent-color: var(--accent); flex: 0 0 auto; cursor: pointer; }
.mod-item input:disabled { cursor: not-allowed; }
.mod-tip { font-style: normal; color: var(--text-2); font-size: 12px; }
.nav-badge.off { background: rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .6); font-style: normal; }

/* v77 项目管理视图切换 tabs */
.view-tabs{display:inline-flex;background:var(--surface-2,#EEF1F5);border-radius:10px;padding:3px;gap:2px;margin-bottom:16px}
.view-tabs .vt{border:none;background:transparent;padding:7px 18px;border-radius:8px;font-size:13.5px;font-weight:600;color:var(--text-3);cursor:pointer;transition:all .15s}
.view-tabs .vt.on{background:#fff;color:var(--brand,#1B3A5C);box-shadow:0 1px 4px rgba(16,32,52,.14)}
.view-tabs .vt:not(.on):hover{color:var(--text)}

/* ============================================================
   v105 身份切换（超级用户免密切换为成员身份浏览系统）
   ============================================================ */
.imp-bar {
  position: sticky; top: 58px; z-index: 29;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 16px; font-size: 13px; line-height: 1.5;
  color: #8A5A12; background: linear-gradient(90deg, #FDF3E3, #FBF8F1);
  border-bottom: 1px solid #EFDCBA;
}
.imp-dot {
  flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%;
  background: var(--warn); box-shadow: 0 0 0 3px rgba(224, 139, 46, .18);
}
.imp-text { min-width: 0; }
.imp-text b { color: #7A4E0C; }
.imp-bar .imp-exit {
  margin-left: auto; flex: 0 0 auto;
  background: #fff; border: 1px solid #EBD5AE; color: #8A5A12;
}
.imp-bar .imp-exit:hover { background: #FDF3E3; border-color: var(--accent); }

/* 系统设置页 · 身份切换成员选择网格 */
.imp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: 10px; }
.imp-item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 10px 12px; text-align: left; font: inherit; color: var(--text);
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; transition: border-color .15s, box-shadow .15s, background .15s;
}
.imp-item:hover:not(:disabled) { border-color: var(--accent); box-shadow: 0 2px 10px rgba(200, 155, 60, .18); }
.imp-item:disabled { cursor: default; background: #FAFBFC; }
.imp-name { font-weight: 700; font-size: 14px; }
.imp-role { font-size: 12px; color: var(--text-2); }
.imp-tag {
  margin-top: 5px; font-size: 11px; padding: 1px 8px; border-radius: 999px;
  background: var(--border-2); color: var(--text-3);
}
.imp-tag.go { background: var(--accent-soft); color: #8A6A18; }

@media (max-width: 900px) {
  .imp-bar { font-size: 12.5px; padding: 8px 12px; }
  .imp-bar .imp-exit { margin-left: 0; width: 100%; }
}
