.mp-module {
  --mp-border: #dbe4d9;
  --mp-muted: #57675b;
  --mp-green: #315d44;
  --mp-soft: #f1f5ee;
  container-type: inline-size;
  margin-top: 14px;
  min-width: 0;
}

.mp-module .mp-toolbar,
.mp-module .mp-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.mp-module .mp-toolbar {
  justify-content: space-between;
  margin-bottom: 14px;
}

.mp-module .mp-muted {
  color: var(--mp-muted);
  line-height: 1.55;
}

.mp-module .mp-toolbar > p { margin: 0; }
.mp-module .mp-message { margin: 0 0 14px; color: var(--mp-green); }
.mp-module .mp-message:empty { display: none; }
.mp-module .mp-error { color: #8a2929; }
.mp-module :is(.mp-warning, .mp-verified) {
  margin: 10px 0;
  padding: 9px 12px;
  border-radius: 7px;
  line-height: 1.55;
}
.mp-module .mp-warning { background: #fff4df; color: #694817; }
.mp-module .mp-verified { background: #eaf4eb; color: #295138; }

.mp-module .mp-layout {
  display: grid;
  grid-template-columns: minmax(10rem, 14rem) minmax(0, 1fr);
  align-items: start;
  gap: 16px;
}

.mp-module .mp-empty { grid-column: 1 / -1; margin: 10px 0; }
.mp-module .mp-directory,
.mp-module .mp-panel {
  min-width: 0;
  border: 1px solid var(--mp-border);
  border-radius: 10px;
  background: #fff;
}

.mp-module .mp-directory { background: var(--mp-soft); }
.mp-module .mp-directory-list {
  max-height: 62vh;
  overflow-y: auto;
  padding: 7px;
}

.mp-module .mp-module-option {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  width: 100%;
  min-height: 41px;
  margin: 0;
  border: 1px solid transparent;
  background: transparent;
  color: #38493e;
  text-align: left;
}

.mp-module .mp-module-option span { overflow-wrap: anywhere; }
.mp-module .mp-module-option small { color: var(--mp-muted); white-space: nowrap; }
.mp-module .mp-module-option:hover { background: #e8efe5; }
.mp-module .mp-module-option[aria-current] {
  border-color: #b9cbbb;
  background: #deeadf;
  color: #234832;
  font-weight: 650;
}

.mp-module .mp-mobile-picker { display: none; }
.mp-module .mp-panel { padding: 18px 20px; overflow-wrap: anywhere; }
.mp-module .mp-panel h2 { margin: 0 0 12px; color: #234832; font-size: 22px; }
.mp-module .mp-panel h3 { margin: 0 0 10px; font-size: 16px; }
.mp-module .mp-meta {
  display: grid;
  grid-template-columns: minmax(6rem, .7fr) minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 10px;
  margin: 0 0 12px;
  padding: 10px;
  border-radius: 7px;
  background: #f4f7f1;
}

.mp-module .mp-meta > div { min-width: 0; }
.mp-module .mp-meta dt { color: var(--mp-muted); font-size: 12px; }
.mp-module .mp-meta dd { margin: 4px 0 0; font-weight: 600; }
.mp-module .mp-pages { margin-bottom: 15px; }
.mp-module :is(.mp-pages, .mp-history, .mp-dependencies, .mp-receipt, .mp-conflicts, .mp-rollback-history) > summary {
  width: fit-content;
  color: var(--mp-green);
  cursor: pointer;
  font-weight: 650;
}

.mp-module .mp-pages ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 21px;
  margin: 8px 0 0;
  padding-left: 20px;
  color: var(--mp-muted);
}

.mp-module .mp-actions { margin: 10px 0 0; }
.mp-module :is(.mp-toolbar, .mp-actions, .mp-release) button { margin: 0; }
.mp-module .mp-preview-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid #829f89;
  border-radius: 7px;
  color: #244b34;
  background: #f0f6ef;
  text-decoration: none;
  font-weight: 650;
}
.mp-module .mp-preview-link[href]:hover { background: #e2efe1; }
.mp-module .mp-preview-link:not([href]) { opacity: .55; }
.mp-module .mp-primary {
  border-color: var(--mp-green);
  background: var(--mp-green);
  color: #fff;
  font-weight: 650;
}

.mp-module .mp-primary:hover { background: #264d37; }
.mp-module :is(button, select, a, summary):focus-visible {
  outline: 2px solid #438457;
  outline-offset: 2px;
}

.mp-module :is(.mp-section, .mp-history, .mp-dependencies) {
  margin-top: 16px;
  padding-top: 15px;
  border-top: 1px solid var(--mp-border);
}

.mp-module .mp-fact { margin: 10px 0; }
.mp-module .mp-fact > ul {
  margin: 4px 0 0;
  padding-left: 19px;
  color: var(--mp-muted);
  line-height: 1.55;
}
.mp-module .mp-evidence {
  display: block;
  color: var(--mp-muted);
  font-size: 12px;
}
.mp-module .mp-dependencies h3 { margin: 12px 0 6px; }
.mp-module :is(.mp-downstream, .mp-conflict-list) {
  display: grid;
  gap: 6px;
  margin: 7px 0 0;
  padding: 0;
  list-style: none;
}
.mp-module :is(.mp-downstream-item, .mp-conflict-list > li) {
  display: grid;
  gap: 3px;
  padding: 8px 10px;
  border: 1px solid var(--mp-border);
  border-radius: 7px;
}
.mp-module .mp-fact-heading {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 12px;
}
.mp-module .mp-conflicts { margin: 10px 0; }
.mp-module .mp-rollback-history { margin-top: 14px; }
.mp-module .mp-rule-comparison {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.mp-module .mp-rule-column {
  padding: 8px 10px;
  border: 1px solid var(--mp-border);
  border-radius: 7px;
}
.mp-module .mp-rule-column h4 { margin: 0 0 5px; }
.mp-module .mp-rule-column p { margin: 0; }
.mp-module .mp-rule-column ol { margin: 0; padding-left: 20px; }
.mp-module .mp-rule-column li + li { margin-top: 5px; }
.mp-module .mp-receipt {
  grid-column: 1 / -1;
  margin: 4px 0;
  padding: 7px 10px;
  border-radius: 7px;
  background: #f4f7f1;
}

.mp-module .mp-draft-select {
  display: flex;
  align-items: baseline;
  gap: 10px;
  max-width: 100%;
  margin: 8px 0;
}

.mp-module :is(.mp-draft-select, .mp-mobile-picker) select {
  width: auto;
  max-width: 100%;
  min-width: 0;
  margin: 0;
}

.mp-module .mp-config { margin: 0 0 12px; }
.mp-module .mp-config-row,
.mp-module .mp-config-heading {
  display: grid;
  grid-template-columns: minmax(5rem, .75fr) repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 7px 9px;
  border-bottom: 1px solid #e8eee6;
}

.mp-module .mp-config-row:not(:has(.mp-config-incoming)) {
  grid-template-columns: minmax(5rem, .75fr) minmax(0, 2fr);
}

.mp-module .mp-config-heading {
  background: #eef4eb;
  color: #32563e;
  font-weight: 650;
}

.mp-module .mp-config-row dt { color: #3b5242; font-weight: 600; }
.mp-module .mp-config-row dd { margin: 0; min-width: 0; }
.mp-module .mp-config-row.mp-changed { background: #f4f8ef; }
.mp-module .mp-change-label {
  display: inline-block;
  margin-left: 6px;
  color: #315d44;
  font-size: 12px;
  font-weight: 650;
}

.mp-module .mp-previews {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mp-module .mp-sample {
  --mp-accent: #668675;
  --mp-sample-pad: 7px;
  min-width: 0;
  border: 1px solid var(--mp-border);
  border-radius: 8px;
  padding: 10px;
  background: #fafbf8;
}

.mp-module .mp-sample[data-accent="green"] { --mp-accent: #388157; }
.mp-module .mp-sample[data-accent="blue"] { --mp-accent: #376899; }
.mp-module .mp-sample[data-accent="amber"] { --mp-accent: #996314; }
.mp-module .mp-sample[data-density="compact"] { --mp-sample-pad: 4px; }
.mp-module .mp-sample[data-density="comfortable"] { --mp-sample-pad: 11px; }
.mp-module .mp-sample-label { color: var(--mp-muted); font-size: 12px; }
.mp-module .mp-sample-title {
  margin: 6px 0 9px;
  padding: var(--mp-sample-pad) 8px;
  border-left: 3px solid var(--mp-accent);
  background: #fff;
}

.mp-module .mp-sample-title h4 { margin: 0; color: #264332; }
.mp-module .mp-sample-title p { margin: 5px 0 0; color: var(--mp-muted); line-height: 1.5; }
.mp-module .mp-sample-content { display: grid; gap: var(--mp-sample-pad); }
.mp-module .mp-sample-table-wrap { min-width: 0; }
.mp-module .mp-sample-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  background: #fff;
  font-size: 12px;
}

.mp-module .mp-sample-table :is(th, td) {
  padding: var(--mp-sample-pad) 5px;
  border-bottom: 1px solid var(--mp-border);
  text-align: left;
  white-space: normal;
}

.mp-module .mp-sample-table th { background: #eef3ed; color: #344f3d; }
.mp-module .mp-sample[data-table-layout="sticky-header"] .mp-sample-table-wrap {
  max-height: 86px;
  overflow: auto;
}

.mp-module .mp-sample[data-table-layout="sticky-header"] .mp-sample-table th {
  position: sticky;
  top: 0;
}

.mp-module .mp-sample-chart {
  margin: 0;
  padding: var(--mp-sample-pad) 7px;
  background: #fff;
  font-size: 12px;
}

.mp-module .mp-sample-chart figcaption { margin: 0 0 5px; color: var(--mp-muted); }
.mp-module .mp-chart-row {
  display: grid;
  align-items: center;
  grid-template-columns: 3.2em minmax(0, 1fr) 2em;
  gap: 6px;
  min-height: 20px;
}

.mp-module .mp-chart-bar { width: 100%; height: 7px; border-radius: 2px; background: var(--mp-accent); }
.mp-module .mp-chart-row:last-child .mp-chart-bar { width: 66%; opacity: .75; }
.mp-module .mp-sample[data-chart-layout="expanded"] .mp-chart-row { min-height: 32px; }
.mp-module .mp-sample[data-chart-layout="expanded"] .mp-chart-bar { height: 13px; }

.mp-module .mp-releases { margin: 8px 0 0; padding-left: 0; list-style: none; }
.mp-module .mp-release {
  display: grid;
  grid-template-columns: minmax(5.5rem, .7fr) minmax(0, 1.3fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 5px 0;
  border-bottom: 1px solid #e8eee6;
}

.mp-module .mp-release > button { grid-column: 3; }
.mp-module .mp-dialog {
  width: min(calc(100% - 26px), 34rem);
  max-height: min(82vh, 42rem);
  padding: 20px;
  border: 1px solid var(--mp-border);
  border-radius: 10px;
  background: #fff;
}

.mp-module .mp-dialog::backdrop { background: #15281db0; }
.mp-module .mp-dialog h3 { margin: 0 0 10px; color: #264332; }
.mp-module .mp-dialog-text { color: var(--mp-muted); line-height: 1.55; }
.mp-module .mp-dialog .mp-actions { justify-content: flex-end; }
.mp-module .mp-owners {
  max-height: 43vh;
  min-width: 0;
  margin: 14px 0;
  padding: 8px;
  overflow: auto;
}

.mp-module .mp-owners label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px;
  margin: 0;
}

.mp-module .mp-owners input[type="checkbox"] { width: auto; flex: none; margin: 0; }

@container (max-width: 720px) {
  .mp-module .mp-layout { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .mp-module .mp-directory-list { display: none; }
  .mp-module .mp-mobile-picker { display: grid; gap: 5px; padding: 8px; margin: 0; }
  .mp-module .mp-panel { padding: 14px; }
}

@container (max-width: 440px) {
  .mp-module :is(.mp-previews, .mp-meta, .mp-rule-comparison) { grid-template-columns: minmax(0, 1fr); }
  .mp-module .mp-meta > div { display: grid; grid-template-columns: 5em minmax(0, 1fr); align-items: baseline; }
  .mp-module .mp-meta dd { margin: 0; }
  .mp-module .mp-config-heading { display: none; }
  .mp-module .mp-config-row:has(.mp-config-incoming) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mp-module .mp-config-row:has(.mp-config-incoming) dt { grid-column: 1 / -1; }
  .mp-module .mp-config-current::before,
  .mp-module .mp-config-incoming::before { display: block; color: var(--mp-muted); font-size: 12px; }
  .mp-module .mp-config-current::before { content: "当前值"; }
  .mp-module .mp-config-incoming::before { content: "候选值"; }
  .mp-module .mp-draft-select { display: grid; gap: 5px; }
  .mp-module .mp-draft-select select { width: 100%; }
  .mp-module .mp-release { grid-template-columns: minmax(0, 1fr); gap: 5px; }
  .mp-module .mp-release > button { grid-column: 1; justify-self: start; }
}
