:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --text: #172033;
  --muted: #64748b;
  --line: #e2e8f0;
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --green: #16a34a;
  --amber: #d97706;
  --red: #dc2626;
  --purple: #7c3aed;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  color: var(--text);
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.14), transparent 34rem),
    linear-gradient(180deg, #eef4ff 0%, var(--bg) 42%);
}

button,
input,
select {
  font: inherit;
}

.shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 22px;
  background: #0f172a;
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

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

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, #38bdf8, #2563eb);
  font-size: 22px;
  font-weight: 800;
}

.brand strong {
  display: block;
  font-size: 18px;
}

.brand small,
.side-card small {
  color: #94a3b8;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav a {
  color: #cbd5e1;
  text-decoration: none;
  padding: 12px 14px;
  border-radius: 12px;
}

.nav a:hover,
.nav a.active {
  color: #ffffff;
  background: rgba(148, 163, 184, 0.18);
}

.side-card {
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.65);
}

.side-card span,
.side-card strong,
.side-card small {
  display: block;
}

.side-card strong {
  margin: 8px 0;
  line-height: 1.5;
}

.main {
  padding: 30px;
  display: grid;
  gap: 22px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: stretch;
  padding: 28px;
  border-radius: 28px;
  background: linear-gradient(135deg, #ffffff, #eaf2ff);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: -0.04em;
}

h2 {
  margin-bottom: 4px;
  font-size: 20px;
}

.hero-desc,
.panel-title p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.7;
}

.date-panel {
  min-width: 220px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(37, 99, 235, 0.12);
}

.date-panel label,
.date-panel small {
  display: block;
  color: var(--muted);
}

.date-panel input {
  width: 100%;
  margin: 8px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  color: var(--text);
  background: #ffffff;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.kpi,
.panel {
  border: 1px solid rgba(226, 232, 240, 0.82);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.kpi {
  padding: 20px;
}

.kpi span,
.kpi small {
  color: var(--muted);
}

.kpi strong {
  display: block;
  margin: 8px 0 2px;
  font-size: 36px;
  letter-spacing: -0.04em;
}

.kpi.risk strong {
  color: var(--red);
}

.kpi.complete strong {
  color: var(--green);
}

.grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 16px;
}

.panel {
  padding: 22px;
  overflow: hidden;
}

.panel-title {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.panel-title > span {
  color: var(--muted);
  white-space: nowrap;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.bars {
  display: grid;
  gap: 13px;
}

.bar-row {
  display: grid;
  grid-template-columns: 110px 1fr 42px;
  gap: 12px;
  align-items: center;
}

.bar-label {
  color: var(--text);
  font-weight: 700;
}

.bar-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef8;
}

.bar-fill {
  height: 100%;
  min-width: 4px;
  border-radius: inherit;
  background: linear-gradient(90deg, #38bdf8, #2563eb);
}

.bar-count {
  color: var(--muted);
  text-align: right;
}

.milestones {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.milestones li {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  background: var(--panel-soft);
}

.milestones time {
  color: var(--primary-dark);
  font-weight: 800;
}

.milestones span {
  color: var(--muted);
  line-height: 1.5;
}

.filters {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 180px 160px;
  gap: 12px;
  margin-bottom: 16px;
}

.filters input,
.filters select {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 13px;
  background: #ffffff;
  color: var(--text);
}

.ghost-btn {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 14px;
  color: var(--primary-dark);
  background: #ffffff;
  cursor: pointer;
}

.ghost-btn:hover {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.table-wrap {
  max-height: 620px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
  background: #ffffff;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #334155;
  background: #f8fafc;
  font-size: 13px;
}

td {
  color: #334155;
  line-height: 1.45;
}

.task-name {
  color: var(--text);
  font-weight: 700;
}

.row-completed {
  background: #f0fdf4;
}

.row-completed .task-name {
  color: #166534;
}

.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.tag.active {
  color: #166534;
  background: #dcfce7;
}

.tag.pending {
  color: #1e40af;
  background: #dbeafe;
}

.tag.due {
  color: #991b1b;
  background: #fee2e2;
}

.tag.milestone {
  color: #6d28d9;
  background: #ede9fe;
}

.tag.complete {
  color: #166534;
  background: #dcfce7;
}

.task-action-btn {
  border: none;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}

.task-action-btn:hover {
  transform: translateY(-1px);
}

.task-action-btn.primary {
  color: #ffffff;
  background: linear-gradient(90deg, #2563eb, #1d4ed8);
}

.task-action-btn.secondary {
  color: #166534;
  background: #dcfce7;
}

.gantt {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
}

.gantt-inner {
  min-width: 980px;
  padding: 14px;
}

.gantt-axis,
.gantt-row {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
  align-items: center;
}

.gantt-axis {
  position: sticky;
  top: 0;
  z-index: 2;
  padding-bottom: 10px;
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
}

.axis-track {
  position: relative;
  height: 28px;
  border-bottom: 1px solid var(--line);
}

.tick {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  color: var(--muted);
  white-space: nowrap;
}

.gantt-row {
  min-height: 38px;
  border-bottom: 1px solid #eef2f7;
}

.gantt-label {
  min-width: 0;
  color: #334155;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gantt-track {
  position: relative;
  height: 18px;
  border-radius: 999px;
  background: repeating-linear-gradient(
    90deg,
    #f8fafc 0,
    #f8fafc 22px,
    #f1f5f9 22px,
    #f1f5f9 23px
  );
}

.gantt-bar {
  position: absolute;
  top: 2px;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, #60a5fa, #2563eb);
}

.gantt-bar.milestone {
  width: 14px !important;
  border-radius: 50%;
  background: var(--purple);
}

.gantt-bar.complete {
  background: linear-gradient(90deg, #4ade80, #16a34a);
}

.gantt-bar.milestone.complete {
  background: #16a34a;
}

.today-line {
  position: absolute;
  top: -6px;
  bottom: -6px;
  width: 2px;
  background: var(--red);
}

.issue-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.issue-grid article {
  padding: 18px;
  border-radius: 18px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
}

.issue-grid strong,
.issue-grid span {
  display: block;
}

.issue-grid span {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.6;
}

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

  .sidebar {
    position: static;
    height: auto;
  }

  .nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .side-card {
    margin-top: 0;
  }

  .kpis,
  .grid,
  .issue-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .main,
  .sidebar {
    padding: 18px;
  }

  .hero,
  .panel-title {
    flex-direction: column;
  }

  .kpis,
  .grid,
  .issue-grid,
  .filters,
  .nav {
    grid-template-columns: 1fr;
  }

  .date-panel {
    width: 100%;
  }
}
