:root {
  --bg: #f4f5f8;
  --panel: #ffffff;
  --navy: #1b2a4a;
  --navy-2: #233458;
  --gold: #c08a3e;
  --ink: #1f2a44;
  --muted: #8a93a6;
  --line: #e6e9ef;
  --line-strong: #dfe3eb;
  --blue: #1d4ed8;
  --green: #15803d;
  --red: #c81e1e;
  --grey: #64748b;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-md: 0 10px 28px rgba(16, 24, 40, .08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 420px at 12% -140px, rgba(27, 42, 74, .10), transparent 70%),
    linear-gradient(180deg, #f7f8fa 0%, var(--bg) 260px);
  color: var(--ink);
  font-family: "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 30px;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(145deg, #24375d, var(--navy));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 4px 10px rgba(27, 42, 74, .22);
}

.brand-text h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: .02em;
  color: var(--navy);
}

.brand-text p {
  margin: 2px 0 0;
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: .02em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.file-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: 320px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fafbfc;
  color: #5b6578;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
}

.file-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  color: #3c465c;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background .18s, border-color .18s, color .18s, transform .18s;
  white-space: nowrap;
}

.btn:hover {
  border-color: #c4cbd9;
  color: var(--navy);
  background: #fbfcfe;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.btn-primary:hover {
  background: #243a63;
  border-color: #243a63;
  color: #fff;
}

.btn .refresh-icon { transition: transform .5s ease; }
.btn.loading .refresh-icon { animation: spin .9s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 主区域 ---------- */
.main {
  padding: 20px 30px 40px;
  max-width: 1800px;
  margin: 0 auto;
}

.kpi-grid {
  display: grid;
  grid-template-columns: 1.55fr repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}

.kpi {
  position: relative;
  padding: 15px 18px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.kpi-head {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--muted);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
}

.dot.green { background: var(--green); }
.dot.blue { background: var(--blue); }
.dot.red { background: var(--red); }

.kpi-value {
  margin-top: 6px;
  font-size: 27px;
  font-weight: 650;
  line-height: 1.1;
  letter-spacing: .01em;
  font-variant-numeric: tabular-nums;
}

.kpi-value span {
  margin-left: 5px;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}

.kpi-sub {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--muted);
}

.kpi-sub b { color: #4b5468; font-weight: 600; }

.kpi-bar {
  margin-top: 10px;
  height: 5px;
  border-radius: 4px;
  background: #eef1f6;
  overflow: hidden;
}

.kpi-bar span {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--gold), #d8ab63);
  transition: width .5s ease;
}

/* ---------- 工具栏 ---------- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search {
  position: relative;
  display: flex;
  align-items: center;
}

.search svg {
  position: absolute;
  left: 12px;
  color: #9aa3b5;
  pointer-events: none;
}

.search input {
  width: 288px;
  height: 37px;
  padding: 0 12px 0 34px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 12.5px;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}

.search input::placeholder { color: #a6aebd; }

.search input:focus {
  border-color: #9fb0cf;
  box-shadow: 0 0 0 3px rgba(27, 42, 74, .07);
}

.status-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  background: #eef0f4;
  border-radius: 11px;
  flex-wrap: wrap;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 29px;
  padding: 0 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #5d6779;
  font-size: 12px;
  cursor: pointer;
  transition: background .16s, color .16s, box-shadow .16s;
}

.filter-chip b {
  font-size: 10.5px;
  font-weight: 600;
  color: #939cad;
  font-variant-numeric: tabular-nums;
}

.filter-chip:hover { color: var(--navy); }

.filter-chip.active {
  background: #fff;
  color: var(--navy);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(16, 24, 40, .12);
}

.filter-chip.active b { color: var(--gold); }

.sheet-picker {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 37px;
  padding-left: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: #8a93a6;
}

.sheet-picker svg {
  position: absolute;
  left: 10px;
  pointer-events: none;
}

.sheet-picker select {
  height: 100%;
  max-width: 220px;
  padding: 0 8px 0 0;
  border: none;
  background: transparent;
  color: var(--navy);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  outline: none;
}

.refresh-picker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 8px 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbfc;
  font-size: 11.5px;
  color: #7c8698;
  white-space: nowrap;
}

.refresh-picker select {
  border: none;
  background: transparent;
  color: var(--navy);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  padding: 2px 0;
}

.meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #98a1b2;
  font-size: 11.5px;
}

.meta-text {
  text-align: right;
  line-height: 1.55;
  max-width: 340px;
}

.meta b { color: #5d6779; font-weight: 500; }

.board-notice {
  margin-bottom: 14px;
  padding: 12px 16px;
  border: 1px solid #eee3cf;
  border-radius: 10px;
  background: #fdf8ef;
  color: #8a6a34;
  font-size: 12.5px;
  line-height: 1.7;
}

.board-notice b { color: #6f5323; }

/* ---------- 看板 ---------- */
.board {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  overflow-x: auto;
  padding-bottom: 14px;
  scrollbar-width: thin;
}

.column {
  flex: 1 1 0;
  min-width: 272px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 12px 26px -18px rgba(16, 24, 40, .28);
  border: 1px solid var(--line);
  animation: fade-in .35s ease both;
}

.column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 15px 17px 14px;
  border-radius: 11px 11px 0 0;
  background: linear-gradient(160deg, #24365a 0%, #1a2743 100%);
  color: #fff;
}

.column-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .03em;
}

.column-head p {
  margin: 3px 0 0;
  font-size: 10px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .5);
}

.col-count {
  min-width: 26px;
  height: 22px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  background: rgba(255, 255, 255, .14);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, .88);
}

.column-body {
  padding: 12px;
  min-height: 430px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ---------- 卡片 ---------- */
.card {
  position: relative;
  padding: 13px 14px 12px;
  border: 1px solid #e8ebf1;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  animation: rise .32s ease both;
  animation-delay: var(--d, 0ms);
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: transparent;
  transition: background .2s;
}

.card:hover {
  transform: translateY(-2px);
  border-color: #d3dae6;
  box-shadow: 0 10px 22px -12px rgba(16, 24, 40, .28);
}

.card:hover::before { background: var(--gold); }
.card.st-blocked::before { background: var(--red); }
.card.st-done::before { background: var(--green); }

.card:focus-visible {
  outline: 2px solid #93a7c9;
  outline-offset: 2px;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-no {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1;
  letter-spacing: .08em;
  color: var(--gold);
}

.card h3 {
  margin: 7px 0 2px;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--navy);
}

.card-en {
  margin: 0;
  font-size: 11px;
  line-height: 1.4;
  color: #929bad;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px 2px 7px;
  border-radius: 20px;
  font-size: 10.5px;
  line-height: 1.55;
  white-space: nowrap;
}

.status-pill::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.status-pill.st-todo { color: #64748b; background: #f1f4f8; }
.status-pill.st-doing { color: #1d4ed8; background: #eaf0ff; }
.status-pill.st-blocked { color: #c81e1e; background: #fdecec; }
.status-pill.st-done { color: #15803d; background: #e9f7ef; }

.card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  font-size: 11px;
  color: #7c8698;
  flex-wrap: wrap;
}

.owner {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.owner i {
  width: 19px;
  height: 19px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #eef1f7;
  color: #5c6880;
  font-size: 10px;
  font-style: normal;
  font-weight: 600;
}

.owner.none i { background: #f6f7f9; color: #aeb6c4; }

.due {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.due.overdue { color: var(--red); }

.progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 9px;
}

.progress .bar {
  flex: 1;
  height: 4px;
  border-radius: 4px;
  background: #eef1f5;
  overflow: hidden;
}

.progress .bar span {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: #9fb0cd;
  transition: width .45s ease;
}

.card.st-doing .bar span { background: #5b82d6; }
.card.st-done .bar span { background: #4caf7d; }
.card.st-blocked .bar span { background: #e06a6a; }

.progress em {
  width: 32px;
  text-align: right;
  font-style: normal;
  font-size: 10.5px;
  color: #8d96a8;
  font-variant-numeric: tabular-nums;
}

.column-empty {
  margin: 6px 2px;
  padding: 24px 10px;
  border: 1px dashed #dde2ea;
  border-radius: 9px;
  text-align: center;
  font-size: 11.5px;
  color: #a4adbd;
}

/* ---------- 详情抽屉 ---------- */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(17, 24, 39, .34);
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s ease;
}

.drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  width: 430px;
  max-width: 93vw;
  display: flex;
  flex-direction: column;
  background: #fff;
  box-shadow: -24px 0 60px rgba(15, 23, 42, .18);
  transform: translateX(102%);
  transition: transform .32s cubic-bezier(.22, .61, .36, 1);
  visibility: hidden;
}

.drawer.open {
  transform: none;
  visibility: visible;
}

.drawer-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 24px 24px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fbfcfe, #fff);
}

.drawer-no {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
  line-height: 1;
  color: var(--gold);
  letter-spacing: .06em;
  padding-top: 3px;
}

.drawer-title { flex: 1; min-width: 0; }

.drawer-title h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 650;
  color: var(--navy);
  line-height: 1.3;
  word-break: break-word;
}

.drawer-title p {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
  word-break: break-word;
}

.icon-btn {
  width: 30px;
  height: 30px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #6c7689;
  cursor: pointer;
  transition: background .16s, color .16s;
}

.icon-btn:hover { background: #f4f6f9; color: var(--navy); }

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 26px;
}

.drawer-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.priority-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: #fafbfc;
  font-size: 10.5px;
  color: #6b7588;
}

.priority-pill.high { color: #b45309; border-color: #f0dcc0; background: #fdf7ee; }
.priority-pill.mid { color: #3f5d8f; border-color: #d8e2f2; background: #f4f8fe; }

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}

.field {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fbfcfd;
}

.field label {
  display: block;
  font-size: 10.5px;
  color: #9aa3b4;
  letter-spacing: .04em;
  margin-bottom: 3px;
}

.field div {
  font-size: 13px;
  color: #2b3650;
  font-weight: 500;
  word-break: break-word;
}

.field-block { margin-bottom: 18px; }

.field-block h4 {
  margin: 0 0 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: #6c7689;
  letter-spacing: .05em;
}

.field-block h4 .badge {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 10px;
  background: #eef1f6;
  color: #6c7689;
  font-size: 10px;
  line-height: 16px;
}

.note-box {
  padding: 12px 14px;
  border-radius: 9px;
  background: #f7f8fb;
  font-size: 12.5px;
  line-height: 1.75;
  color: #4b5568;
  white-space: pre-wrap;
  word-break: break-word;
}

.note-box.empty { color: #a6aebd; }

.progress-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-line .bar {
  flex: 1;
  height: 7px;
  border-radius: 6px;
  background: #eef1f5;
  overflow: hidden;
}

.progress-line .bar span {
  display: block;
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, #5b82d6, #7c9ce0);
  transition: width .4s ease;
}

.progress-line em {
  font-style: normal;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

.file-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  transition: border-color .16s, background .16s;
}

.file-item:hover { border-color: #ccd5e3; background: #fbfcfe; }

.file-ico {
  width: 30px;
  height: 30px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #f0f3f9;
  color: #52607a;
}

.file-info { flex: 1; min-width: 0; }

.file-info strong {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #2b3650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-info span {
  display: block;
  font-size: 10.5px;
  color: #9aa3b4;
  margin-top: 1px;
}

.link-btn {
  border: none;
  background: transparent;
  color: var(--navy);
  font-size: 11.5px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  white-space: nowrap;
}

.link-btn:hover { background: #eef2f9; }

.file-empty {
  padding: 14px;
  border: 1px dashed #dfe4ec;
  border-radius: 9px;
  font-size: 11.5px;
  line-height: 1.7;
  color: #9ba4b5;
  background: #fbfcfd;
}

.folder-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f8fb;
}

.folder-path {
  flex: 1;
  min-width: 0;
  font-size: 10.5px;
  color: #8a93a6;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-bar .link-btn {
  padding: 0;
  font-size: 11px;
}

.file-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 6px;
  background: #fdf3e2;
  color: #a5701f;
  font-size: 9px;
  font-style: normal;
  line-height: 15px;
  vertical-align: 1px;
}

.drawer-foot {
  display: flex;
  gap: 10px;
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  background: #fbfcfd;
}

.drawer-foot .btn { flex: 1; justify-content: center; }

/* ---------- 其他 ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  z-index: 90;
  padding: 9px 18px;
  border-radius: 9px;
  background: rgba(24, 33, 52, .94);
  color: #fff;
  font-size: 12.5px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .28);
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
  max-width: 80vw;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.board-error {
  width: 100%;
  padding: 30px;
  border: 1px solid #f2d5d5;
  border-radius: 12px;
  background: #fff8f8;
  color: #a13b3b;
  font-size: 13px;
  line-height: 1.9;
}

.board-error code {
  padding: 1px 5px;
  border-radius: 4px;
  background: #fdecec;
  font-size: 12px;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: none; }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 820px) {
  .topbar { padding: 12px 16px; flex-wrap: wrap; }
  .main { padding: 16px 16px 30px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .search input { width: 100%; }
  .search { flex: 1 1 100%; }
  .meta { margin-left: 0; flex: 1 1 100%; justify-content: space-between; flex-wrap: wrap; }
  .meta-text { text-align: left; }
  .sheet-picker { flex: 1 1 100%; }
  .sheet-picker select { max-width: none; flex: 1; }
  .column { flex: 0 0 86vw; }
  .file-chip { display: none; }
}

/* ---------- 模块切换 ---------- */
.module-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 11px;
  background: #eef0f4;
  flex: 0 1 auto;
}

.module-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #5d6779;
  font-size: 12.5px;
  cursor: pointer;
  transition: background .16s, color .16s, box-shadow .16s;
  white-space: nowrap;
}

.module-tab i {
  font-style: normal;
  font-size: 9.5px;
  line-height: 14px;
  padding: 0 5px;
  border-radius: 6px;
  background: #e4e8ef;
  color: #8a93a6;
}

.module-tab:hover { color: var(--navy); }

.module-tab.active {
  background: #fff;
  color: var(--navy);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(16, 24, 40, .12);
}

.module-tab.active i { background: #fdf3e2; color: #a5701f; }

/* ---------- 计划看板 ---------- */
body.plan-mode .board {
  display: block;
  overflow: visible;
  padding-bottom: 0;
}

.plan-wrap { width: 100%; }

.plan-summary {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 14px 18px;
  margin-bottom: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.plan-range {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.plan-range span {
  font-size: 11.5px;
  color: var(--muted);
}

.plan-range b {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

.plan-range-sub {
  font-size: 11.5px;
  color: #8a93a6;
}

.plan-legend {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 11px;
  color: #7c8698;
}

.plan-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.lg {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: #94a3b8;
}

.lg.st-todo { background: #94a3b8; }
.lg.st-doing { background: #5b82d6; }
.lg.st-blocked { background: #e06a6a; }
.lg.st-done { background: #4caf7d; }

.plan-sheet {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 12px 26px -18px rgba(16, 24, 40, .28);
  overflow-x: auto;
  overflow-y: hidden;
}

.plan-row {
  display: grid;
  min-width: 980px;
  grid-template-columns: minmax(220px, 2.2fr) 96px 140px 118px 82px minmax(340px, 3fr);
  align-items: center;
  gap: 12px;
  padding: 11px 18px;
  border-top: 1px solid #f1f3f7;
}

.plan-row-head {
  border-top: none;
  padding: 12px 18px;
  background: linear-gradient(160deg, #24365a 0%, #1a2743 100%);
  color: rgba(255, 255, 255, .82);
  font-size: 11.5px;
  letter-spacing: .04em;
}

.plan-row:not(.plan-row-head) {
  cursor: pointer;
  transition: background .16s;
}

.plan-row:not(.plan-row-head):hover { background: #fbfcfe; }

.plan-row:not(.plan-row-head):focus-visible {
  outline: 2px solid #93a7c9;
  outline-offset: -2px;
}

.plan-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 980px;
  padding: 10px 18px;
  background: #f7f8fb;
  border-top: 1px solid var(--line);
  border-left: 3px solid var(--gold);
}

.plan-group-head + .plan-row { border-top: none; }

.plan-group-title {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.plan-group-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
}

.plan-group-title h2 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--navy);
}

.plan-group-count {
  font-size: 11px;
  color: #8a93a6;
}

.plan-group-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 160px;
}

.plan-group-progress .bar {
  flex: 1;
  height: 5px;
  border-radius: 4px;
  background: #e8ecf3;
  overflow: hidden;
}

.plan-group-progress .bar span {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--gold), #d8ab63);
}

.plan-group-progress em {
  width: 34px;
  text-align: right;
  font-style: normal;
  font-size: 11px;
  color: #5d6779;
  font-variant-numeric: tabular-nums;
}

.plan-no {
  flex: none;
  width: 26px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  line-height: 1;
  letter-spacing: .04em;
  color: var(--gold);
}

.pc-task {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.plan-task-main { min-width: 0; }

.plan-task-title {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--navy);
}

.ms-tag {
  font-size: 9.5px;
  font-weight: 500;
  line-height: 16px;
  padding: 0 6px;
  border: 1px solid #f0dcba;
  border-radius: 10px;
  background: #fdf3e2;
  color: #a5701f;
}

.plan-task-main small {
  display: block;
  margin-top: 2px;
  font-size: 10.5px;
  color: #929bad;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pc-owner {
  font-size: 12px;
  color: #4b5568;
  min-width: 0;
}

.pc-date span {
  display: block;
  font-size: 11.5px;
  color: #4b5568;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.pc-date small {
  display: block;
  margin-top: 1px;
  font-size: 10.5px;
  color: #98a1b2;
  white-space: nowrap;
}

.plan-row.overdue .pc-date span { color: var(--red); }

.pc-progress {
  display: flex;
  align-items: center;
  gap: 7px;
}

.pc-progress .bar {
  flex: 1;
  height: 5px;
  border-radius: 4px;
  background: #eef1f5;
  overflow: hidden;
}

.pc-progress .bar span {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: #9fb0cd;
  transition: width .4s ease;
}

.plan-row.st-doing .pc-progress .bar span { background: #5b82d6; }
.plan-row.st-done .pc-progress .bar span { background: #4caf7d; }
.plan-row.st-blocked .pc-progress .bar span { background: #e06a6a; }

.pc-progress em {
  width: 32px;
  text-align: right;
  font-style: normal;
  font-size: 10.5px;
  color: #8d96a8;
  font-variant-numeric: tabular-nums;
}

.pc-gantt { min-width: 0; }

.gantt-track {
  position: relative;
  height: 15px;
  border-radius: 8px;
  background: #f0f3f8;
  overflow: hidden;
}

.gantt-bar {
  position: absolute;
  top: 2px;
  bottom: 2px;
  min-width: 4px;
  border-radius: 5px;
  background: #dfe5ee;
  overflow: hidden;
}

.gantt-bar i {
  display: block;
  height: 100%;
  border-radius: 5px;
  background: #9fb0cd;
}

.gantt-bar.st-doing { background: #dbe6ff; }
.gantt-bar.st-doing i { background: #5b82d6; }
.gantt-bar.st-done { background: #d9f0e3; }
.gantt-bar.st-done i { background: #4caf7d; }
.gantt-bar.st-blocked { background: #fbdada; }
.gantt-bar.st-blocked i { background: #e06a6a; }

.gantt-bar.is-ms { box-shadow: inset 0 0 0 1px rgba(192, 138, 62, .7); }

.gantt-none {
  font-size: 10.5px;
  color: #a6aebd;
}

.plan-empty {
  padding: 20px 18px;
  text-align: center;
  font-size: 11.5px;
  color: #a4adbd;
}

/* ---------- 目录设置 ---------- */
#settingsDrawer { width: 560px; }

.settings-body { padding-top: 16px; }

.settings-card {
  padding: 14px 16px 16px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fbfcfe;
}

.settings-card header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.settings-card header h3 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--navy);
}

.settings-type {
  font-size: 10px;
  line-height: 16px;
  padding: 0 7px;
  border-radius: 9px;
  background: #eef1f7;
  color: #6c7689;
}

.settings-field { margin-top: 12px; }

.settings-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
}

.settings-label label {
  font-size: 11.5px;
  color: #6c7689;
  font-weight: 500;
}

.path-state { font-size: 10.5px; color: #15803d; }
.path-state.bad { color: #c81e1e; }

.path-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.path-input {
  flex: 1;
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: #2b3650;
  font-size: 11.5px;
  outline: none;
  transition: border-color .16s, box-shadow .16s;
}

.path-input:focus {
  border-color: #9fb0cf;
  box-shadow: 0 0 0 3px rgba(27, 42, 74, .07);
}

.path-row .btn {
  height: 34px;
  padding: 0 12px;
}

.path-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.path-actions .link-btn {
  padding: 2px 0;
  font-size: 11px;
}

.path-full {
  flex: 1;
  min-width: 0;
  text-align: right;
  font-size: 10.5px;
  color: #a6aebd;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-note {
  margin: 2px 2px 8px;
  font-size: 11px;
  line-height: 1.8;
  color: #98a1b2;
}

@media (max-width: 1320px) {
  .plan-row {
    grid-template-columns: minmax(210px, 2.4fr) 96px 138px 112px 84px minmax(140px, 1.6fr);
    gap: 10px;
    padding-left: 14px;
    padding-right: 14px;
  }
}

@media (max-width: 900px) {
  .plan-row { grid-template-columns: minmax(200px, 2.4fr) 96px 140px 112px 84px; }
  .plan-row .pc-gantt { display: none; }
}

@media (max-width: 860px) {
  .module-tabs {
    order: 3;
    width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
  }
  #settingsDrawer { width: 100%; max-width: 100vw; }
  .plan-summary { flex-direction: column; align-items: flex-start; gap: 8px; }
  .plan-legend { margin-left: 0; flex-wrap: wrap; }
  .plan-row {
    grid-template-columns: 1fr 1fr;
    row-gap: 8px;
    column-gap: 12px;
    padding: 12px 14px;
  }
  .plan-row-head { display: none; }
  .plan-row .pc-task { grid-column: 1 / -1; }
  .plan-row .pc-gantt { display: block; grid-column: 1 / -1; }
  .plan-row .pc-date { text-align: right; }
  .plan-row .pc-date small { text-align: right; }
  .plan-row .pc-progress { width: 100%; }
  .plan-row .pc-status { text-align: right; }
  .plan-group-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .plan-group-progress { width: 100%; }
  .path-row { flex-wrap: wrap; }
  .path-input { flex: 1 1 100%; }
  .path-full { display: none; }
}

/* ---------- 页面编辑 ---------- */
[hidden] { display: none !important; }

.plan-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.plan-actions .btn.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.plan-row.is-editable:hover {
  background: #fdf8ef;
  box-shadow: inset 3px 0 0 var(--gold);
}

.plan-edit-hint {
  margin-bottom: 12px;
  padding: 10px 14px;
  border: 1px solid #f0dcba;
  border-radius: 10px;
  background: #fdf8ef;
  color: #8a6a34;
  font-size: 12px;
  line-height: 1.7;
}

.plan-edit-hint b { color: #6f5323; }

.edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.edit-field {
  display: block;
  min-width: 0;
}

.edit-field.wide { grid-column: 1 / -1; }

.edit-field > span {
  display: block;
  margin-bottom: 4px;
  font-size: 10.5px;
  color: #8a93a6;
  letter-spacing: .03em;
}

.edit-field input,
.edit-field select,
.edit-field textarea {
  width: 100%;
  min-width: 0;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: #2b3650;
  font-size: 12.5px;
  font-family: inherit;
  outline: none;
  transition: border-color .16s, box-shadow .16s;
}

.edit-field input,
.edit-field select { height: 36px; }

.edit-field textarea {
  padding: 8px 10px;
  line-height: 1.6;
  resize: vertical;
}

.edit-field input:focus,
.edit-field select:focus,
.edit-field textarea:focus {
  border-color: #9fb0cf;
  box-shadow: 0 0 0 3px rgba(27, 42, 74, .07);
}

.edit-field input[readonly] {
  background: #f5f7fa;
  color: #6c7689;
}

.edit-field input[type="date"] { padding-right: 6px; }

.edit-note {
  margin: 14px 2px 0;
  font-size: 11px;
  line-height: 1.8;
  color: #98a1b2;
}

@media (max-width: 600px) {
  .edit-grid { grid-template-columns: 1fr; }
}

/* ---------- 表格预览 ---------- */
.table-modal {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(15, 23, 42, .5);
  backdrop-filter: blur(3px);
}

.table-modal.open { display: flex; }

.table-panel {
  display: flex;
  flex-direction: column;
  width: min(1180px, 96vw);
  max-height: 86vh;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .3);
  overflow: hidden;
}

.table-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
}

.table-title { min-width: 0; }

.table-title h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-title p {
  margin: 3px 0 0;
  font-size: 11.5px;
  color: var(--muted);
}

.table-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.table-body {
  padding: 18px 20px;
  overflow: auto;
}

.table-scroll {
  overflow: auto;
  max-height: calc(86vh - 72px);
}

.preview-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
  white-space: nowrap;
}

.preview-table th,
.preview-table td {
  padding: 7px 12px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  text-align: left;
}

.preview-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f6f8fb;
  color: #3d4a63;
  font-weight: 600;
}

.preview-table tbody tr:hover { background: #fbfcfe; }

.preview-table td { color: #3c465c; }

.table-empty {
  text-align: center !important;
  color: var(--muted) !important;
  padding: 26px !important;
}

.sheet-panel { width: min(520px, 92vw); }
.sheet-panel .table-body { padding: 16px 20px; }
.sheet-panel .settings-note { margin: 10px 0 0; }

/* ---------- 项目总览 / 进度洞察 ---------- */
.project-overview { margin-bottom: 14px; }

.overview-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}

.overview-head h3 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 650;
  color: var(--navy);
}

.overview-head span {
  font-size: 11px;
  color: var(--muted);
}

.overview-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.overview-card {
  flex: 0 0 232px;
  padding: 11px 13px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: var(--shadow-sm);
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .16s, box-shadow .16s, transform .16s;
}

.overview-card:hover {
  border-color: #c4cbd9;
  transform: translateY(-1px);
}

.overview-card.active {
  border-color: var(--navy);
  box-shadow: 0 0 0 2px rgba(27, 42, 74, .08);
}

.overview-card.ok { border-left: 3px solid var(--green); }
.overview-card.warn { border-left: 3px solid var(--gold); }
.overview-card.risk { border-left: 3px solid var(--red); }
.overview-card.empty { border-left: 3px solid #cbd2df; }

.overview-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.overview-name {
  font-size: 12.5px;
  font-weight: 600;
  color: #26334d;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.health-badge {
  flex: none;
  padding: 0 6px;
  border-radius: 5px;
  font-size: 10px;
  line-height: 16px;
}

.health-badge.ok { background: #e9f6ee; color: #15803d; }
.health-badge.warn { background: #fdf3e2; color: #a8681c; }
.health-badge.risk { background: #fdeeee; color: #b42323; }
.health-badge.empty { background: #f1f3f7; color: #7b869b; }

.overview-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 9px;
}

.overview-progress span {
  flex: 1;
  height: 6px;
  border-radius: 4px;
  background: #eef1f6;
  overflow: hidden;
}

.overview-progress i {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--gold), #d8ab63);
}

.overview-progress b {
  font-size: 12px;
  color: #3c465c;
  font-variant-numeric: tabular-nums;
}

.overview-meta {
  margin-top: 6px;
  font-size: 10.5px;
  color: #6b7689;
}

.overview-meta em {
  font-style: normal;
  color: var(--red);
}

.overview-dates {
  margin-top: 3px;
  font-size: 10.5px;
  color: #9aa3b4;
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.insight-card {
  position: relative;
  padding: 12px 15px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: var(--shadow-sm);
}

.insight-grid > .insight-card[draggable="true"] { cursor: move; }
.insight-grid > .insight-card[draggable="true"]:active { cursor: grabbing; }
.insight-card.dragging { opacity: .45; outline: 1px dashed var(--accent, #2f6fed); }

.card-del {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: none;
  color: #b6bdcb;
  font-size: 14px;
  line-height: 18px;
  cursor: pointer;
}
.card-del:hover { background: #fdecec; color: #d9534f; }

.add-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 96px;
  border-style: dashed;
  background: #fbfcfd;
  box-shadow: none;
}
.add-card button {
  padding: 6px 14px;
  border: 1px dashed #c6d0e2;
  border-radius: 8px;
  background: #fff;
  color: #4a5878;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}
.add-card button:hover { border-color: #8aa4d6; color: #2f6fed; }
.add-card p { margin: 0; font-size: 10.5px; color: #9aa3b4; }

.risk-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.risk-row .row-check { flex: none; width: 13px; height: 13px; cursor: pointer; }
.risk-title.is-done { color: #9aa3b4; text-decoration: line-through; }

.insight-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.insight-head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
}

.insight-count {
  font-size: 10.5px;
  color: var(--muted);
}

.alert-list,
.owner-list,
.ms-list,
.risk-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 172px;
  overflow: auto;
}

.alert-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  border: none;
  border-bottom: 1px dashed var(--line);
  background: none;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.alert-row:hover { background: #fafbfd; }

.alert-dot {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--gold);
}

.alert-row.risk .alert-dot { background: var(--red); }

.alert-name {
  flex: 1;
  font-size: 12px;
  color: #2b3650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alert-meta {
  flex: none;
  font-size: 10.5px;
  color: #8a93a6;
}

.alert-row.risk .alert-meta { color: var(--red); }

.owner-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

.owner-name {
  width: 64px;
  flex: none;
  font-size: 11.5px;
  color: #3c465c;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.owner-bar {
  flex: 1;
  height: 6px;
  border-radius: 4px;
  background: #eef1f6;
  overflow: hidden;
}

.owner-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #3b5f9e, #6a8dc9);
}

.owner-meta {
  width: 132px;
  flex: none;
  text-align: right;
  font-size: 10.5px;
  color: #8a93a6;
}

/* 阶段里程碑 */
.ms-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 2px;
  border-bottom: 1px dashed var(--line);
  font-size: 11px;
}

.ms-row:last-child { border-bottom: none; }

.ms-name {
  width: 72px;
  flex: none;
  color: #3c465c;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ms-badge {
  flex: none;
  padding: 0 5px;
  border-radius: 4px;
  font-size: 9.5px;
  line-height: 15px;
}

.ms-badge.done { background: #e9f6ee; color: #15803d; }
.ms-badge.doing { background: #e8f0ff; color: #1d4ed8; }
.ms-badge.warn { background: #fdf3e2; color: #a8681c; }
.ms-badge.risk { background: #fdeeee; color: #b42323; }
.ms-badge.todo { background: #f1f3f7; color: #7b869b; }
.ms-badge.empty { background: #f6f7f9; color: #a3abba; }

.ms-bar {
  flex: 1;
  min-width: 40px;
  height: 6px;
  border-radius: 4px;
  background: #eef1f6;
  overflow: hidden;
}

.ms-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), #d8ab63);
}

.ms-meta {
  flex: none;
  color: #6b7689;
  font-variant-numeric: tabular-nums;
}

.ms-date {
  flex: none;
  min-width: 108px;
  text-align: right;
  color: #9aa3b4;
  font-size: 10px;
}

/* 风险台账 */
.risk-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  border: none;
  border-bottom: 1px dashed var(--line);
  background: none;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.risk-row:hover { background: #fafbfd; }
.risk-row.closed { opacity: .55; }

.risk-level {
  flex: none;
  padding: 0 5px;
  border-radius: 4px;
  font-size: 9.5px;
  line-height: 15px;
}

.risk-level.high { background: #fdeeee; color: #b42323; }
.risk-level.mid { background: #fdf3e2; color: #a8681c; }
.risk-level.low { background: #f1f3f7; color: #5b6578; }

.risk-title {
  flex: 1;
  font-size: 11.5px;
  color: #2b3650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.risk-meta {
  flex: none;
  font-size: 10px;
  color: #8a93a6;
}


@media (max-width: 900px) {
  .insight-grid { grid-template-columns: 1fr; }
}



/* ---------- 用户 / 登录 ---------- */
.user-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px 4px 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fafbfc;
  max-width: 190px;
}

.user-avatar {
  width: 24px;
  height: 24px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #2a3f68, var(--navy));
  color: #fff;
  font-size: 11px;
  font-weight: 600;
}

.user-name {
  font-size: 12px;
  color: #3c465c;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-level {
  flex: none;
  padding: 0 6px;
  border-radius: 6px;
  font-size: 10px;
  line-height: 17px;
  font-weight: 600;
  background: #eef2f9;
  color: #4a5a7a;
}

.user-level.lv1 { background: #eef2f9; color: #52607a; }
.user-level.lv2 { background: #e8f0ff; color: #1d4ed8; }
.user-level.lv3 { background: #fdf3e2; color: #a8681c; }

.btn-danger {
  border-color: #f0c9c9;
  color: #b42323;
  background: #fff7f7;
}

.btn-danger:hover {
  border-color: #e5a8a8;
  color: #991b1b;
  background: #fdeeee;
}

.link-btn.danger { color: #b42323; }
.link-btn.danger:hover { background: #fdeeee; }

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(900px 420px at 20% -10%, rgba(27, 42, 74, .18), transparent 70%),
    linear-gradient(160deg, #f3f5f9 0%, #e8ecf4 100%);
}

.login-card {
  width: min(360px, 94vw);
  padding: 30px 30px 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .16);
}

.login-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(145deg, #24375d, var(--navy));
  box-shadow: 0 6px 14px rgba(27, 42, 74, .25);
  margin-bottom: 16px;
}

.login-card h2 {
  margin: 0;
  font-size: 19px;
  color: var(--navy);
  letter-spacing: .01em;
}

.login-sub {
  margin: 6px 0 20px;
  font-size: 11.5px;
  color: var(--muted);
}

.login-field {
  display: block;
  margin-bottom: 13px;
}

.login-field span {
  display: block;
  margin-bottom: 5px;
  font-size: 11.5px;
  color: #6b7689;
}

.login-field input {
  width: 100%;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  font-size: 13px;
  font-family: inherit;
  color: #2b3650;
  outline: none;
  transition: border-color .16s, box-shadow .16s;
}

.login-field input:focus {
  border-color: #9fb0cf;
  box-shadow: 0 0 0 3px rgba(27, 42, 74, .08);
}

.login-error {
  margin-bottom: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fdeeee;
  color: #b42323;
  font-size: 11.5px;
  line-height: 1.6;
}

.login-submit {
  width: 100%;
  height: 40px;
  justify-content: center;
  font-size: 13px;
}

.login-hint {
  margin: 14px 0 0;
  text-align: center;
  font-size: 11px;
  color: #9aa3b4;
}

/* ---------- 设置页新增块 ---------- */
.setting-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 2px;
  border-bottom: 1px dashed var(--line);
  flex-wrap: wrap;
}

.setting-row:last-child { border-bottom: none; }

.setting-row-name {
  flex: 1;
  min-width: 120px;
  font-size: 12.5px;
  color: #2b3650;
}

.settings-add-row {
  margin-top: 10px;
}

.settings-add-row input,
.settings-add-row select {
  height: 34px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-size: 12px;
  font-family: inherit;
  color: #2b3650;
  background: #fff;
  outline: none;
}

.settings-add-row input { flex: 1; min-width: 110px; }

.stage-textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-size: 12px;
  font-family: inherit;
  line-height: 1.7;
  color: #2b3650;
  resize: vertical;
  outline: none;
}

.scan-select {
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-size: 12px;
  font-family: inherit;
  color: #2b3650;
  background: #fff;
}

.request-scroll {
  max-height: 240px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.request-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
  white-space: nowrap;
}

.request-table th,
.request-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  color: #3c465c;
}

.request-table thead th {
  position: sticky;
  top: 0;
  background: #f6f8fb;
  color: #3d4a63;
  font-weight: 600;
  z-index: 1;
}

/* ---------- 文件访问审批 ---------- */
.file-tip {
  margin: 0 0 8px;
  padding: 7px 10px;
  border-radius: 8px;
  background: #fff8e8;
  border: 1px solid #f0dcae;
  font-size: 11.5px;
  line-height: 1.7;
  color: #8a6a1f;
}

.req-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 20px;
  font-size: 11px;
  line-height: 18px;
  white-space: nowrap;
}

.req-pending { background: #fdf1d8; color: #a5741a; }
.req-ok { background: #e6f6ec; color: #1f7a45; }
.req-reject { background: #fdeaea; color: #b23b3b; }
.req-auto { background: #eef1f7; color: #6b778c; }

.req-ops { white-space: nowrap; }
.req-ops .link-btn + .link-btn { margin-left: 8px; }
.req-by { font-size: 11px; color: #8b94a6; }

/* ---------- 计划看板：甘特图 -------------------------------- */
.plan-axis {
  border-top: none;
  padding-top: 3px;
  padding-bottom: 5px;
  align-items: end;
  background: var(--panel);
}

.axis-track {
  position: relative;
  height: 22px;
  border: 1px solid #e9edf4;
  border-radius: 6px;
  background: #f7f9fc;
  overflow: hidden;
}

.axis-months {
  display: flex;
  height: 100%;
}

.axis-month {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid #e6eaf2;
  font-size: 10px;
  color: #6b778c;
  white-space: nowrap;
  overflow: hidden;
}

.axis-month:last-child { border-right: none; }

.axis-today {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: #e05252;
}

.axis-today em {
  position: absolute;
  top: 3px;
  left: 3px;
  font-style: normal;
  font-size: 9px;
  line-height: 1;
  color: #cf4a4a;
  white-space: nowrap;
}

.gantt-track {
  background-color: #f6f8fc;
  background-image: repeating-linear-gradient(to right, #e9edf4 0 1px, transparent 1px var(--week, 10%));
}

.gantt-today {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 1px;
  background: rgba(224, 82, 82, .5);
  z-index: 1;
}

.gantt-ms {
  position: absolute;
  top: 50%;
  width: 7px;
  height: 7px;
  margin-left: -3.5px;
  transform: translateY(-50%) rotate(45deg);
  background: #c08a3e;
  box-shadow: 0 0 0 1px #fff;
  border-radius: 1px;
  z-index: 2;
}

/* ---------- 计划看板：实际完成 / 延期 ---------------------- */
.pc-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.pc-actual {
  color: #8a6d3b !important;
}

.delay-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 999px;
  background: #fdeceb;
  border: 1px solid #f3c6c2;
  color: #c0392b;
  font-size: 10px;
  line-height: 16px;
  white-space: nowrap;
}

/* ---------- 台账工具条 / 变更卡 ---------------------------- */
.insight-tools {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.insight-grid > .insight-card:nth-child(5) {
  grid-column: span 2;
}

input.is-late {
  color: #c0392b;
  font-weight: 600;
  background: #fff7f6;
}

/* ---------- 阶段门评审 / 交付物清单 ------------------------- */
.gate-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gate-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 10px;
  align-items: center;
  padding: 7px 10px;
  border: 1px solid #eef1f6;
  border-radius: 8px;
  background: #fbfcfe;
  text-align: left;
  cursor: pointer;
}

.gate-row:hover {
  border-color: #d9e2f2;
  background: #f6f9ff;
}

.gate-name {
  font-size: 12px;
  font-weight: 600;
  color: #253248;
}

.gate-meta {
  grid-column: 1 / -1;
  font-size: 10px;
  color: #8b94a6;
}

.deliv-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}

.deliv-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #5b6a85;
}

.deliv-head em {
  font-style: normal;
  font-weight: 500;
  color: #8b94a6;
}

.deliv-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 3px 0;
  font-size: 12px;
  color: #3a465c;
  cursor: pointer;
}

.deliv-row input {
  width: 14px;
  height: 14px;
  accent-color: #1f6fe5;
}

.deliv-row.is-done span {
  color: #8b94a6;
  text-decoration: line-through;
}

.insight-link {
  margin-left: auto;
  margin-right: 8px;
  padding: 2px 8px;
  border: 1px solid #dbe3ef;
  border-radius: 999px;
  background: #fff;
  color: #1f6fe5;
  font-size: 11px;
  cursor: pointer;
}

.insight-link:hover {
  background: #f2f7ff;
  border-color: #bcd3f5;
}

.deliv-name {
  flex: 1;
  cursor: pointer;
}

.deliv-name:hover {
  color: #1f6fe5;
}

.deliv-files {
  flex: none;
  font-style: normal;
  font-size: 10px;
  color: #b0b8c6;
}

.deliv-files.has {
  color: #1f8a4c;
}

.drawer-files {
  max-height: 150px;
  overflow-y: auto;
  border: 1px solid #eef1f6;
  border-radius: 8px;
  background: #fbfcfe;
  padding: 6px 10px;
}

.drawer-file {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 0;
  font-size: 11px;
  color: #3a465c;
}

.drawer-file em {
  font-style: normal;
  color: #98a1b2;
}

.foot-right {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.team-role {
  flex: none;
  min-width: 76px;
  padding: 2px 8px;
  border-radius: 6px;
  background: #eef4ff;
  color: #1f6fe5;
  font-size: 11px;
  text-align: center;
}


