* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f5f6fa; color: #1f2329; font-size: 14px;
}
.hidden { display: none !important; }

/* ===== 登录 ===== */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #1485ee 0%, #0d6fca 100%); padding: 24px;
}
.login-box {
  background: #fff; border-radius: 16px; padding: 36px 28px; width: 100%; max-width: 360px;
  box-shadow: 0 12px 40px rgba(0,0,0,.18); text-align: center;
}
.login-logo {
  width: 100%; max-width: 260px; height: auto;
  margin: 0 auto 10px; display: block;
}
.login-box h2 { margin: 10px 0 4px; }
.login-sub { color: #8a919f; font-size: 12px; margin-bottom: 22px; }
.login-divider { color: #b0b7c3; font-size: 12px; margin: 16px 0; position: relative; }
.login-divider::before, .login-divider::after {
  content: ''; position: absolute; top: 50%; width: 30%; height: 1px; background: #e5e8ef;
}
.login-divider::before { left: 0; } .login-divider::after { right: 0; }

/* ===== 布局 ===== */
.topbar {
  position: sticky; top: 0; z-index: 20; height: 48px; background: #1485ee; color: #fff;
  display: flex; align-items: center; padding: 0 14px; gap: 10px;
}
.topbar-title { flex: 1; font-size: 16px; font-weight: 600; text-align: center; }
.back-btn { background: none; border: none; color: #fff; font-size: 15px; padding: 6px 4px 6px 0; }
.topbar-user { font-size: 12px; opacity: .9; }
.topbar-logo {
  width: 30px; height: 30px; border-radius: 50%; object-fit: cover;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.12);
}

main { padding: 12px 12px 72px; max-width: 760px; margin: 0 auto; }

/* 品牌横幅 */
.brand-banner {
  background: #fff; border-radius: 12px; padding: 14px; margin-bottom: 12px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 1px 4px rgba(31,35,41,.06);
}
.brand-logo {
  width: 44px; height: 44px; border-radius: 50%; object-fit: cover;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.brand-title { font-weight: 600; font-size: 15px; color: #1f2329; }
.brand-sub { font-size: 12px; color: #8a919f; margin-top: 2px; }

.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; display: flex;
  background: #fff; border-top: 1px solid #e8eaf0; padding-bottom: env(safe-area-inset-bottom);
}
.tab-item {
  flex: 1; text-align: center; padding: 6px 0 4px; color: #8a919f; font-size: 11px;
  text-decoration: none; display: flex; flex-direction: column; gap: 2px;
}
.tab-item.active { color: #1485ee; }
.tab-icon { font-size: 20px; line-height: 1; }

/* ===== 通用组件 ===== */
.card { background: #fff; border-radius: 12px; padding: 14px; margin-bottom: 12px; box-shadow: 0 1px 4px rgba(31,35,41,.06); }
.card-title { font-weight: 600; margin-bottom: 10px; font-size: 15px; }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-card { background: #fff; border-radius: 12px; padding: 14px; box-shadow: 0 1px 4px rgba(31,35,41,.06); }
.stat-label { font-size: 12px; color: #8a919f; }
.stat-value { font-size: 20px; font-weight: 700; margin-top: 4px; color: #1f2329; }
.stat-value.money { color: #e64545; }
.stat-value.money-in { color: #e64545; } .stat-value.money-out { color: #14a05a; }
.stat-value.blue { color: #1485ee; }

.btn { border: none; border-radius: 8px; padding: 10px 16px; font-size: 14px; cursor: pointer; }
.btn-primary { background: #1485ee; color: #fff; }
.btn-outline { background: #fff; color: #1485ee; border: 1px solid #1485ee; }
.btn-danger { background: #fff; color: #e64545; border: 1px solid #e64545; }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn-block { width: 100%; margin-top: 8px; }
.input, select.input, textarea.input {
  width: 100%; border: 1px solid #dcdfe6; border-radius: 8px; padding: 10px 12px;
  font-size: 14px; margin-top: 10px; background: #fff; font-family: inherit;
}
textarea.input { min-height: 60px; resize: vertical; }
.form-row { display: flex; gap: 10px; } .form-row .input { flex: 1; }

.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; }
.tag-sales { background: #e8f3ff; color: #1485ee; }
.tag-purchase { background: #fff3e0; color: #e6820e; }
.tag-other { background: #f0f1f5; color: #646a73; }
.tag-draft { background: #f0f1f5; color: #646a73; }
.tag-executing { background: #e8f8f0; color: #14a05a; }
.tag-completed { background: #eef0f4; color: #8a919f; }
.tag-terminated { background: #fdeaea; color: #e64545; }
.tag-paid { background: #e8f8f0; color: #14a05a; }
.tag-partial { background: #fff8e0; color: #c9930a; }
.tag-unpaid { background: #f0f1f5; color: #646a73; }
.tag-overdue { background: #fdeaea; color: #e64545; }
.tag-merged { background: #f3e8ff; color: #8b3dfa; }

/* 信息脱敏提示条（CRM 客户/线索详情） */
.crm-mask-tip {
  background: #fff8e0; border: 1px solid #ffe08a; color: #8a6d0a; font-size: 12px;
  border-radius: 8px; padding: 8px 12px; margin-bottom: 12px;
}

.list-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid #f0f1f5; }
.list-item:last-child { border-bottom: none; }
.li-main { flex: 1; min-width: 0; }
.li-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-sub { font-size: 12px; color: #8a919f; margin-top: 3px; }
.li-right { text-align: right; white-space: nowrap; }
.money { color: #e64545; font-weight: 600; }
.money-out { color: #14a05a; font-weight: 600; }
.muted { color: #8a919f; font-size: 12px; }

.filter-bar { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 10px; }
.chip {
  border: 1px solid #dcdfe6; background: #fff; color: #646a73; border-radius: 16px;
  padding: 5px 14px; font-size: 13px; white-space: nowrap; cursor: pointer;
}
.chip.active { background: #1485ee; color: #fff; border-color: #1485ee; }

.search-bar { display: flex; gap: 8px; margin-bottom: 10px; }
.search-bar input { flex: 1; }
.add-btn { position: fixed; right: 18px; bottom: 78px; width: 52px; height: 52px; border-radius: 50%;
  background: #1485ee; color: #fff; font-size: 28px; border: none; box-shadow: 0 6px 16px rgba(20,133,238,.4); z-index: 15; }

.subtab-bar { display: flex; gap: 8px; margin-bottom: 10px; }
.subtab {
  flex: 1; border: 1px solid #dcdfe6; background: #fff; color: #646a73; border-radius: 8px;
  padding: 8px 0; font-size: 13px; cursor: pointer;
}
.subtab.active { background: #1485ee; color: #fff; border-color: #1485ee; }
.card.archived { opacity: .92; background: #fafbfc; }

.empty { text-align: center; color: #b0b7c3; padding: 40px 0; }

/* ===== 弹窗 ===== */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
}
.modal {
  background: #fff; width: 100%; max-width: 640px; max-height: 86vh; overflow-y: auto;
  border-radius: 16px 16px 0 0; padding: 16px 16px 28px;
}
@media (min-width: 700px) {
  .modal-mask { align-items: center; }
  .modal { border-radius: 16px; }
}
.modal-head { display: flex; justify-content: space-between; align-items: center; font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.modal-close { background: none; border: none; font-size: 16px; color: #8a919f; cursor: pointer; }
/* 弹窗打开时锁定背景滚动，避免输入时页面跳动（用户感知的「闪」） */
body.modal-open { overflow: hidden; }
/* 表单底部操作区：保存 + 取消，明确「保存后退出」 */
.modal-actions { display: flex; gap: 8px; margin-top: 14px; }
.modal-actions .btn { flex: 1; }
.modal-actions .btn-cancel { flex: 0 0 32%; }

.toast {
  position: fixed; top: 60px; left: 50%; transform: translateX(-50%); z-index: 99;
  background: rgba(31,35,41,.88); color: #fff; padding: 9px 18px; border-radius: 8px; font-size: 13px;
  max-width: 80vw; text-align: center;
}

.progress { height: 6px; background: #eef0f4; border-radius: 3px; overflow: hidden; margin-top: 6px; }
.progress-bar { height: 100%; background: #1485ee; border-radius: 3px; }

.section-gap { height: 6px; }
.field-label { font-size: 12px; color: #8a919f; margin-top: 12px; }

/* ===== PC 端布局（宽屏 ≥900px）===== */
/* 注意：.pc-shell 默认 display:block（移动端必须保留渲染，否则包裹的 <main> 会随父容器一起消失导致页面空白）。
   PC 端在下方 @media 里覆盖为 display:flex，让 sidebar + main 并排。*/
.pc-sidebar { display: none; }
.topbar-logout { display: none; }

@media (min-width: 900px) {
  .topbar { position: static; height: 54px; padding: 0 24px; }
  .topbar-title { text-align: left; font-size: 17px; }
  .topbar-logo { width: 34px; height: 34px; }
  .topbar-user { font-size: 13px; margin-left: auto; }
  .topbar-logout {
    display: inline-block; margin-left: 14px; background: rgba(255,255,255,.16);
    color: #fff; border: 1px solid rgba(255,255,255,.45); border-radius: 6px;
    padding: 4px 12px; font-size: 12px; cursor: pointer;
  }
  .topbar-logout:hover { background: rgba(255,255,255,.28); }

  .tabbar { display: none; }
  .pc-shell { display: flex; min-height: calc(100vh - 54px); }
  .pc-sidebar {
    display: flex; flex-direction: column; gap: 2px; width: 204px; flex-shrink: 0;
    background: #fff; border-right: 1px solid #e8eaf0; padding: 16px 12px;
    position: sticky; top: 0; align-self: flex-start; height: calc(100vh - 54px);
    overflow-y: auto;
  }
  .pc-nav-item {
    display: flex; align-items: center; gap: 10px; padding: 11px 14px;
    border-radius: 8px; color: #4b535e; text-decoration: none; font-size: 14px;
    cursor: pointer; user-select: none;
  }
  .pc-nav-item span { font-size: 17px; }
  .pc-nav-item:hover { background: #f0f5fc; }
  .pc-nav-item.active { background: #e8f3ff; color: #1485ee; font-weight: 600; }

  /* PC 侧边栏二级菜单 */
  .pc-nav-group { display: flex; flex-direction: column; }
  .pc-nav-parent { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 8px; color: #4b535e; text-decoration: none; font-size: 14px; cursor: pointer; user-select: none; }
  .pc-nav-parent span { font-size: 17px; }
  .pc-nav-parent::after { content: '›'; margin-left: auto; font-size: 16px; color: #8a919f; transition: transform .2s; }
  .pc-nav-parent:hover { background: #f0f5fc; }
  .pc-nav-parent.active { background: #e8f3ff; color: #1485ee; font-weight: 600; }
  .pc-nav-group.expanded .pc-nav-parent::after { transform: rotate(90deg); }

  .pc-nav-children { display: none; flex-direction: column; padding-left: 18px; margin-left: 15px; border-left: 1px dashed #dbe0e8; }
  .pc-nav-group.expanded .pc-nav-children { display: flex; }
  .pc-nav-child { padding: 8px 12px; border-radius: 6px; color: #646a73; font-size: 13px; text-decoration: none; cursor: pointer; margin: 1px 0; }
  .pc-nav-child:hover { background: #f5f7fa; }
  .pc-nav-child.active { color: #1485ee; background: #e8f3ff; font-weight: 600; }

  /* PC 侧边栏三级菜单（合同管理 → 销售/采购管理 → 功能项） */
  .pc-nav-subgroup { display: flex; flex-direction: column; }
  .pc-nav-subparent {
    display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 6px;
    color: #4b535e; text-decoration: none; font-size: 13px; font-weight: 600;
    cursor: pointer; user-select: none;
  }
  .pc-nav-subparent span { font-size: 15px; }
  .pc-nav-subparent::after { content: '›'; margin-left: auto; font-size: 14px; color: #8a919f; transition: transform .2s; }
  .pc-nav-subparent:hover { background: #f0f5fc; }
  .pc-nav-subparent.active { color: #1485ee; }
  .pc-nav-subgroup.expanded .pc-nav-subparent::after { transform: rotate(90deg); }
  .pc-nav-subchildren {
    display: none; flex-direction: column; padding-left: 10px; margin-left: 10px;
    border-left: 1px dashed #dbe0e8; margin-bottom: 4px;
  }
  .pc-nav-subgroup.expanded .pc-nav-subchildren { display: flex; }
  .pc-nav-subchildren .pc-nav-child { padding: 7px 10px; font-size: 12.5px; margin: 0; }

  /* PC 报表/台账 */
  .page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
  .page-title { font-size: 17px; font-weight: 600; color: #23272e; }
  .stat-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 12px; }
  .report-table { width: 100%; border-collapse: collapse; font-size: 13px; background: #fff; border-radius: 10px; overflow: hidden; }
  .report-table th, .report-table td { padding: 9px 12px; border-bottom: 1px solid #eef0f4; text-align: right; white-space: nowrap; }
  .report-table th { background: #f7f9fc; color: #646a73; font-weight: 600; }
  .report-table th:first-child, .report-table td:first-child { text-align: left; }
  .report-table tr:last-child td { border-bottom: none; }
  .report-table .num { font-variant-numeric: tabular-nums; }

main { max-width: none; padding: 22px 30px 48px; margin: 0; flex: 1; }
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .add-btn { position: fixed; right: 30px; bottom: 30px; }
  .brand-banner { padding: 18px 20px; }
  .brand-logo { width: 52px; height: 52px; }
  .brand-title { font-size: 17px; }
  .login-page { display: none; } /* PC 端未登录统一跳转独立登录页 login.html */
  /* PC 端模块二级菜单已收进左侧边栏，隐藏原顶部 Tab/分类条 */
  .subtab-bar, .filter-tabs { display: none !important; }
}

/* ===== 会议报名模块（独立会议管理 / 名单） ===== */
.mt-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.mt-stat-grid.cols5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 700px) {
  .mt-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .mt-stat-grid.cols5 { grid-template-columns: repeat(2, 1fr); }
}
.mt-stat { background: #fff; border-radius: 12px; padding: 13px 15px; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.mt-stat .l { font-size: 12px; color: #8a919f; margin-bottom: 5px; }
.mt-stat .v { font-size: 19px; font-weight: 700; color: #23272e; }
.mt-stat .v.blue { color: #1485ee; }
.mt-table-wrap { overflow-x: auto; margin-top: 8px; border: 1px solid #eef0f4; border-radius: 10px; }
.mt-table { width: 100%; border-collapse: collapse; font-size: 12.5px; background: #fff; min-width: 640px; }
.mt-table th, .mt-table td { padding: 8px 10px; border-bottom: 1px solid #eef0f4; text-align: left; white-space: nowrap; }
.mt-table th { background: #f7f9fc; color: #646a73; font-weight: 600; position: sticky; top: 0; }
.mt-table tr:last-child td { border-bottom: none; }
.mt-table tr:hover td { background: #fafcff; }
.mt-meeting-card { cursor: pointer; }
.mt-btn-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.mt-field-label { font-size: 12px; color: #8a919f; margin: 12px 0 5px; font-weight: 500; }
.mt-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 520px) { .mt-form-row { grid-template-columns: 1fr; } }
.mt-check { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 12px 0 4px; color: #4a5260; }

/* ===== 项目管理模块 ===== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 10px; }
.stats-grid .stat-card { background: #fff; border: 1px solid #eef0f4; border-radius: 10px; padding: 10px 12px; }
.sec-title { font-size: 13px; font-weight: 600; color: #1f2329; margin: 12px 0 6px; }
.link-btn { font-size: 12px; color: #1485ee; cursor: pointer; text-decoration: underline; }
.badge { display: inline-block; font-size: 11px; color: #1485ee; background: #eaf4ff; border-radius: 4px; padding: 1px 6px; margin-left: 4px; }
.detail-head { background: #fff; border: 1px solid #eef0f4; border-radius: 10px; padding: 12px; margin-bottom: 10px; }
@media (max-width: 520px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }

/* ===== 项目执行报表 ===== */
.rpt-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; background: #fff; border: 1px solid #eef0f4; border-radius: 10px; }
.rpt-table { width: 100%; border-collapse: collapse; font-size: 12px; white-space: nowrap; }
.rpt-table th, .rpt-table td { padding: 8px 10px; border-bottom: 1px solid #f2f4f7; text-align: left; color: #1f2329; }
.rpt-table thead th { background: #f7f9fc; font-weight: 600; color: #5a6472; position: sticky; top: 0; }
.rpt-table td.num, .rpt-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.rpt-table tbody tr:hover { background: #f8fbff; }
.rpt-table tfoot .rpt-total td { font-weight: 600; background: #f7f9fc; border-top: 2px solid #e3e8ef; }
.rpt-name { font-weight: 600; color: #1485ee; cursor: pointer; }
.rpt-money { color: #1485ee; text-decoration: none; border-bottom: 1px dashed #9dc9f5; cursor: pointer; }
.rpt-money.in { color: #c62828; border-bottom-color: #f0b4b4; }
.rpt-money.out { color: #1f2329; }
.rpt-money:hover { opacity: .75; }
.rpt-link .muted { color: #8a94a6; font-size: 11px; margin-left: 2px; }
.rpt-costline { display: flex; flex-wrap: wrap; gap: 8px; }
.rpt-link { font-size: 12px; color: #1485ee; background: #f2f8ff; border: 1px solid #d9e9fb; border-radius: 6px; padding: 5px 9px; cursor: pointer; }
.rpt-link b { display: inline-block; margin-left: 4px; font-variant-numeric: tabular-nums; }
@media (max-width: 520px) { .rpt-table th, .rpt-table td { padding: 6px 8px; } }
