:root {
  --bg: #f2f6f8;
  --card: #ffffff;
  --ink: #0f2a40;
  --ink-2: #334e68;
  --muted: #6b7f92;
  --line: #dfe8ee;
  --line-strong: #c8d7e0;
  --primary: #1f6f8b;
  --primary-dark: #15576e;
  --primary-soft: #e7f3f6;
  --jade: #0f766e;
  --success: #157347;
  --success-bg: #e9f6ef;
  --danger: #b42318;
  --danger-bg: #fdeceb;
  --warn: #b45309;
  --warn-bg: #fdf3e4;
  --shadow-sm: 0 1px 2px rgba(15, 42, 64, 0.05), 0 6px 18px rgba(15, 42, 64, 0.045);
  --shadow-md: 0 18px 44px rgba(15, 42, 64, 0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --font: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", system-ui, -apple-system, sans-serif;
  --mono: "SFMono-Regular", "Cascadia Code", "Consolas", monospace;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  background:
    radial-gradient(1100px 520px at 6% -12%, #e2f0f3 0%, rgba(226, 240, 243, 0) 62%),
    radial-gradient(900px 480px at 100% -6%, #e9eff7 0%, rgba(233, 239, 247, 0) 58%),
    var(--bg);
}

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

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

button {
  cursor: pointer;
}

svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 26px;
  height: 68px;
  padding: 0 30px;
  background: rgba(255, 255, 255, 0.84);
  border-bottom: 1px solid rgba(200, 215, 224, 0.7);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 210px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: #fff;
  border-radius: 12px;
  background: linear-gradient(145deg, #2a8aa5 0%, #15576e 72%);
  box-shadow: 0 6px 14px rgba(21, 87, 110, 0.24);
}

.brand-mark svg {
  width: 23px;
  height: 23px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.brand-text strong {
  font-size: 16px;
  letter-spacing: 0.02em;
}

.brand-text small {
  margin-top: 2px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.16em;
}

.tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(231, 240, 244, 0.78);
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  color: var(--ink-2);
  font-size: 13.5px;
  text-decoration: none;
  border-radius: 9px;
  transition: background 0.16s, color 0.16s, box-shadow 0.16s;
}

.tab svg {
  width: 16px;
  height: 16px;
  opacity: 0.75;
}

.tab:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
}

.tab.active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 1px 4px rgba(15, 42, 64, 0.09);
}

.tab.active svg {
  color: var(--primary);
  opacity: 1;
}

.tab-count {
  display: inline-grid;
  place-items: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  color: var(--primary-dark);
  font-family: var(--mono);
  font-size: 10.5px;
  background: var(--primary-soft);
  border-radius: 20px;
}

.api-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  height: 34px;
  padding: 0 13px;
  color: var(--ink-2);
  font-size: 12.5px;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.7);
  transition: border-color 0.16s, box-shadow 0.16s;
}

.api-status:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}

.api-status .dot {
  width: 7px;
  height: 7px;
  background: #a3b3bf;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(163, 179, 191, 0.16);
}

.api-status.ok .dot {
  background: #1a9b5c;
  box-shadow: 0 0 0 3px rgba(26, 155, 92, 0.14);
}

.api-status.warn .dot {
  background: #d97706;
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.15);
}

.shell {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px 30px 56px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--primary);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.17em;
}

.page-head h1 {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-sub {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13.5px;
}

.head-note {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
}

.head-note svg {
  width: 20px;
  height: 20px;
  color: var(--primary);
}

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

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

.input-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 90px;
}

.result-column {
  min-width: 0;
}

.card {
  padding: 21px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.card-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 16px;
}

.card-head h2 {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: 0.005em;
}

.card-head .muted {
  margin-left: auto;
  font-size: 11.5px;
  font-weight: 400;
}

.step {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  color: var(--primary);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  background: var(--primary-soft);
  border-radius: 8px;
}

.step svg {
  width: 15px;
  height: 15px;
}

.required-tag {
  margin-left: auto;
  padding: 1px 8px;
  color: var(--danger);
  font-size: 10px;
  border: 1px solid #f3cfcc;
  border-radius: 20px;
  background: #fff7f6;
}

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

.help-text {
  margin-top: 13px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.65;
}

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 18px 22px;
  text-align: center;
  border: 1.5px dashed #c5d7e0;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(239, 247, 249, 0.86), rgba(250, 252, 253, 0.9));
  outline: none;
  transition: border-color 0.18s, background 0.18s, transform 0.18s;
}

.dropzone:hover,
.dropzone:focus-visible,
.dropzone.dragging {
  border-color: var(--primary);
  background: linear-gradient(180deg, #e8f4f7, #f7fbfc);
}

.dropzone.dragging {
  transform: scale(1.005);
  box-shadow: inset 0 0 0 3px rgba(31, 111, 139, 0.08);
}

.drop-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 11px;
  color: var(--primary);
  border: 1px solid #cfe3ea;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 4px 10px rgba(31, 111, 139, 0.08);
}

.drop-icon svg {
  width: 22px;
  height: 22px;
}

.dropzone h3 {
  font-size: 14px;
  font-weight: 600;
}

.dropzone p {
  margin: 4px 0 12px;
  color: var(--muted);
  font-size: 11.5px;
}

.dropzone .btn {
  pointer-events: none;
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.file-list:empty {
  display: none;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdfe;
}

.file-thumb {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  overflow: hidden;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 7px;
}

.file-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-thumb svg {
  width: 18px;
  height: 18px;
}

.file-info {
  min-width: 0;
  flex: 1;
}

.file-name {
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-size {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.file-remove {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  color: var(--muted);
  border: 0;
  border-radius: 7px;
  background: transparent;
}

.file-remove:hover {
  color: var(--danger);
  background: var(--danger-bg);
}

.file-remove svg {
  width: 15px;
  height: 15px;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field-label {
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 600;
}

.field-label em {
  color: var(--danger);
  font-style: normal;
}

.optional {
  margin-left: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  height: 41px;
  padding: 0 12px;
  background: #fbfdfe;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  outline: none;
  transition: border-color 0.16s, box-shadow 0.16s, background 0.16s;
}

.field textarea {
  height: auto;
  min-height: 82px;
  padding: 10px 12px;
  line-height: 1.6;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #9bacb9;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31, 111, 139, 0.13);
}

.field input.invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.08);
}

.field-hint {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.5;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-note {
  padding: 9px 11px;
  color: #5c7183;
  font-size: 10.5px;
  line-height: 1.6;
  background: #f5f9fa;
  border-left: 2px solid #c7dde5;
  border-radius: 0 7px 7px 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 40px;
  padding: 0 16px;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s, border-color 0.15s;
}

.btn:hover {
  border-color: #aebfca;
  box-shadow: 0 4px 12px rgba(15, 42, 64, 0.07);
}

.btn:active {
  transform: translateY(1px);
}

.btn svg {
  width: 17px;
  height: 17px;
}

.btn-primary {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #2786a3 0%, #15576e 100%);
  box-shadow: 0 7px 18px rgba(21, 87, 110, 0.22);
}

.btn-primary:hover {
  border-color: transparent;
  background: linear-gradient(135deg, #2b91af 0%, #176077 100%);
  box-shadow: 0 9px 22px rgba(21, 87, 110, 0.27);
}

.btn-ghost {
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.8);
}

.btn-danger {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #c73a2e, #9f1f16);
}

.btn-block {
  width: 100%;
}

.btn-lg {
  height: 48px;
  font-size: 15px;
  border-radius: 12px;
}

.btn-sm {
  height: 33px;
  padding: 0 11px;
  font-size: 12px;
  border-radius: 8px;
}

.btn:disabled,
.btn.is-busy {
  cursor: wait;
  opacity: 0.68;
  transform: none;
}

.btn.is-busy::after {
  width: 13px;
  height: 13px;
  content: "";
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn-ghost.is-busy::after {
  border-color: rgba(31, 111, 139, 0.25);
  border-top-color: var(--primary);
}

.result-empty,
.loading-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 560px;
  padding: 48px 32px;
  text-align: center;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.empty-visual {
  position: relative;
  width: 210px;
  height: 176px;
  margin-bottom: 18px;
}

.paper {
  position: absolute;
  top: 12px;
  left: 50%;
  width: 118px;
  height: 148px;
  padding: 26px 16px;
  background: #fff;
  border: 1px solid #dce6ec;
  border-radius: 7px;
  box-shadow: 0 14px 30px rgba(15, 42, 64, 0.12);
  transform: translateX(-50%) rotate(-4deg);
}

.paper::before {
  position: absolute;
  top: 14px;
  left: 16px;
  width: 46px;
  height: 6px;
  content: "";
  background: #dbe8ee;
  border-radius: 4px;
}

.paper-line {
  display: block;
  height: 4px;
  margin-bottom: 8px;
  background: #edf2f5;
  border-radius: 4px;
}

.paper-line.w70 {
  width: 70%;
}

.paper-line.w90 {
  width: 90%;
}

.paper-line.w60 {
  width: 60%;
}

.paper-seal {
  position: absolute;
  right: 13px;
  bottom: 15px;
  width: 43px;
  height: 43px;
  border: 2.5px solid rgba(190, 45, 35, 0.62);
  border-radius: 50%;
}

.paper-seal::before {
  position: absolute;
  inset: 6px;
  content: "";
  border: 1px solid rgba(190, 45, 35, 0.42);
  border-radius: 50%;
}

.paper-seal::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 15px;
  height: 15px;
  content: "";
  background: rgba(190, 45, 35, 0.6);
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 56%, 79% 92%, 50% 70%, 21% 92%, 32% 56%, 2% 35%, 39% 35%);
  transform: translate(-50%, -50%);
}

.scan-line {
  position: absolute;
  top: 22px;
  left: 34px;
  width: 142px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #2a8aa5 18%, #7ec8d6 82%, transparent);
  box-shadow: 0 0 12px rgba(42, 138, 165, 0.7);
  animation: scan 3.4s ease-in-out infinite;
}

.spark {
  position: absolute;
  width: 6px;
  height: 6px;
  background: #b8dbe3;
  border-radius: 50%;
}

.sp1 {
  top: 36px;
  left: 22px;
}

.sp2 {
  top: 108px;
  right: 20px;
  width: 4px;
  height: 4px;
}

.sp3 {
  top: 18px;
  right: 38px;
  width: 3px;
  height: 3px;
}

.result-empty h2,
.loading-card h2 {
  font-size: 20px;
  font-weight: 650;
}

.result-empty > p {
  max-width: 380px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.empty-steps {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.empty-steps li {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #5f7486;
  font-size: 12px;
}

.empty-steps span {
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  color: var(--primary);
  font-family: var(--mono);
  font-size: 9.5px;
  background: var(--primary-soft);
  border-radius: 50%;
}

.loading-card {
  position: relative;
  overflow: hidden;
}

.loading-card::before {
  position: absolute;
  inset: 0;
  content: "";
  background: radial-gradient(420px 220px at 50% 20%, rgba(31, 111, 139, 0.07), transparent 70%);
  pointer-events: none;
}

.radar {
  position: relative;
  display: grid;
  place-items: center;
  width: 118px;
  height: 118px;
  margin-bottom: 22px;
}

.radar span {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(31, 111, 139, 0.25);
  border-radius: 50%;
  animation: radar 2.6s ease-out infinite;
}

.radar span:nth-child(2) {
  animation-delay: 1.3s;
}

.radar-core {
  width: 46px;
  height: 46px;
  background: linear-gradient(145deg, #2a8aa5, #15576e);
  border-radius: 50%;
  box-shadow: 0 0 0 9px rgba(31, 111, 139, 0.08), 0 10px 24px rgba(21, 87, 110, 0.25);
}

.radar-core::after {
  display: block;
  width: 20px;
  height: 20px;
  margin: 13px;
  content: "";
  border: 2px solid rgba(255, 255, 255, 0.88);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1.1s linear infinite;
}

.loading-text {
  margin-top: 6px;
  color: var(--ink-2);
  font-size: 13px;
}

.loading-track {
  width: 230px;
  height: 4px;
  margin-top: 20px;
  overflow: hidden;
  background: #e4eef2;
  border-radius: 4px;
}

.loading-track span {
  display: block;
  width: 42%;
  height: 100%;
  background: linear-gradient(90deg, #64b6c8, var(--primary));
  border-radius: 4px;
  animation: indeterminate 1.6s ease-in-out infinite;
}

.loading-hint {
  margin-top: 13px;
  color: var(--muted);
  font-size: 11px;
}

.result-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: rise 0.35s ease both;
}

.verdict-card {
  --v-color: var(--success);
  --v-bg: var(--success-bg);
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  overflow: hidden;
  padding: 24px;
  background:
    linear-gradient(120deg, var(--v-bg) 0%, rgba(255, 255, 255, 0.94) 68%),
    #fff;
  border: 1px solid color-mix(in srgb, var(--v-color) 24%, #fff);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
}

.verdict-card::after {
  position: absolute;
  top: -70px;
  right: -50px;
  width: 190px;
  height: 190px;
  content: "";
  border: 34px solid color-mix(in srgb, var(--v-color) 6%, transparent);
  border-radius: 50%;
  pointer-events: none;
}

.verdict-card.verdict-fail {
  --v-color: var(--danger);
  --v-bg: var(--danger-bg);
}

.verdict-card.verdict-review {
  --v-color: var(--warn);
  --v-bg: var(--warn-bg);
}

.verdict-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  color: #fff;
  background: var(--v-color);
  border-radius: 50%;
  box-shadow: 0 0 0 7px color-mix(in srgb, var(--v-color) 11%, transparent);
}

.verdict-icon svg {
  width: 26px;
  height: 26px;
}

.verdict-main .eyebrow {
  margin-bottom: 2px;
  color: var(--v-color);
}

.verdict-main h2 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.verdict-main > p:last-child {
  margin-top: 2px;
  color: #546a7c;
  font-size: 12.5px;
}

.verdict-stats {
  display: flex;
  gap: 0;
  padding-right: 6px;
}

.vstat {
  min-width: 64px;
  padding: 0 14px;
  text-align: center;
  border-left: 1px solid color-mix(in srgb, var(--v-color) 14%, transparent);
}

.vstat:first-child {
  border-left: 0;
}

.vstat b {
  display: block;
  color: var(--v-color);
  font-family: var(--mono);
  font-size: 23px;
  line-height: 1.2;
}

.vstat span {
  color: var(--muted);
  font-size: 10.5px;
}

.result-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 3px;
}

.result-meta {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.7;
}

.result-meta b {
  color: var(--ink-2);
  font-weight: 600;
}

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

.warning-box {
  padding: 11px 14px;
  color: var(--warn);
  font-size: 12px;
  background: var(--warn-bg);
  border: 1px solid #f2dcb8;
  border-radius: 11px;
}

.warning-box ul {
  margin: 0;
  padding-left: 17px;
}

.card .card-head + .rule-results {
  margin-top: -4px;
}

.rule-results {
  display: flex;
  flex-direction: column;
}

.rule-result {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  padding: 15px 2px;
  border-bottom: 1px solid #edf2f5;
}

.rule-result:first-child {
  padding-top: 4px;
}

.rule-result:last-child {
  padding-bottom: 2px;
  border-bottom: 0;
}

.rule-status-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-top: 1px;
  border-radius: 50%;
}

.rule-status-icon svg {
  width: 16px;
  height: 16px;
}

.rule-result.status-pass .rule-status-icon {
  color: var(--success);
  background: var(--success-bg);
}

.rule-result.status-fail .rule-status-icon {
  color: var(--danger);
  background: var(--danger-bg);
}

.rule-result.status-unknown .rule-status-icon {
  color: var(--warn);
  background: var(--warn-bg);
}

.rule-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.rule-title-row h3 {
  font-size: 14px;
  font-weight: 600;
}

.chip {
  display: inline-flex;
  align-items: center;
  height: 19px;
  padding: 0 7px;
  color: var(--muted);
  font-size: 9.5px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fafcfd;
}

.chip-required {
  color: #8a4b0f;
  border-color: #f0dcbf;
  background: #fdf8ef;
}

.chip-ai {
  color: var(--primary-dark);
  border-color: #cfe5ec;
  background: var(--primary-soft);
}

.chip-warn {
  color: var(--warn);
  border-color: #f0dcb8;
  background: var(--warn-bg);
}

.field-hint.is-warning {
  color: var(--warn);
}

.rule-reason {
  margin-top: 3px;
  color: #53697b;
  font-size: 12.5px;
  line-height: 1.6;
}

.rule-badge {
  align-self: start;
  margin-top: 2px;
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 20px;
}

.status-pass .rule-badge {
  color: var(--success);
  background: var(--success-bg);
}

.status-fail .rule-badge {
  color: var(--danger);
  background: var(--danger-bg);
}

.status-unknown .rule-badge {
  color: var(--warn);
  background: var(--warn-bg);
}

.rule-evidence {
  margin-top: 7px;
}

.rule-evidence summary {
  width: fit-content;
  color: var(--muted);
  font-size: 10.5px;
  list-style: none;
  cursor: pointer;
  border-bottom: 1px dashed #b9c9d4;
}

.rule-evidence summary::-webkit-details-marker {
  display: none;
}

.rule-evidence summary:hover {
  color: var(--primary);
}

.rule-evidence > div {
  margin-top: 7px;
  padding: 9px 11px;
  color: #52697a;
  font-size: 11.5px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  background: #f7fafb;
  border-radius: 8px;
}

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

.field-card {
  min-width: 0;
  padding: 12px 13px;
  background: #f8fbfc;
  border: 1px solid #e8eff3;
  border-radius: 11px;
}

.field-card-top {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 3px;
}

.field-card-top span:first-child {
  color: var(--muted);
  font-size: 10.5px;
}

.page-chip {
  margin-left: auto;
  padding: 0 6px;
  color: #748b9b;
  font-family: var(--mono);
  font-size: 8.5px;
  border: 1px solid #dce7ed;
  border-radius: 20px;
}

.field-value {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.5;
  word-break: break-word;
}

.field-value.empty {
  color: #98aab6;
  font-weight: 400;
  font-style: italic;
}

.field-evidence {
  margin-top: 4px;
  color: #7b8f9e;
  font-size: 10.5px;
  line-height: 1.55;
  word-break: break-word;
}

.extract-notes {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 13px;
}

.note-row {
  padding: 10px 12px;
  color: #566c7d;
  font-size: 11.5px;
  line-height: 1.6;
  background: #f6fafb;
  border-left: 2px solid #cde1e8;
  border-radius: 0 8px 8px 0;
}

.note-row b {
  color: var(--ink-2);
  font-weight: 600;
}

.preview-strip {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 2px 2px 8px;
}

.preview-item {
  position: relative;
  flex: none;
  width: 132px;
  padding: 0;
  overflow: hidden;
  background: #f4f8fa;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.preview-item img {
  display: block;
  width: 100%;
  height: 172px;
  object-fit: cover;
  transition: transform 0.25s;
}

.preview-item:hover img {
  transform: scale(1.025);
}

.preview-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  color: var(--muted);
  font-size: 10px;
  background: #fff;
  border-top: 1px solid var(--line);
}

.preview-label svg {
  width: 13px;
  height: 13px;
}

.preview-item.seal {
  width: 118px;
}

.preview-item.seal img {
  height: 118px;
  object-fit: cover;
}

.preview-group-title {
  flex: none;
  align-self: center;
  width: 1px;
  height: 120px;
  margin: 0 5px;
  background: var(--line);
}

.rules-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.overview-card {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px 17px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line);
  border-radius: 13px;
}

.overview-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 10px;
}

.overview-icon svg {
  width: 19px;
  height: 19px;
}

.overview-card b {
  display: block;
  font-family: var(--mono);
  font-size: 20px;
  line-height: 1.25;
}

.overview-card span {
  color: var(--muted);
  font-size: 10.5px;
}

.rules-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rule-card-main {
  min-width: 0;
}

.rule-config-token {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.modal-root:empty {
  display: none;
}

.rule-config-line {
  max-width: 100%;
}

.rule-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  padding: 18px 19px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 3px solid var(--primary);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 42, 64, 0.035);
  transition: border-color 0.16s, box-shadow 0.16s, opacity 0.16s;
}

.rule-card:hover {
  box-shadow: 0 6px 20px rgba(15, 42, 64, 0.07);
}

.rule-card[data-severity="suggested"] {
  border-left-color: #d9b06b;
}

.rule-card.disabled {
  opacity: 0.58;
  border-left-color: #c6d2da;
}

.rule-card-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.rule-card-title h3 {
  font-size: 14.5px;
  font-weight: 600;
}

.rule-card-desc {
  margin-top: 3px;
  color: #5c7284;
  font-size: 12px;
  line-height: 1.6;
}

.rule-config-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  color: #728796;
  font-size: 10.5px;
}

.rule-config-line b {
  color: #516a7c;
  font-weight: 600;
}

.rule-config-token {
  padding: 1px 7px;
  color: #51697b;
  background: #f4f8fa;
  border: 1px solid #e3ecf1;
  border-radius: 5px;
}

.rule-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 31px;
  height: 31px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.icon-btn:hover {
  color: var(--primary-dark);
  background: var(--primary-soft);
  border-color: #cfe3ea;
}

.icon-btn.danger:hover {
  color: var(--danger);
  background: var(--danger-bg);
  border-color: #f2cfcc;
}

.icon-btn svg {
  width: 15px;
  height: 15px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  margin-right: 4px;
}

.switch input {
  width: 0;
  height: 0;
  opacity: 0;
}

.switch span {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background: #cad6de;
  border-radius: 20px;
  transition: background 0.18s;
}

.switch span::before {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  content: "";
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  transition: transform 0.18s;
}

.switch input:checked + span {
  background: var(--primary);
}

.switch input:checked + span::before {
  transform: translateX(16px);
}

.switch input:focus-visible + span {
  box-shadow: 0 0 0 3px rgba(31, 111, 139, 0.18);
}

.empty-box {
  padding: 48px 24px;
  color: var(--muted);
  text-align: center;
  background: rgba(255, 255, 255, 0.65);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}

.inline-link {
  margin-left: 6px;
  color: var(--primary);
  font-size: 10.5px;
  font-weight: 400;
  text-decoration: none;
  border-bottom: 1px dashed #a9cbd6;
}

.inline-link:hover {
  color: var(--primary-dark);
  border-bottom-color: var(--primary);
}

.mapping-tip {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 14px;
  padding: 11px 14px;
  color: #5b7284;
  font-size: 11.5px;
  line-height: 1.6;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--line);
  border-left: 2px solid #b9d6df;
  border-radius: 9px;
}

.mapping-tip svg {
  width: 15px;
  height: 15px;
  margin-top: 2px;
  color: var(--primary);
}

.types-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.type-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 15px;
  padding: 18px 19px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 3px solid var(--primary);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 42, 64, 0.035);
  transition: border-color 0.16s, box-shadow 0.16s;
}

.type-card:hover {
  box-shadow: 0 6px 20px rgba(15, 42, 64, 0.07);
}

.type-icon {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  color: var(--primary);
  background: linear-gradient(145deg, #eef8fa, #e2f0f4);
  border: 1px solid #d4e8ee;
  border-radius: 12px;
}

.type-icon svg {
  width: 20px;
  height: 20px;
}

.type-main {
  min-width: 0;
}

.type-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.type-title-row h3 {
  font-size: 15px;
  font-weight: 650;
}

.type-desc {
  margin-top: 3px;
  color: #5c7284;
  font-size: 12px;
  line-height: 1.6;
}

.type-rule-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.type-rule-chip {
  max-width: 210px;
  padding: 1px 7px;
  overflow: hidden;
  color: #51697b;
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: #f4f8fa;
  border: 1px solid #e3ecf1;
  border-radius: 5px;
}

.type-rule-chip.is-off {
  color: #93a5b2;
  border-style: dashed;
}

.type-rule-chip.is-more {
  color: var(--primary);
  border-color: #cfe3ea;
  background: var(--primary-soft);
}

.type-stats {
  margin-top: 7px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9.5px;
}

.type-stats b {
  color: var(--ink-2);
  font-weight: 600;
}

.type-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  align-self: center;
}

.empty-mapping {
  color: var(--warn);
  font-size: 11.5px;
}

.record-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.record-search-wrap {
  position: relative;
  flex: 1;
  min-width: 240px;
}

.record-search-wrap svg {
  position: absolute;
  top: 50%;
  left: 11px;
  width: 16px;
  height: 16px;
  color: var(--muted);
  pointer-events: none;
  transform: translateY(-50%);
}

.record-search-wrap input {
  width: 100%;
  height: 39px;
  padding: 0 12px 0 34px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  outline: none;
  transition: border-color 0.16s, box-shadow 0.16s;
}

.record-search-wrap input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31, 111, 139, 0.12);
}

.segmented {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: #e7f0f4;
  border-radius: 10px;
}

.segmented button {
  height: 31px;
  padding: 0 11px;
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
  border: 0;
  border-radius: 7px;
  background: transparent;
  transition: color 0.15s, background 0.15s, box-shadow 0.15s;
}

.segmented button:hover {
  color: var(--ink-2);
}

.segmented button.active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 42, 64, 0.1);
}

.record-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.record-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) minmax(170px, 230px) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 17px;
  color: inherit;
  text-decoration: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 42, 64, 0.035);
  transition: border-color 0.16s, box-shadow 0.16s, transform 0.16s;
}

.record-row:hover {
  border-color: #b5ced8;
  box-shadow: 0 7px 22px rgba(15, 42, 64, 0.08);
  transform: translateY(-1px);
}

.record-file-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid #d5e9ef;
  border-radius: 10px;
}

.record-file-icon svg {
  width: 20px;
  height: 20px;
}

.record-main {
  min-width: 0;
}

.record-title {
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-sub {
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 5px;
}

.type-chip {
  padding: 0 7px;
  color: var(--primary-dark);
  font-size: 9px;
  line-height: 18px;
  background: var(--primary-soft);
  border: 1px solid #d3e8ee;
  border-radius: 5px;
}

.record-model {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.record-model-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.model-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  font-size: 9.5px;
  font-weight: 500;
  border-radius: 20px;
}

.model-pass {
  color: var(--success);
  background: var(--success-bg);
}

.model-fail {
  color: var(--danger);
  background: var(--danger-bg);
}

.model-review {
  color: var(--warn);
  background: var(--warn-bg);
}

.record-model-stats {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9.5px;
}

.record-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  text-align: right;
}

.review-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  font-size: 10.5px;
  font-weight: 500;
  border-radius: 20px;
}

.review-badge.pending {
  color: var(--warn);
  background: var(--warn-bg);
}

.review-badge.pass {
  color: var(--success);
  background: var(--success-bg);
}

.review-badge.fail {
  color: var(--danger);
  background: var(--danger-bg);
}

.review-badge.sm {
  padding: 1px 8px;
  font-size: 9.5px;
}

.record-time {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9.5px;
}

.record-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--primary);
  font-size: 11.5px;
  font-weight: 500;
}

.record-cta svg {
  width: 13px;
  height: 13px;
}

.record-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
}

.record-pagination button {
  height: 30px;
  padding: 0 11px;
  color: var(--ink-2);
  font-size: 11px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
}

.record-pagination button:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.record-pagination button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.record-empty {
  padding: 52px 24px;
  color: var(--muted);
  text-align: center;
  background: rgba(255, 255, 255, 0.62);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}

.record-empty h3 {
  margin-bottom: 4px;
  color: var(--ink-2);
  font-size: 15px;
}

.record-empty p {
  font-size: 11.5px;
}

.detail-head {
  margin-bottom: 16px;
}

.back-link {
  display: inline-flex;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 11.5px;
  text-decoration: none;
}

.back-link:hover {
  color: var(--primary);
}

.detail-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.detail-title-row h1 {
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.detail-head-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.record-detail-sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11.5px;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(330px, 390px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  margin-top: 15px;
}

.detail-side,
.detail-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.review-panel {
  border-color: #cfe3ea;
  box-shadow: 0 7px 24px rgba(31, 111, 139, 0.07);
}

.review-panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
}

.review-panel-head h2 {
  font-size: 16px;
  font-weight: 650;
}

.review-panel-head .review-badge {
  margin-left: auto;
}

.review-hint {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.65;
}

.review-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.review-choice button {
  height: 38px;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 500;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fbfdfe;
  transition: color 0.15s, background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.review-choice button:hover {
  border-color: #a9cbd6;
}

.review-choice button.selected[data-review-conclusion="pass"] {
  color: #fff;
  border-color: transparent;
  background: var(--success);
  box-shadow: 0 5px 14px rgba(21, 115, 71, 0.2);
}

.review-choice button.selected[data-review-conclusion="fail"] {
  color: #fff;
  border-color: transparent;
  background: var(--danger);
  box-shadow: 0 5px 14px rgba(180, 35, 24, 0.2);
}

.review-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.review-form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 600;
}

.review-form input,
.review-form textarea {
  width: 100%;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 400;
  background: #fbfdfe;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  outline: none;
}

.review-form input {
  height: 36px;
}

.review-form textarea {
  min-height: 78px;
  padding: 8px 10px;
  line-height: 1.6;
  resize: vertical;
}

.review-form input:focus,
.review-form textarea:focus {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31, 111, 139, 0.11);
}

.review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 1px;
}

.review-meta {
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.param-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 0;
}

.param-list > div {
  display: flex;
  gap: 10px;
  font-size: 11.5px;
}

.param-list dt {
  flex: none;
  width: 82px;
  color: var(--muted);
}

.param-list dd {
  min-width: 0;
  margin: 0;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.detail-previews {
  flex-direction: column;
  overflow: visible;
}

.detail-previews .preview-item {
  width: 100%;
}

.detail-previews .preview-item img {
  height: auto;
  max-height: 420px;
  object-fit: contain;
  background: #f4f8fa;
}

.detail-previews .preview-item.seal {
  width: 100%;
}

.detail-previews .preview-item.seal img {
  height: 180px;
  object-fit: contain;
}

.detail-previews .preview-group-title {
  display: none;
}

.record-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 340px;
  color: var(--muted);
  font-size: 12px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.record-loading .radar {
  width: 86px;
  height: 86px;
  margin-bottom: 12px;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 18px;
  align-items: start;
}

.settings-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.input-with-action {
  position: relative;
}

.input-with-action input {
  padding-right: 58px;
}

.input-action {
  position: absolute;
  top: 50%;
  right: 7px;
  height: 28px;
  padding: 0 9px;
  color: var(--primary);
  font-size: 11px;
  border: 0;
  border-radius: 6px;
  background: var(--primary-soft);
  transform: translateY(-50%);
}

.status-pill {
  margin-left: auto;
  padding: 2px 9px;
  color: var(--muted);
  font-size: 10.5px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fafcfd;
}

.status-pill.ok {
  color: var(--success);
  border-color: #c8e6d6;
  background: var(--success-bg);
}

.status-pill.warn {
  color: var(--warn);
  border-color: #f0dcb8;
  background: var(--warn-bg);
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 3px;
}

.test-result {
  padding: 10px 12px;
  font-size: 11.5px;
  line-height: 1.6;
  border-radius: 9px;
}

.test-result.ok {
  color: var(--success);
  background: var(--success-bg);
  border: 1px solid #cae8d8;
}

.test-result.error {
  color: var(--danger);
  background: var(--danger-bg);
  border: 1px solid #f3d0cd;
}

.info-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.info-list li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 13px;
  border-left: 2px solid #d9e8ed;
}

.info-list strong {
  font-size: 12.5px;
  font-weight: 650;
}

.info-list span {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.65;
}

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(10, 28, 42, 0.46);
  backdrop-filter: blur(3px);
  animation: fade 0.18s ease;
}

.modal {
  display: flex;
  flex-direction: column;
  width: min(680px, 100%);
  max-height: min(88vh, 900px);
  overflow: hidden;
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--shadow-md);
  animation: modal-in 0.22s ease;
}

.modal.modal-sm {
  width: min(440px, 100%);
}

.modal.modal-lg {
  width: min(840px, 100%);
}

.type-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
  align-items: start;
}

.rule-picker-panel {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
  padding: 13px;
  background: #f8fbfc;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.rule-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.rule-picker-head .field-label {
  margin: 0;
}

.rule-picker-count {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.rule-picker-tools {
  display: flex;
  gap: 6px;
}

.rule-picker-search {
  flex: 1;
  min-width: 0;
  height: 30px;
  padding: 0 9px;
  font-size: 11.5px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  outline: none;
}

.rule-picker-search:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31, 111, 139, 0.11);
}

.rule-picker-tools .btn {
  height: 30px;
  padding: 0 9px;
  font-size: 11px;
  border-radius: 7px;
}

.rule-picker {
  max-height: 330px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.rule-pick {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 11px;
  cursor: pointer;
  border-bottom: 1px solid #eef3f6;
  transition: background 0.14s;
}

.rule-pick:last-child {
  border-bottom: 0;
}

.rule-pick:hover {
  background: #f8fbfc;
}

.rule-pick:has(input:checked) {
  background: var(--primary-soft);
}

.rule-pick input {
  flex: none;
  width: 15px;
  height: 15px;
  margin-top: 2px;
  accent-color: var(--primary);
}

.rule-pick-main {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.rule-pick-name {
  overflow-wrap: anywhere;
  font-size: 12.5px;
  font-weight: 600;
}

.rule-pick.is-off .rule-pick-name {
  color: var(--muted);
}

.rule-pick-meta {
  color: var(--muted);
  font-size: 9.5px;
}

.picker-empty {
  padding: 28px 16px;
  color: var(--muted);
  font-size: 11.5px;
  text-align: center;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 22px 14px;
}

.modal-head h2 {
  font-size: 18px;
  font-weight: 650;
}

.modal-head p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11.5px;
}

.modal-close {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-left: auto;
  color: var(--muted);
  border: 0;
  border-radius: 8px;
  background: transparent;
}

.modal-close:hover {
  color: var(--ink);
  background: #f2f6f8;
}

.modal > form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.modal-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 4px 22px 22px;
  overflow-y: auto;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 14px 22px 19px;
  border-top: 1px solid #edf2f5;
  background: #fcfdfe;
}

.modal .form-stack {
  gap: 14px;
}

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

.evaluator-option {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 11px 12px;
  cursor: pointer;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fbfdfe;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.evaluator-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.evaluator-option b {
  font-size: 12.5px;
  font-weight: 600;
}

.evaluator-option small {
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.45;
}

.evaluator-option:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 0 2px rgba(31, 111, 139, 0.08);
}

.evaluator-option:has(input:focus-visible) {
  box-shadow: 0 0 0 3px rgba(31, 111, 139, 0.16);
}

.config-box {
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 15px;
  background: #f7fafb;
  border: 1px dashed #d5e3ea;
  border-radius: 12px;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-2);
  font-size: 12px;
}

.checkbox-line input {
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 30px;
  background: rgba(7, 20, 32, 0.9);
  backdrop-filter: blur(4px);
}

.lightbox img {
  max-width: min(1100px, 92vw);
  max-height: 82vh;
  object-fit: contain;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

.lightbox-caption {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}

.lightbox-close {
  position: absolute;
  top: 22px;
  right: 24px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.16);
}

.toast-root {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(360px, calc(100vw - 44px));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 14px;
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.55;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 3px solid var(--primary);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  animation: toast-in 0.24s ease both;
}

.toast.error {
  border-left-color: var(--danger);
}

.toast.success {
  border-left-color: var(--success);
}

.toast svg {
  width: 16px;
  height: 16px;
  margin-top: 1px;
}

.toast.error svg {
  color: var(--danger);
}

.toast.success svg {
  color: var(--success);
}

.toast.info svg {
  color: var(--primary);
}

.toast.leaving {
  animation: toast-out 0.2s ease both;
}

.skeleton {
  background: linear-gradient(90deg, #eef3f6 25%, #f7fafb 50%, #eef3f6 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes scan {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0;
  }
  15%,
  85% {
    opacity: 1;
  }
  50% {
    transform: translateY(128px);
  }
}

@keyframes radar {
  0% {
    transform: scale(0.55);
    opacity: 0.85;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

@keyframes indeterminate {
  0% {
    transform: translateX(-110%);
  }
  100% {
    transform: translateX(340%);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(9px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(7px);
  }
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

@media (max-width: 1180px) {
  .workbench {
    grid-template-columns: minmax(340px, 380px) minmax(0, 1fr);
  }

  .verdict-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .verdict-stats {
    grid-column: 1 / -1;
    justify-content: flex-start;
    padding: 4px 0 0 4px;
  }

  .vstat:first-child {
    border-left: 0;
    padding-left: 0;
  }
}

@media (max-width: 980px) {
  .topbar {
    gap: 14px;
    padding: 0 18px;
  }

  .brand {
    min-width: auto;
  }

  .brand-text small {
    display: none;
  }

  .shell {
    padding: 22px 18px 44px;
  }

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

  .input-column {
    position: static;
  }

  .result-empty,
  .loading-card {
    min-height: 420px;
  }

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

  .rules-overview {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .topbar {
    flex-wrap: wrap;
    height: auto;
    padding: 11px 14px;
  }

  .brand-mark {
    width: 35px;
    height: 35px;
  }

  .brand-text strong {
    font-size: 14.5px;
  }

  .api-status {
    margin-left: auto;
    height: 30px;
    padding: 0 10px;
    font-size: 11px;
  }

  .tabs {
    order: 3;
    width: 100%;
  }

  .tab {
    flex: 1;
    justify-content: center;
    height: 34px;
    padding: 0 8px;
    font-size: 12.5px;
  }

  .tab-count {
    display: none;
  }

  .shell {
    padding: 18px 13px 36px;
  }

  .page-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .page-head h1 {
    font-size: 25px;
  }

  .head-note {
    width: 100%;
  }

  .head-actions {
    width: 100%;
  }

  .head-actions .btn {
    flex: 1;
  }

  .card {
    padding: 17px;
  }

  .field-row,
  .field-grid {
    grid-template-columns: 1fr;
  }

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

  .verdict-card {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 14px;
    padding: 19px;
  }

  .verdict-icon {
    width: 45px;
    height: 45px;
  }

  .verdict-icon svg {
    width: 22px;
    height: 22px;
  }

  .verdict-main h2 {
    font-size: 22px;
  }

  .rule-result {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .rule-badge {
    grid-column: 2;
    justify-self: start;
    margin-top: 0;
  }

  .rules-overview {
    grid-template-columns: 1fr;
  }

  .rule-card {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .rule-actions {
    justify-content: flex-end;
  }

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

  .modal-root {
    padding: 10px;
  }

  .modal-body,
  .modal-head,
  .modal-foot {
    padding-left: 16px;
    padding-right: 16px;
  }

  .settings-actions {
    flex-direction: column-reverse;
  }

  .settings-actions .btn {
    width: 100%;
  }

  .toast-root {
    right: 13px;
    bottom: 13px;
    width: calc(100vw - 26px);
  }
}

@media (max-width: 980px) {
  .type-editor-grid {
    grid-template-columns: 1fr;
  }

  .rule-picker {
    max-height: 280px;
  }
}

@media (max-width: 720px) {
  .tabs {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }

  .tab {
    flex: 1 0 auto;
    white-space: nowrap;
  }

  .type-card {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
  }

  .type-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .type-rule-chip {
    max-width: 150px;
  }
}

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

@media (max-width: 980px) {
  .record-row {
    grid-template-columns: 42px minmax(0, 1fr) auto;
  }

  .record-file-icon {
    grid-row: 1 / 3;
  }

  .record-model {
    grid-column: 2;
    grid-row: 2;
  }

  .record-right {
    grid-column: 3;
    grid-row: 1 / 3;
  }
}

@media (max-width: 720px) {
  .record-toolbar {
    align-items: stretch;
  }

  .record-search-wrap {
    flex-basis: 100%;
  }

  .segmented {
    flex: 1;
  }

  .segmented button {
    flex: 1;
    padding: 0 6px;
  }

  .record-row {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 10px 12px;
  }

  .record-file-icon {
    grid-column: 1;
    grid-row: 1;
    width: 38px;
    height: 38px;
  }

  .record-model {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .record-right {
    grid-column: 1 / -1;
    grid-row: 3;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    text-align: left;
  }

  .detail-title-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
  }

  .detail-head-actions {
    width: 100%;
    justify-content: space-between;
  }

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

  .record-detail-sub {
    margin-top: 6px;
  }
}

@media print {
  .record-toolbar,
  .record-pagination,
  .back-link,
  .detail-head-actions .btn,
  .review-actions,
  .record-search-wrap,
  .segmented {
    display: none !important;
  }

  .detail-grid {
    display: block;
  }

  .detail-side {
    margin-bottom: 12px;
  }
}

@media print {
  body {
    background: #fff;
  }

  .topbar,
  .input-column,
  .result-toolbar,
  .toast-root,
  .modal-root,
  .lightbox,
  .result-empty,
  .loading-card,
  .page-head {
    display: none !important;
  }

  .shell {
    max-width: none;
    padding: 0;
  }

  .workbench {
    display: block;
  }

  .result-content {
    gap: 12px;
  }

  .card,
  .verdict-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccd8df;
  }

  .verdict-card {
    background: #fff !important;
  }

  .rule-result {
    break-inside: avoid;
  }

  .rule-evidence > div {
    display: block !important;
  }

  .rule-evidence summary {
    display: none;
  }

  .preview-strip {
    flex-wrap: wrap;
    overflow: visible;
  }
}
