:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #64708a;
  --line: #d9e0ea;
  --blue: #1769e0;
  --teal: #0f8b8d;
  --amber: #b46300;
  --red: #b42318;
  --green: #16703c;
  --shadow: 0 14px 34px rgba(23, 32, 51, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

.hidden {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #0f1b2d;
}

.login-panel {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  border: 1px solid #2e3d57;
  border-radius: 8px;
  padding: 28px;
  color: white;
  background: #162338;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.login-panel h1 {
  margin: 0;
  font-size: 24px;
}

.login-panel p {
  margin: 0 0 8px;
  color: #c8d3e6;
}

.login-panel label {
  color: #dfe7f5;
}

.form-message {
  min-height: 22px;
  color: #ffd7d2;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.app-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 36px;
  background: #0f1b2d;
  color: white;
}

.app-header h1 {
  margin: 0 0 8px;
  font-size: 28px;
  letter-spacing: 0;
}

.app-header p {
  margin: 0;
  color: #c8d3e6;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-shell {
  display: grid;
  gap: 18px;
  padding: 22px 36px 36px;
}

.sync-banner {
  min-height: 42px;
  display: flex;
  align-items: center;
  border: 1px solid #b8d6ff;
  border-radius: 8px;
  padding: 10px 14px;
  color: #164a8b;
  background: #eaf4ff;
}

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

.metric,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  min-height: 96px;
  padding: 18px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 14px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 34px;
}

.workspace {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.panel {
  padding: 18px;
}

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

.panel-title h2 {
  margin: 0;
  font-size: 18px;
}

form {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: #344058;
  font-size: 13px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #c7d0dc;
  border-radius: 6px;
  padding: 10px 11px;
  color: var(--ink);
  background: white;
}

textarea {
  resize: vertical;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.primary,
.secondary,
.danger {
  min-height: 38px;
  border-radius: 6px;
  padding: 0 14px;
  font-weight: 600;
}

.primary {
  background: var(--blue);
  color: white;
}

.secondary {
  background: #e6f1ff;
  color: #0b58bf;
}

.danger {
  background: #fde8e6;
  color: var(--red);
}

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  color: #344058;
  background: #edf2f7;
}

.chip.active {
  color: white;
  background: var(--blue);
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

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

th {
  color: #45536b;
  font-size: 13px;
  background: #f7f9fc;
}

td {
  font-size: 14px;
}

tr.selected-row td {
  background: #eef6ff;
}

.muted {
  color: var(--muted);
}

.status,
.risk-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 700;
}

.risk-low {
  color: var(--green);
  background: #e8f6ee;
}

.risk-medium {
  color: var(--amber);
  background: #fff2dc;
}

.risk-high {
  color: var(--red);
  background: #fde8e6;
}

.row-actions {
  display: flex;
  gap: 8px;
}

.icon-btn {
  min-height: 32px;
  border-radius: 6px;
  padding: 0 10px;
  color: #24324a;
  background: #edf2f7;
}

.detail-panel {
  min-height: 190px;
}

.empty-state {
  min-height: 150px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed #c7d0dc;
  border-radius: 8px;
}

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

.detail-header h2 {
  margin: 4px 0 6px;
}

.detail-header p,
.detail-grid p,
.timeline-block p {
  margin: 0;
  color: var(--muted);
}

.eyebrow {
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
}

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

.detail-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  min-height: 128px;
}

.detail-grid h3,
.timeline-block h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.detail-grid strong {
  display: block;
  margin-top: 10px;
}

.timeline-block {
  margin-top: 14px;
  border-left: 4px solid var(--blue);
  padding: 12px 14px;
  background: #f7f9fc;
}

a {
  color: var(--blue);
}

@media (max-width: 980px) {
  .app-header,
  .workspace,
  .detail-header {
    grid-template-columns: 1fr;
  }

  .app-header {
    display: grid;
    padding: 22px;
  }

  .app-shell {
    padding: 18px;
  }

  .summary-grid,
  .workspace,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .header-actions {
    justify-content: start;
  }
}

@media (max-width: 560px) {
  .two-col {
    grid-template-columns: 1fr;
  }

  .panel-title {
    align-items: start;
    flex-direction: column;
  }
}
