:root {
  color-scheme: light;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #eef1f5;
  color: #1a2333;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(63, 111, 255, 0.12), transparent 32%),
    linear-gradient(180deg, #f7f9fc 0%, #edf2f8 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

pre {
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  line-height: 1.55;
}

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

.preview-sidebar {
  padding: 28px 20px;
  border-right: 1px solid rgba(20, 36, 60, 0.08);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(12px);
}

.preview-brand {
  display: grid;
  gap: 6px;
  margin-bottom: 24px;
}

.preview-brand strong {
  font-size: 20px;
}

.preview-brand span {
  color: #5f6c80;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

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

.preview-nav a {
  padding: 10px 12px;
  border-radius: 12px;
  color: #445066;
  transition: 160ms ease;
}

.preview-nav a:hover,
.preview-nav a.active {
  background: #15294f;
  color: #fff;
}

.preview-main {
  padding: 32px;
}

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

.preview-header h1 {
  margin: 0 0 8px;
  font-size: 32px;
  line-height: 1.05;
}

.preview-header p {
  margin: 0;
  max-width: 860px;
  color: #60708a;
}

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

.preview-badges span {
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(31, 51, 84, 0.08);
  color: #32415c;
  font-size: 12px;
  font-weight: 600;
}

.preview-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.info-card,
.preview-section {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(31, 51, 84, 0.08);
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(26, 40, 68, 0.06);
}

.info-card {
  display: grid;
  gap: 8px;
  padding: 18px;
}

.info-card span {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #627089;
}

.info-card strong {
  font-size: 16px;
  word-break: break-word;
}

.preview-sections {
  display: grid;
  gap: 16px;
}

.preview-section {
  padding: 20px;
}

.preview-section h2 {
  margin: 0 0 14px;
  font-size: 17px;
}

.live-page-frame {
  overflow: hidden;
  border-radius: 16px;
}

.recovery-live-page {
  display: grid;
  gap: 16px;
  color: #152033;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid rgba(31, 51, 84, 0.08);
  border-radius: 18px;
  padding: 20px;
}

.recovery-live-hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.recovery-live-hero h2 {
  margin: 6px 0 8px;
  font-size: 28px;
}

.recovery-live-hero p {
  margin: 0;
  color: #627089;
}

.eyebrow {
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #7c8ba3;
}

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

.hero-stats div {
  min-width: 96px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f3f7fc;
  border: 1px solid rgba(31, 51, 84, 0.08);
}

.hero-stats strong {
  display: block;
  font-size: 22px;
}

.hero-stats span {
  color: #65738a;
  font-size: 12px;
}

.recovery-toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.recovery-search {
  display: flex;
  gap: 10px;
  flex: 1 1 320px;
}

.recovery-search input,
.recovery-toolbar select,
.modal-grid input,
.modal-grid select,
.modal-grid textarea {
  width: 100%;
  border: 1px solid rgba(31, 51, 84, 0.16);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  color: #152033;
  font: inherit;
}

.recovery-toolbar button,
.modal-actions button,
.action-row button {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  background: #15294f;
  color: #fff;
  font: inherit;
  cursor: pointer;
}

.recovery-toolbar button.secondary,
.modal-actions button.secondary,
.action-row button.secondary {
  background: #e8eef7;
  color: #152033;
}

.action-row button.danger,
.modal-actions button.danger {
  background: #c33131;
}

.toast {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid transparent;
}

.toast-info {
  background: #eef4ff;
  border-color: rgba(48, 91, 192, 0.15);
}

.toast-error {
  background: #fff0f0;
  border-color: rgba(198, 52, 52, 0.15);
}

.recovery-table-card {
  display: grid;
  gap: 12px;
  background: #fff;
  border: 1px solid rgba(31, 51, 84, 0.08);
  border-radius: 18px;
  padding: 16px;
}

.table-scroll {
  overflow: auto;
}

.recovery-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1020px;
}

.recovery-table th,
.recovery-table td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(31, 51, 84, 0.08);
  text-align: left;
  vertical-align: top;
}

.recovery-table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #718096;
}

.empty-cell {
  text-align: center;
  color: #738095;
  padding: 36px 10px;
}

.cell-stack {
  display: grid;
  gap: 4px;
}

.muted {
  color: #70809b;
  font-size: 12px;
}

.chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.chip-ok {
  background: #e6f8ef;
  color: #15803d;
}

.chip-warn {
  background: #fff4db;
  color: #a16207;
}

.chip-danger {
  background: #ffe6e6;
  color: #b42318;
}

.chip-soft {
  background: #eef3fb;
  color: #35507b;
}

.chip-soft {
  background: #eef3fb;
  color: #35507b;
}

.chip-soft {
  background: #eef3fb;
  color: #35507b;
}

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

.link-button {
  background: transparent;
  border: 0;
  padding: 0;
  color: #3156c8;
  cursor: pointer;
  font: inherit;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.pagination-bar button {
  border: 0;
  border-radius: 10px;
  padding: 8px 12px;
  background: #e8eef7;
  color: #152033;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.56);
  padding: 20px;
  z-index: 20;
}

.modal-panel {
  width: min(900px, 100%);
  max-height: min(88vh, 920px);
  overflow: auto;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.28);
  padding: 18px;
}

.modal-panel-wide {
  width: min(1100px, 100%);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.modal-header h3 {
  margin: 0;
}

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

.modal-grid label {
  display: grid;
  gap: 8px;
}

.modal-grid label span {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #718096;
}

.modal-grid textarea {
  min-height: 140px;
  resize: vertical;
}

.span-2 {
  grid-column: span 2;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.detail-json {
  margin: 0;
  padding: 16px;
  border-radius: 16px;
  background: #0f172a;
  color: #d6e0f0;
  overflow: auto;
  max-height: 58vh;
  white-space: pre-wrap;
}

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

  .preview-sidebar {
    border-right: 0;
    border-bottom: 1px solid rgba(20, 36, 60, 0.08);
  }

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

@media (max-width: 640px) {
  .preview-main {
    padding: 20px;
  }

  .preview-header {
    flex-direction: column;
  }

  .preview-card-grid {
    grid-template-columns: 1fr;
  }

  .recovery-live-hero,
  .recovery-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

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

  .span-2 {
    grid-column: span 1;
  }
}
