:root {
  --navy: #16324f;
  --navy-2: #1e4066;
  --blue: #2f7ed8;
  --blue-soft: #e8f1fb;
  --orange: #f59e0b;
  --green: #16a34a;
  --red: #dc2626;
  --amber: #d97706;
  --gray-50: #f5f7fa;
  --gray-100: #eef1f6;
  --gray-200: #e2e7ef;
  --gray-300: #cdd4e0;
  --gray-500: #7b8794;
  --gray-700: #3f4a5a;
  --gray-900: #16202e;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 30, 54, .06), 0 4px 16px rgba(16, 30, 54, .06);
  --shadow-lg: 0 16px 48px rgba(16, 30, 54, .18);
  --side-w: 216px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); background: var(--gray-50); color: var(--gray-900); font-size: 14px; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
a { color: var(--blue); text-decoration: none; }
.hidden { display: none !important; }

/* ---------- 登录 ---------- */
.login-wrap { position: fixed; inset: 0; display: grid; place-items: center; z-index: 10; }
.login-bg { position: absolute; inset: 0; background: linear-gradient(135deg, #10263c 0%, #1d4a77 48%, #16324f 100%); }
.login-bg::after { content: ""; position: absolute; inset: 0; opacity: .13;
  background-image: linear-gradient(rgba(255,255,255,.5) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.5) 1px, transparent 1px);
  background-size: 42px 42px; transform: skewY(-6deg); }
.login-card { position: relative; width: 380px; max-width: calc(100vw - 32px); background: #fff; border-radius: 16px; padding: 34px 34px 26px; box-shadow: 0 24px 80px rgba(0,0,0,.35); }
.login-brand { display: flex; gap: 14px; align-items: center; margin-bottom: 26px; }
.login-brand h1 { font-size: 21px; margin: 0 0 4px; letter-spacing: .5px; }
.login-brand p { margin: 0; font-size: 12px; color: var(--gray-500); }
.login-card form label { display: block; margin-bottom: 16px; font-size: 13px; color: var(--gray-700); font-weight: 500; }
.login-card input { width: 100%; margin-top: 7px; padding: 11px 13px; border: 1px solid var(--gray-200); border-radius: 8px; outline: none; transition: border .15s, box-shadow .15s; }
.login-card input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47,126,216,.13); }
.login-hint { text-align: center; color: var(--gray-500); font-size: 12px; margin: 16px 0 0; }
.login-error { color: var(--red); font-size: 13px; text-align: center; min-height: 18px; margin: 6px 0 0; }

/* ---------- 基础控件 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 7px; border: 1px solid transparent; background: #fff; color: var(--gray-700); cursor: pointer; font-size: 13px; font-weight: 500; white-space: nowrap; transition: all .15s; }
.btn:hover { border-color: var(--gray-300); background: var(--gray-50); }
.btn-primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn-primary:hover { background: #2a70c2; border-color: #2a70c2; color: #fff; }
.btn-danger { background: #fff; color: var(--red); border-color: #f1c5c5; }
.btn-danger:hover { background: #fef2f2; }
.btn-success { background: var(--green); color: #fff; border-color: var(--green); }
.btn-success:hover { background: #128a3f; color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 6px; }
.btn-block { width: 100%; height: 42px; font-size: 15px; }
.icon-btn { width: 34px; height: 34px; display: inline-grid; place-items: center; border: none; background: transparent; color: var(--gray-500); border-radius: 8px; cursor: pointer; }
.icon-btn:hover { background: var(--gray-100); color: var(--gray-900); }

input[type=text], input[type=password], input[type=date], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: 8px 11px; border: 1px solid var(--gray-200); border-radius: 7px; background: #fff; color: var(--gray-900); outline: none; transition: border .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47,126,216,.12); }
textarea { min-height: 74px; resize: vertical; line-height: 1.55; }

/* ---------- 布局 ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: var(--side-w); background: var(--navy); color: #cfdbe9; display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; z-index: 30; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; color: #fff; font-weight: 600; font-size: 15px; letter-spacing: .3px; }
.nav { flex: 1; overflow-y: auto; padding: 4px 10px 10px; }
.nav-group { margin: 12px 8px 4px; font-size: 11px; letter-spacing: 1px; color: #7287a0; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 8px; color: #cfdbe9; cursor: pointer; font-size: 13.5px; margin-bottom: 1px; transition: background .15s; }
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active { background: var(--blue); color: #fff; box-shadow: 0 4px 12px rgba(47,126,216,.35); }
.nav-item svg { flex: 0 0 18px; opacity: .9; }
.nav-item .nav-badge { margin-left: auto; background: var(--orange); color: #fff; font-size: 11px; border-radius: 9px; padding: 1px 6px; }
.side-foot { padding: 10px; border-top: 1px solid rgba(255,255,255,.08); }
.user-mini { display: flex; align-items: center; gap: 9px; padding: 6px; border-radius: 8px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #2f7ed8, #63a4e8); display: grid; place-items: center; color: #fff; font-size: 13px; font-weight: 600; flex: 0 0 34px; }
.user-mini-info { min-width: 0; flex: 1; }
.user-mini-info b { display: block; font-size: 13px; color: #fff; font-weight: 500; }
.user-mini-info small { color: #8fa4bd; font-size: 11px; }
.side-foot .icon-btn { color: #8fa4bd; }

.main { flex: 1; margin-left: var(--side-w); display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 58px; background: #fff; border-bottom: 1px solid var(--gray-200); display: flex; align-items: center; gap: 12px; padding: 0 22px; position: sticky; top: 0; z-index: 20; }
.crumb { font-size: 15px; font-weight: 600; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.search-box { display: flex; align-items: center; gap: 6px; background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: 8px; padding: 0 10px; height: 34px; color: var(--gray-500); }
.search-box input { border: none; background: transparent; padding: 0; width: 190px; box-shadow: none; }
.search-box input:focus { box-shadow: none; }
.badge-wrap { position: relative; }
.dot { position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; background: var(--red); border-radius: 50%; }
.user-btn { color: var(--gray-700); }
.content { padding: 20px 22px 40px; }

/* ---------- 卡片 / 网格 ---------- */
.card { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--gray-100); }
.card-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.card-head .sub { color: var(--gray-500); font-size: 12px; }
.card-body { padding: 16px 18px; }
.card-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 22px 0 12px; }
.section-title h2 { font-size: 16px; margin: 0; font-weight: 600; }
.grid { display: grid; gap: 14px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.stat { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.stat .label { font-size: 12.5px; color: var(--gray-500); display: flex; align-items: center; gap: 6px; }
.stat .value { font-size: 26px; font-weight: 700; letter-spacing: -.5px; margin-top: 8px; font-variant-numeric: tabular-nums; }
.stat .value small { font-size: 13px; font-weight: 500; color: var(--gray-500); margin-left: 4px; }
.stat .foot { font-size: 12px; color: var(--gray-500); margin-top: 6px; }
.stat .ic { position: absolute; right: 14px; top: 14px; width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); }
.stat.orange .ic { background: #fef3e2; color: var(--amber); }
.stat.green .ic { background: #e9f7ef; color: var(--green); }
.stat.red .ic { background: #fdeaea; color: var(--red); }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.table th { text-align: left; padding: 11px 14px; color: var(--gray-500); font-weight: 500; background: var(--gray-50); border-bottom: 1px solid var(--gray-200); white-space: nowrap; }
table.table td { padding: 11px 14px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
table.table tr:hover td { background: #fafbfd; }
table.table td.num, table.table th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.table .link { color: var(--blue); cursor: pointer; font-weight: 500; }
table.table .muted { color: var(--gray-500); }
.actions-cell { display: flex; gap: 4px; justify-content: flex-end; }
.table-empty { padding: 46px; text-align: center; color: var(--gray-500); }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--gray-100); }
.toolbar .search-input { width: 220px; }
.toolbar select { width: auto; min-width: 110px; padding: 7px 10px; }
.toolbar .spacer { flex: 1; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 16px; color: var(--gray-500); font-size: 12.5px; }
.pager .btn { height: 28px; }

/* ---------- 徽标 ---------- */
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 5px; font-size: 12px; background: var(--gray-100); color: var(--gray-700); white-space: nowrap; }
.tag.blue { background: var(--blue-soft); color: #1c62b0; }
.tag.green { background: #e8f7ee; color: #137d3f; }
.tag.orange { background: #fef3e2; color: #b45309; }
.tag.red { background: #fdeaea; color: #b91c1c; }
.tag.gray { background: var(--gray-100); color: var(--gray-500); }
.tag.purple { background: #f1ecfd; color: #6d3fd1; }

.progress { height: 6px; background: var(--gray-100); border-radius: 4px; overflow: hidden; min-width: 60px; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), #6cb2f0); border-radius: 4px; }
.progress.orange > i { background: linear-gradient(90deg, var(--orange), #fbbf24); }

/* ---------- 表单 ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; color: var(--gray-700); font-weight: 500; }
.field label .req { color: var(--red); margin-left: 2px; }
.field.full { grid-column: 1 / -1; }
.field .hint { font-size: 11.5px; color: var(--gray-500); }
.field .err { font-size: 11.5px; color: var(--red); }
.file-drop { border: 1.5px dashed #c3d0e0; border-radius: 10px; padding: 26px 18px; text-align: center; color: var(--gray-500); font-size: 13px; background: #fafcff; cursor: pointer; transition: border-color .15s, background .15s; }
.file-drop:hover { border-color: var(--blue); background: #f2f7ff; color: var(--blue); }
.help-body p { margin: 7px 0; font-size: 13.5px; line-height: 1.9; color: #334155; }
.help-body p b { color: #16324f; margin-right: 4px; }
.form-section { grid-column: 1 / -1; font-size: 13px; font-weight: 600; color: var(--gray-700); padding-top: 6px; border-top: 1px solid var(--gray-100); margin-top: 4px; }

/* ---------- 弹窗 / 抽屉 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(15,25,40,.45); backdrop-filter: blur(2px); z-index: 40; display: flex; align-items: center; justify-content: center; padding: 18px; animation: fade .15s; }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.modal { background: #fff; border-radius: 12px; box-shadow: var(--shadow-lg); width: 720px; max-width: 100%; max-height: calc(100vh - 60px); display: flex; flex-direction: column; animation: pop .18s; }
@keyframes pop { from { transform: translateY(10px) scale(.985); opacity: .6 } to { transform: none; opacity: 1 } }
.modal.sm { width: 440px; }
.modal.lg { width: 960px; }
.modal-head { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--gray-100); }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-head .icon-btn { margin-left: auto; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--gray-100); display: flex; justify-content: flex-end; gap: 10px; }

.drawer-mask { position: fixed; inset: 0; background: rgba(15,25,40,.4); z-index: 40; display: flex; justify-content: flex-end; animation: fade .15s; }
.drawer { background: #fff; width: 460px; max-width: 100%; height: 100%; display: flex; flex-direction: column; animation: slide .2s; }
@keyframes slide { from { transform: translateX(30px); opacity: .7 } to { transform: none; opacity: 1 } }
.drawer-head { display: flex; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--gray-100); }
.drawer-head h3 { margin: 0; font-size: 15px; }
.drawer-body { padding: 16px 18px; overflow-y: auto; flex: 1; }

/* ---------- 提示 ---------- */
.toast-root { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--navy); color: #fff; padding: 9px 16px; border-radius: 8px; font-size: 13px; box-shadow: var(--shadow-lg); animation: toastIn .2s; }
.toast.err { background: #b91c1c; }
.toast.ok { background: #137d3f; }
@keyframes toastIn { from { transform: translateY(-8px); opacity: 0 } to { transform: none; opacity: 1 } }

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: 50px 20px; color: var(--gray-500); }
.empty svg { opacity: .35; margin-bottom: 10px; }
.empty p { margin: 0 0 12px; font-size: 13px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--gray-200); padding: 0 18px; margin-bottom: 0; overflow-x: auto; }
.tab { padding: 12px 14px; font-size: 13px; color: var(--gray-500); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab.active { color: var(--blue); border-color: var(--blue); font-weight: 600; }

/* ---------- 详情 ---------- */
.detail-head { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.detail-head h2 { margin: 0 0 6px; font-size: 19px; }
.detail-meta { display: flex; gap: 16px; color: var(--gray-500); font-size: 12.5px; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: 92px 1fr; gap: 10px 12px; font-size: 13px; }
.kv dt { color: var(--gray-500); }
.kv dd { margin: 0; color: var(--gray-900); word-break: break-all; }
.list-row { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--gray-100); font-size: 13px; }
.list-row:last-child { border-bottom: none; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row small { color: var(--gray-500); display: block; margin-top: 2px; font-size: 11.5px; }

.timeline { position: relative; padding-left: 18px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 2px; background: var(--gray-200); }
.timeline-item { position: relative; padding-bottom: 16px; }
.timeline-item::before { content: ""; position: absolute; left: -17px; top: 3px; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); }
.timeline-item.fail::before { background: var(--red); }
.timeline-item.done::before { background: var(--green); }
.timeline-item b { font-size: 13px; font-weight: 600; }
.timeline-item p { margin: 4px 0 0; color: var(--gray-700); font-size: 12.5px; line-height: 1.6; }
.timeline-item small { color: var(--gray-500); font-size: 11.5px; }

/* ---------- 图表 ---------- */
.chart-wrap { width: 100%; overflow-x: auto; }
.chart-legend { display: flex; gap: 14px; font-size: 12px; color: var(--gray-500); }
.chart-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; }

/* ---------- 移动端 ---------- */
.mobile-nav { display: none; }
.menu-btn { display: none; }

@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 980px) {
  .search-box { display: none; }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s; width: 250px; }
  .sidebar.open { transform: none; box-shadow: 0 0 0 100vmax rgba(10,18,30,.45); }
  .main { margin-left: 0; }
  .menu-btn { display: inline-grid; }
  .content { padding: 14px 12px calc(76px + env(safe-area-inset-bottom)); }
  .topbar { padding: 0 12px; height: 54px; }
  .top-actions .user-btn { display: none; }
  .mobile-nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--gray-200); z-index: 25; padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -4px 18px rgba(16,30,54,.06); }
  .mobile-nav .m-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0 7px; color: var(--gray-500); font-size: 11px; }
  .mobile-nav .m-item.active { color: var(--blue); font-weight: 600; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .stat .value { font-size: 22px; }
  .detail-head h2 { font-size: 17px; }
  .modal, .modal.lg { width: 100%; max-height: 92vh; border-radius: 12px; }
  .drawer { width: 100%; }
  .modal-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .kv { grid-template-columns: 78px 1fr; }
  .toolbar { padding: 12px; }
  .toolbar .search-input { width: 100%; }
  .toolbar select { flex: 1; }
  table.table th { padding: 9px 10px; }
  table.table td { padding: 10px; }
}

@media (max-width: 560px) {
  .grid-2 { grid-template-columns: 1fr; }
  .stat .value { font-size: 20px; }
  .card-head, .card-body { padding: 12px 14px; }
}

/* ---------- 进度甘特图 ---------- */
.gantt-toolbar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; flex-wrap: wrap; }
.gantt-toolbar select { min-width: 240px; }
.seg { display: inline-flex; border: 1px solid var(--gray-200); border-radius: 7px; overflow: hidden; }
.seg button { height: 32px; padding: 0 13px; border: 0; background: #fff; color: var(--gray-500); font-size: 12.5px; cursor: pointer; }
.seg button.active { background: var(--blue); color: #fff; }
.gantt-stats { display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--gray-100); background: var(--gray-100); gap: 1px; }
.gs { background: #fff; padding: 11px 16px; }
.gs label { display: block; color: var(--gray-500); font-size: 11.5px; margin-bottom: 3px; }
.gs b { font-size: 18px; font-weight: 600; }
.gs small { font-size: 11px; color: var(--red); margin-left: 5px; font-weight: 500; }
.gs.warn b { color: var(--red); }
.gantt-legend { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 10px 16px; border-bottom: 1px solid var(--gray-100); font-size: 12px; color: var(--gray-500); }
.gantt-legend i { display: inline-block; width: 13px; height: 8px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.gantt-legend .lg-plan { background: #dbeafe; }
.gantt-legend .lg-fill { background: var(--blue); }
.gantt-legend .lg-actual { background: var(--orange); }
.gantt-legend .lg-delay { background: #fef2f2; border: 1px solid var(--red); }
.gantt-legend .lg-ms { width: 8px; height: 8px; background: var(--navy); transform: rotate(45deg); }
.gantt-legend .sub { margin-left: auto; }
.gantt-tip { padding: 9px 16px; background: #fff8e6; border-bottom: 1px solid #f5e2b8; color: #8a6d1f; font-size: 12px; }
.gantt-scroll { overflow: auto; max-height: calc(100vh - 330px); background: #fff; }
.gantt-flex { display: flex; align-items: flex-start; width: max-content; min-width: 100%; }
.gantt-left { position: sticky; left: 0; z-index: 6; flex: 0 0 auto; background: #fff; border-right: 1px solid var(--gray-200); }
.g-left-head { position: sticky; top: 0; z-index: 8; display: flex; align-items: center; justify-content: space-between; padding: 0 10px; background: #f8fafc; border-bottom: 1px solid var(--gray-200); font-size: 12px; font-weight: 600; color: var(--gray-700); }
.g-left-head .sub { color: var(--gray-500); font-weight: 500; }
.g-left-row { display: flex; align-items: center; gap: 6px; padding: 0 10px; border-bottom: 1px solid var(--gray-100); cursor: pointer; }
.g-left-row:hover { background: var(--gray-50); }
.g-left-row.delay { background: #fef2f2; }
.g-left-row.section { cursor: default; background: #eef4fb; font-size: 12px; font-weight: 600; color: var(--gray-700); }
.g-left-row .g-name { flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px; overflow: hidden; }
.g-name-txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-prog { width: 48px; flex: 0 0 48px; text-align: right; color: var(--gray-500); font-size: 11.5px; }
.g-caret { color: var(--gray-500); font-size: 9px; }
.g-ms-dot { width: 7px; height: 7px; background: var(--navy); transform: rotate(45deg); display: inline-block; flex: 0 0 7px; }
.gantt-right { flex: 0 0 auto; }
.g-head { position: sticky; top: 0; z-index: 5; background: #f8fafc; border-bottom: 1px solid var(--gray-200); }
.g-months, .g-ticks { position: absolute; inset: 0; }
.g-month { position: absolute; top: 0; height: 20px; line-height: 20px; padding-left: 5px; border-right: 1px solid var(--gray-200); font-size: 11px; color: var(--gray-700); white-space: nowrap; overflow: hidden; }
.g-tick { position: absolute; top: 20px; height: 26px; line-height: 26px; text-align: center; border-right: 1px solid var(--gray-100); font-size: 10px; color: var(--gray-500); overflow: hidden; }
.g-tick.weekend { background: #f1f5f9; }
.g-tick.today { background: var(--blue); color: #fff; font-weight: 600; }
.g-today-flag { position: absolute; top: 0; height: 20px; margin-left: -1px; border-left: 2px solid var(--blue); font-size: 10px; color: var(--blue); padding-left: 3px; }
.g-body { position: relative; }
.g-weekend { position: absolute; top: 0; bottom: 0; background: #f8fafc; pointer-events: none; }
.g-line { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--gray-200); pointer-events: none; }
.g-today-line { position: absolute; top: 0; bottom: 0; border-left: 2px dashed var(--blue); pointer-events: none; z-index: 1; }
.g-right-row { position: relative; border-bottom: 1px solid var(--gray-100); }
.g-right-row.delay { background: #fef2f2; }
.g-right-row.section { background: #eef4fb; }
.g-bar { position: absolute; top: 9px; height: 16px; z-index: 3; cursor: grab; touch-action: none; }
.g-bar-plan { position: absolute; inset: 0; background: #dbeafe; border: 1px solid #bfdbfe; border-radius: 4px; }
.g-bar-fill { position: absolute; left: 0; top: 0; bottom: 0; max-width: 100%; background: var(--blue); border-radius: 4px; opacity: .9; }
.g-bar.done .g-bar-fill { background: var(--green); }
.g-bar.delay .g-bar-plan { border-color: var(--red); }
.g-bar.delay .g-bar-fill { background: var(--red); }
.g-bar-label { position: absolute; right: -32px; top: -3px; font-size: 10px; color: var(--gray-500); white-space: nowrap; }
.g-bar-actual { position: absolute; bottom: 3px; height: 3px; background: var(--orange); border-radius: 2px; z-index: 2; }
.g-bar-actual.done { background: var(--green); }
.g-bar-actual.delay { background: var(--red); }
.g-handle { position: absolute; top: 0; bottom: 0; width: 6px; z-index: 4; cursor: ew-resize; }
.g-handle.l { left: -3px; }
.g-handle.r { right: -3px; }
.g-noschedule { position: absolute; left: 5px; top: 10px; font-size: 11px; color: var(--gray-300); }
.g-ms { position: absolute; top: 9px; width: 10px; height: 10px; margin-left: -5px; background: var(--navy); transform: rotate(45deg); z-index: 3; }
.g-ms.done { background: var(--green); }
.g-ms.delay { background: var(--red); }
.g-ms-actual { position: absolute; top: 12px; width: 5px; height: 5px; margin-left: -2px; border-radius: 50%; background: var(--orange); }
.gantt-plist { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.gantt-pcard { border: 1px solid var(--gray-200); border-radius: 10px; padding: 14px 16px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.gantt-pcard:hover { border-color: var(--blue); box-shadow: var(--shadow); }
.gantt-pcard-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.gantt-pcard-top b { display: block; font-size: 14px; }
.gantt-pcard-top small { display: block; color: var(--gray-500); font-size: 11.5px; margin-top: 3px; }
.gantt-pcard-bar { margin: 12px 0 8px; }
.gantt-pcard-foot { display: flex; justify-content: space-between; color: var(--gray-500); font-size: 11.5px; }

/* ---------- 现场 APP ---------- */
.field-page { max-width: 980px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.field-hero { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 18px; border-radius: 14px; color: #fff; background: linear-gradient(135deg, #16324f, #245a90); box-shadow: var(--shadow); }
.field-hero-title { font-size: 20px; font-weight: 700; letter-spacing: .5px; }
.field-hero-sub { font-size: 12px; opacity: .82; margin-top: 5px; }
.field-hero-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 5px 10px; border-radius: 999px; background: rgba(255,255,255,.14); }
.field-hero-status i { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; }
.field-hero-status.off i { background: #f59e0b; }
.field-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.fs { background: #fff; border: 1px solid var(--gray-200); border-radius: 10px; padding: 11px 13px; }
.fs b { display: block; font-size: 21px; line-height: 1.2; }
.fs span { color: var(--gray-500); font-size: 11.5px; }
.fs.warn b { color: var(--red); }
.field-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.ftile { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 92px; padding: 10px; border-radius: 12px; border: 1px solid var(--gray-200); background: #fff; cursor: pointer; transition: transform .12s, box-shadow .15s, border-color .15s; }
.ftile:active { transform: scale(.97); }
.ftile:hover { border-color: var(--blue); box-shadow: var(--shadow); }
.ftile-ic { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); }
.ftile-t { font-size: 13px; font-weight: 600; color: var(--gray-900); }
.ftile.green .ftile-ic { background: #e8f8ee; color: var(--green); }
.ftile.orange .ftile-ic { background: #fff4e5; color: var(--orange); }
.ftile.red .ftile-ic { background: #fdeaea; color: var(--red); }
.ftile-badge { position: absolute; top: 7px; right: 9px; min-width: 18px; height: 18px; line-height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 600; text-align: center; }
.field-project { cursor: pointer; }
.field-project:hover b { color: var(--blue); }
.field-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.field-form input[type=file] { padding: 9px; border: 1.5px dashed #c3d0e0; border-radius: 8px; background: #fafcff; color: var(--gray-500); width: 100%; }
.field-form textarea { min-height: 66px; }

@media (max-width: 900px) {
  .gantt-stats { grid-template-columns: repeat(2, 1fr); }
  .gantt-plist { grid-template-columns: 1fr; }
  .gantt-toolbar select { min-width: 0; flex: 1; }
  .gantt-scroll { max-height: calc(100vh - 300px); }
  .field-form { grid-template-columns: 1fr; }
  .field-actions { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .ftile { min-height: 82px; }
  .ftile-ic { width: 38px; height: 38px; }
  .ftile-t { font-size: 12px; }
  .field-stats { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .fs { padding: 9px 10px; }
  .fs b { font-size: 18px; }
}

@media (max-width: 560px) {
  .field-hero { padding: 16px 14px; }
  .field-hero-title { font-size: 18px; }
  .field-stats { grid-template-columns: repeat(2, 1fr); }
  .ftile { min-height: 78px; }
  .field-actions { grid-template-columns: repeat(4, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
}

/* 打印 */
@media print {
  .sidebar, .topbar, .mobile-nav, .toolbar, .pager, .card-actions, .gantt-toolbar, .gantt-legend { display: none !important; }
  .main { margin-left: 0; }
  body { background: #fff; }
  .gantt-scroll { max-height: none; overflow: visible; }
}
