/* 合同执行汇总站 - 深蓝商务风 */
:root {
  --navy: #0a2540;
  --navy2: #123a6b;
  --navy3: #1b4a8a;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --gold: #c9a227;
  --gold-soft: #f5eeda;
  --bg: #eef2f7;
  --card: #ffffff;
  --text: #17233b;
  --muted: #5c6b84;
  --border: #dde4ef;
  --border-soft: #e8edf5;
  --green: #157347;
  --green-bg: #e2f3e8;
  --red: #b3261e;
  --red-bg: #fdecea;
  --amber: #8a6100;
  --amber-bg: #fff3d0;
  --shadow-sm: 0 1px 3px rgba(10, 37, 64, 0.08);
  --shadow-md: 0 8px 24px rgba(10, 37, 64, 0.12);
  --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
}
a { color: var(--blue); }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ---- 顶栏 ---- */
.topbar {
  background: linear-gradient(120deg, #081c33 0%, #0e2f57 55%, #14467e 100%);
  color: #fff;
  border-bottom: 3px solid var(--gold);
  position: relative;
  overflow: hidden;
}
.topbar::after {
  content: "";
  position: absolute; inset: 0;
  background: repeating-linear-gradient(115deg, rgba(255,255,255,0.03) 0 2px, transparent 2px 90px);
  pointer-events: none;
}
.topbar-inner {
  position: relative;
  display: flex; align-items: center; gap: 14px;
  padding: 16px 24px;
}
.logo-mark {
  flex: 0 0 auto;
  width: 42px; height: 42px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--blue), var(--navy3));
  border: 1px solid rgba(255,255,255,0.35);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.brand { color: #fff; text-decoration: none; font-size: 22px; font-weight: 700; letter-spacing: 2px; line-height: 1.2; }
.brand-sub { color: #aec6e8; font-size: 13px; letter-spacing: 1px; white-space: nowrap; }
.topbar-nav { margin-left: auto; display: flex; gap: 6px; }
.topbar-nav a {
  color: #dbe7f7; text-decoration: none; font-size: 14px;
  padding: 8px 14px; border-radius: 8px;
}
.topbar-nav a:hover, .topbar-nav a.active { background: rgba(255,255,255,0.14); color: #fff; }

main.wrap { padding-top: 26px; padding-bottom: 48px; }
.footer { color: var(--muted); font-size: 13px; padding: 20px 0 34px; text-align: center; border-top: 1px solid var(--border); }

/* ---- 标题与统计卡 ---- */
.hero { margin: 4px 0 22px; }
.hero h1 { font-size: 28px; margin: 0 0 6px; color: var(--navy); letter-spacing: 1px; }
.hero p { margin: 0; color: var(--muted); font-size: 15px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 20px 0 24px; }
.stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-top: 3px solid var(--blue);
  border-radius: var(--radius);
  padding: 18px 20px 16px;
  box-shadow: var(--shadow-sm);
}
.stat.gold { border-top-color: var(--gold); }
.stat.red { border-top-color: #d93025; }
.stat.green { border-top-color: #1a7f4b; }
.stat .num { font-size: 30px; font-weight: 800; color: var(--navy); line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat .num small { font-size: 15px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.stat .lbl { color: var(--muted); font-size: 13px; margin-top: 4px; letter-spacing: 1px; }

/* ---- 卡片 ---- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
}
.card h2 { font-size: 18px; margin: 0 0 14px; color: var(--navy); }
.card h3 { font-size: 16px; margin: 24px 0 12px; color: var(--navy); }

/* ---- 工具栏：搜索 ---- */
.toolbar { display: flex; gap: 14px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }
.search-box { position: relative; flex: 1 1 340px; }
.search-box svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #8aa0bd; pointer-events: none; }
#search {
  width: 100%;
  padding: 12px 42px 12px 42px;
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: none;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
#search:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16); }
.search-clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; border: none; border-radius: 50%;
  background: #e8edf5; color: var(--muted); font-size: 15px; line-height: 1;
  cursor: pointer; display: none;
}
.search-clear:hover { background: #dbe3ef; color: var(--text); }
.count { color: var(--muted); font-size: 14px; white-space: nowrap; }
.count b { color: var(--navy); }

/* ---- 上传区 ---- */
.upload-zone {
  border: 2px dashed #b9c8e2;
  border-radius: var(--radius);
  background: #f8fafd;
  padding: 26px 24px;
  text-align: center;
  transition: border-color .15s, background .15s;
  cursor: pointer;
}
.upload-zone:hover, .upload-zone.dragover { border-color: var(--blue); background: #eef4ff; }
.upload-zone .up-icon { color: var(--blue); margin-bottom: 6px; }
.upload-zone .up-title { font-size: 16px; font-weight: 700; color: var(--navy); }
.upload-zone .up-hint { color: var(--muted); font-size: 13px; margin-top: 4px; }
.upload-zone .up-file { color: var(--blue); font-size: 14px; font-weight: 600; margin-top: 8px; min-height: 20px; }
.upload-zone input[type="file"] { display: none; }
.upload-actions { text-align: center; margin-top: 16px; }

/* ---- 按钮 ---- */
.btn {
  display: inline-block;
  background: linear-gradient(180deg, #2f74f0, var(--blue-dark));
  color: #fff; border: none; border-radius: 10px;
  padding: 11px 22px; font-size: 15px; font-weight: 600;
  cursor: pointer; text-decoration: none;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
  transition: filter .15s, transform .1s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; }
.btn-ghost {
  background: #fff; color: var(--navy);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.btn-ghost:hover { background: #eef2f8; filter: none; }
.btn-sm { padding: 8px 14px; font-size: 14px; border-radius: 8px; }

/* ---- 项目卡片 ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; }
.project { position: relative; padding: 20px 22px 18px; border-left: 4px solid var(--green); transition: transform .15s, box-shadow .15s, border-color .15s; }
.project:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: #c3d4ef; }
.project.status-bad { border-left-color: #d93025; }
.project.status-warn { border-left-color: #d9930d; }
.project h2 { font-size: 17px; margin: 0 0 10px; line-height: 1.45; }
.project h2 a { color: var(--navy); text-decoration: none; }
.project h2 a::after {
  content: ""; position: absolute; inset: 0; border-radius: var(--radius);
}
.project h2 a:hover { color: var(--blue); }
.project h2 a:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.project h2 mark, .crumb mark { background: #ffe58a; color: inherit; border-radius: 3px; padding: 0 1px; }
.stats { display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; margin-bottom: 10px; }
.stats .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.dot-green { background: #1a7f4b; } .dot-red { background: #d93025; } .dot-amber { background: #d9930d; } .dot-blue { background: var(--blue); }
.stats b { font-variant-numeric: tabular-nums; }
.meta { color: var(--muted); font-size: 13px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.meta .more { color: var(--blue); font-weight: 600; white-space: nowrap; }
.empty { color: var(--muted); text-align: center; padding: 36px 0; font-size: 15px; }
.flash { background: #eaf2ff; border: 1px solid #bcd4fb; border-radius: 12px; padding: 12px 18px; margin-bottom: 20px; }
.flash p { margin: 4px 0; }

/* ---- 内页 ---- */
.crumb { color: var(--muted); font-size: 14px; margin: 2px 0 14px; }
.crumb a { color: var(--blue); text-decoration: none; }
.crumb a:hover { text-decoration: underline; }
.crumb .sep { margin: 0 6px; color: #9aa9c0; }
.backbar { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.backbar .spacer { flex: 1; }
.ptitle { font-size: 26px; margin: 0 0 6px; color: var(--navy); letter-spacing: 0.5px; line-height: 1.35; }
.psub { color: var(--muted); margin: 0 0 20px; font-size: 14px; }
.chips { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.chip {
  background: #fff; border: 1px solid var(--border); border-radius: 999px;
  padding: 7px 16px; font-size: 14px; box-shadow: var(--shadow-sm);
}
.chip b { font-size: 16px; font-variant-numeric: tabular-nums; }
.chip.c-blue b { color: var(--blue); }
.chip.c-green b { color: var(--green); }
.chip.c-red b { color: var(--red); }
.chip.c-amber b { color: var(--amber); }

/* ---- 表格 ---- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
table.data th, table.data td { border-bottom: 1px solid var(--border-soft); padding: 10px 12px; text-align: left; white-space: nowrap; }
table.data thead th {
  background: var(--navy2); color: #fff;
  position: sticky; top: 0; z-index: 1;
  font-weight: 600; letter-spacing: 0.5px;
}
table.data tbody tr:nth-child(even) { background: #f8fafc; }
table.data tbody tr:hover { background: #eef4fc; }
table.data tbody tr:last-child td { border-bottom: none; }
table.data tfoot td { font-weight: 700; background: #eef2f8; border-top: 2px solid var(--border); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.kv { width: 100%; }
table.kv th, table.kv td { border: 1px solid var(--border); padding: 9px 14px; text-align: left; }
table.kv th { background: #eef2f8; width: 40%; font-weight: 600; color: var(--navy); }
table.kv td { word-break: break-all; }
.note { color: var(--muted); font-size: 13px; margin: 16px 0 0; line-height: 1.7; }
.badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-done { background: var(--green-bg); color: var(--green); }
.badge-todo { background: var(--red-bg); color: var(--red); }
.badge-partial { background: var(--amber-bg); color: var(--amber); }

@media (max-width: 900px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  body { font-size: 14px; }
  .wrap { padding: 0 16px; }
  .topbar-inner { flex-wrap: wrap; padding: 14px 16px; }
  .brand-sub { display: none; }
  .topbar-nav { margin-left: 0; }
  .hero h1 { font-size: 23px; }
  .ptitle { font-size: 21px; }
  .card { padding: 18px 16px; }
  .stat .num { font-size: 25px; }
  .grid { grid-template-columns: 1fr; }
  .backbar .btn { flex: 1 1 auto; text-align: center; }
}

/* ---- 内页表格：铺满宽度、自动换行，不出现横向滚动条 ---- */
.wrap--wide { max-width: 1440px; }
.table-wrap--fit { overflow: visible; }
table.data.data--fit { table-layout: fixed; width: 100%; }
table.data.data--fit th, table.data.data--fit td { white-space: normal; overflow-wrap: anywhere; }
