:root {
  --page: #f5f7fa;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --sidebar: #14202b;
  --sidebar-active: #203041;
  --border: #dce4ed;
  --border-soft: #edf2f7;
  --text: #1b2733;
  --muted: #687685;
  --primary: #0f766e;
  --blue: #2563c7;
  --blue-soft: #eaf1ff;
  --green: #15803d;
  --green-soft: #eaf7ee;
  --amber: #ad6300;
  --amber-soft: #fff3db;
  --red: #b4232a;
  --red-soft: #fff0f1;
  --shadow: 0 10px 26px rgba(18, 31, 48, 0.07);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-size: 14px;
  letter-spacing: 0;
}

button, input {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none !important;
  text-decoration-line: none !important;
}

h1, h2, h3, p {
  margin: 0;
}

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

.sidebar {
  background: var(--sidebar);
  color: #cbd7e3;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 22px;
}

.brand {
  height: 48px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 760;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #ffffff url("assets/yuanfeng-logo.png") center / 78% auto no-repeat;
  display: block;
  color: transparent;
  font-size: 0;
  box-shadow: none;
}

.workspace {
  margin: 4px 10px 18px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.06);
}

.workspace-name {
  color: #fff;
  font-weight: 720;
}

.workspace-meta {
  margin-top: 4px;
  color: #8fa0b2;
  font-size: 12px;
}

.nav-group {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-title {
  padding: 8px 10px;
  color: #8fa0b2;
  font-size: 12px;
}

.nav-item {
  position: relative;
  height: 48px;
  min-height: 48px;
  padding: 0 12px;
  border-radius: 7px;
  color: #cbd7e3;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 48px;
  font-size: 15px;
  font-weight: 500;
  line-height: 20px;
  border-left: 2px solid transparent;
  text-decoration: none !important;
  text-decoration-line: none !important;
  transition: background-color 160ms ease-out, color 160ms ease-out, border-color 160ms ease-out;
}

.nav-item *,
.nav-item:visited,
.nav-item:hover,
.nav-item:focus,
.nav-item:active {
  text-decoration: none !important;
  text-decoration-line: none !important;
}

.nav-item.active {
  background: var(--sidebar-active);
  color: #fff;
  border-left-color: #35b779;
  box-shadow: none;
}

.sidebar-footer {
  padding: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #8fa0b2;
  font-size: 12px;
  line-height: 1.6;
}

.main {
  min-width: 0;
}

.topbar {
  min-height: 68px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 24px;
  position: sticky;
  top: 0;
  z-index: 3;
}

.mobile-nav-toggle,
.mobile-nav-backdrop {
  display: none;
}

h1 {
  font-size: 20px;
  line-height: 1.25;
  font-weight: 760;
}

.crumb {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

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

.control, .btn, .input {
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.control, .btn {
  padding: 0 12px;
}

.input {
  justify-content: flex-start;
  min-width: 230px;
  padding: 0 11px;
  color: var(--muted);
}

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

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #e7edf4;
  color: #455567;
  display: grid;
  place-items: center;
  font-weight: 760;
}

.content {
  padding: 20px 24px 30px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.compliance-guide {
  background: #f8fbff;
  border: 1px solid #cfe0f4;
  border-radius: 10px;
  padding: 16px 18px;
}

.compliance-guide-title {
  color: #183a60;
  font-size: 16px;
  font-weight: 760;
}

.compliance-guide-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 14px 0 10px;
  padding-left: 20px;
}

.compliance-guide-steps li {
  padding-left: 4px;
}

.compliance-guide-steps strong,
.compliance-guide-steps span {
  display: block;
}

.compliance-guide-steps span,
.compliance-guide-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.compliance-decision {
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--border-soft);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  background: var(--surface-soft);
}

.compliance-decision.high-risk { border-left-color: var(--danger); }
.compliance-decision.need-revision { border-left-color: #c88909; }

.compliance-decision-title {
  margin-bottom: 8px;
  font-weight: 760;
}

.compliance-decision-copy {
  margin: 6px 0 0;
  color: var(--text);
  line-height: 1.65;
}

.review-strip {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 14px 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
}

.review-main {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.review-title {
  font-weight: 760;
}

.review-meta {
  color: var(--muted);
  font-size: 12px;
}

.pill {
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  line-height: 22px;
  font-size: 12px;
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.pill.green {
  background: var(--green-soft);
  color: var(--green);
}

.pill.blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.pill.amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.pill.red {
  background: var(--red-soft);
  color: var(--red);
}

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

.kpi {
  min-height: 118px;
  padding: 15px 16px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.kpi-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.kpi-value {
  margin-top: 12px;
  font-size: 28px;
  line-height: 1.1;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.kpi-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.75fr);
  gap: 16px;
  align-items: start;
}

.layout > :only-child,
.secondary-grid > :only-child {
  grid-column: 1 / -1;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-head {
  min-height: 58px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-title {
  font-size: 15px;
  font-weight: 760;
}

.panel-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
  white-space: nowrap;
}

th {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

td {
  font-size: 13px;
}

tr:last-child td {
  border-bottom: 0;
}

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

.mark {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background: #eef3f7;
  color: #536273;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.name {
  font-weight: 760;
}

.muted {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
  line-height: 1.55;
}

.side-stack, .list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.row-list, .check-list {
  display: flex;
  flex-direction: column;
}

.row-item, .check {
  padding: 13px 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--border-soft);
}

.check {
  grid-template-columns: 8px minmax(0, 1fr) auto;
}

.row-item:last-child, .check:last-child {
  border-bottom: 0;
}

.row-title, .item-title {
  font-weight: 760;
  line-height: 1.35;
}

.line {
  width: 8px;
  height: 42px;
  border-radius: 999px;
  background: var(--green);
}

.svg-icon {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

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

  .layout {
    grid-template-columns: 1fr;
  }
}

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

  .sidebar {
    position: fixed;
    z-index: 20;
    inset: 0 auto 0 0;
    width: min(292px, calc(100vw - 42px));
    min-height: 100dvh;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 180ms ease-out;
    box-shadow: 16px 0 30px rgba(18, 31, 48, 0.2);
  }

  body.mobile-nav-open .sidebar {
    transform: translateX(0);
  }

  .mobile-nav-backdrop {
    display: none;
    position: fixed;
    z-index: 19;
    inset: 0;
    border: 0;
    background: rgba(18, 31, 48, 0.4);
  }

  body.mobile-nav-open .mobile-nav-backdrop {
    display: block;
  }

  .mobile-nav-toggle {
    width: 36px;
    height: 36px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
  }

  .mobile-nav-toggle span {
    width: 18px;
    height: 2px;
    background: var(--text);
    display: block;
  }

  body.mobile-nav-open {
    overflow: hidden;
  }

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

  .actions, .panel-tools {
    justify-content: flex-start;
  }

  .content {
    padding: 14px;
  }

  .review-strip {
    grid-template-columns: 1fr;
  }

  .compliance-guide-steps {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .panel {
    overflow-x: auto;
  }
}
