:root {
  color-scheme: light;
  --ink: #17233b;
  --ink-soft: #53617a;
  --muted: #71809a;
  --line: #dfe5ee;
  --line-strong: #c8d2e2;
  --surface: #ffffff;
  --surface-soft: #f7f9fc;
  --canvas: #f2f5f9;
  --blue: #2459d6;
  --blue-dark: #1744ad;
  --blue-soft: #edf3ff;
  --green: #1d8158;
  --green-soft: #eaf8f1;
  --amber: #a9680b;
  --amber-soft: #fff6e5;
  --red: #b44042;
  --red-soft: #fff0f0;
  --shadow: 0 18px 46px rgba(31, 54, 91, 0.08);
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% -8%, rgba(55, 111, 226, 0.12), transparent 34rem),
    var(--canvas);
  line-height: 1.5;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
input:disabled {
  cursor: not-allowed;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(36, 89, 214, 0.32);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.app-shell {
  width: min(100%, 1060px);
  min-width: 0;
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 28px 34px;
}

.site-header {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 78px;
}

.wordmark {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-decoration: none;
}

.wordmark-mark {
  display: inline-flex;
  width: 25px;
  height: 25px;
  align-items: flex-end;
  gap: 3px;
  padding: 4px;
  border-radius: 8px;
  background: var(--blue);
  box-shadow: 0 5px 12px rgba(36, 89, 214, 0.2);
}

.wordmark-mark span {
  display: block;
  width: 4px;
  border-radius: 4px;
  background: #fff;
}

.wordmark-mark span:nth-child(1) {
  height: 8px;
  opacity: 0.72;
}

.wordmark-mark span:nth-child(2) {
  height: 13px;
  opacity: 0.86;
}

.wordmark-mark span:nth-child(3) {
  height: 17px;
}

.header-note {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.page-content {
  display: grid;
  min-width: 0;
  gap: 18px;
}

.status-card,
.workspace-card,
.result-card {
  min-width: 0;
  border: 1px solid rgba(203, 213, 228, 0.92);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.status-card {
  display: flex;
  min-height: 168px;
  align-items: flex-start;
  gap: 18px;
  padding: 31px 34px;
  border-top: 4px solid var(--blue);
}

.status-card[data-state="empty"] {
  border-top-color: var(--amber);
}

.status-card[data-state="error"] {
  border-top-color: var(--red);
  background: linear-gradient(135deg, var(--surface) 0%, #fffafa 100%);
}

.status-card[data-state="success"] {
  border-top-color: var(--green);
}

.status-card[data-state="partial"] {
  border-top-color: var(--amber);
}

.status-icon {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  background: var(--blue-soft);
  color: var(--blue);
}

.status-icon::before,
.status-icon::after,
.status-icon span {
  content: "";
  display: block;
  grid-area: 1 / 1;
}

.status-icon::before {
  width: 19px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 4px;
}

.status-icon::after {
  width: 12px;
  height: 2px;
  margin-top: 7px;
  border-radius: 2px;
  background: currentColor;
  box-shadow: 0 -5px 0 currentColor;
}

.status-card[data-state="loading"] .status-icon span {
  width: 25px;
  height: 25px;
  border: 2px solid rgba(36, 89, 214, 0.2);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.status-card[data-state="error"] .status-icon {
  background: var(--red-soft);
  color: var(--red);
}

.status-card[data-state="partial"] .status-icon {
  background: var(--amber-soft);
  color: var(--amber);
}

.status-card[data-state="success"] .status-icon {
  background: var(--green-soft);
  color: var(--green);
}

.status-copy {
  min-width: 0;
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.status-card[data-state="error"] .eyebrow {
  color: var(--red);
}

.status-card[data-state="partial"] .eyebrow {
  color: var(--amber);
}

.status-card[data-state="success"] .eyebrow {
  color: var(--green);
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.2;
}

h2 {
  margin-bottom: 7px;
  font-size: clamp(20px, 2.5vw, 25px);
  line-height: 1.25;
}

h3 {
  margin-bottom: 10px;
  font-size: 14px;
}

.status-message,
.muted-copy {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
}

.error-code {
  margin: 10px 0 0;
  color: var(--red);
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  transition: background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
}

.button:disabled {
  opacity: 0.52;
}

.button-primary {
  color: #fff;
  background: var(--blue);
  box-shadow: 0 6px 14px rgba(36, 89, 214, 0.18);
}

.button-primary:not(:disabled):hover {
  background: var(--blue-dark);
}

.button-secondary {
  margin-top: 18px;
  color: var(--blue-dark);
  border-color: #b9caf1;
  background: var(--blue-soft);
}

.button-secondary:not(:disabled):hover,
.button-quiet:not(:disabled):hover {
  border-color: #8fa9e9;
  background: #e4edff;
}

.button-quiet {
  flex: 0 0 auto;
  min-height: 38px;
  color: var(--blue-dark);
  border-color: var(--line);
  background: var(--surface-soft);
  font-size: 13px;
}

.workspace-card,
.result-card {
  padding: 30px 34px 34px;
}

.workspace-heading,
.result-heading,
.form-actions {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.workspace-heading {
  padding-bottom: 23px;
  border-bottom: 1px solid var(--line);
}

.empty-note {
  margin: 20px 0 0;
  padding: 13px 15px;
  color: var(--amber);
  border: 1px solid #f0d49c;
  border-radius: 10px;
  background: var(--amber-soft);
  font-size: 14px;
}

form {
  min-width: 0;
  padding-top: 25px;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  margin-bottom: 12px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

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

.mode-option {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 11px;
  min-height: 77px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}

.mode-option:has(input:checked) {
  border-color: #91a9eb;
  background: var(--blue-soft);
  box-shadow: inset 0 0 0 1px rgba(36, 89, 214, 0.08);
}

.mode-option:has(input:disabled) {
  cursor: not-allowed;
}

.mode-option input {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin: 2px 0 0;
  accent-color: var(--blue);
}

.mode-option-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.mode-option-copy strong {
  font-size: 14px;
}

.mode-option-copy span {
  color: var(--ink-soft);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.mode-panel {
  min-width: 0;
  margin-top: 24px;
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fcfdff;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.text-input {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--surface);
}

.text-input::placeholder {
  color: #96a1b2;
}

.text-input:hover:not(:disabled) {
  border-color: #9daec8;
}

.text-input:focus {
  border-color: var(--blue);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(36, 89, 214, 0.14);
}

.text-input[aria-invalid="true"] {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(180, 64, 66, 0.1);
}

.field-hint,
.field-error {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.field-error {
  color: var(--red);
}

.project-list {
  display: grid;
  max-height: 300px;
  min-width: 0;
  gap: 7px;
  margin-top: 15px;
  overflow-y: auto;
  padding-right: 4px;
}

.project-choice {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  cursor: pointer;
}

.project-choice:has(input:checked) {
  border-color: #91a9eb;
  background: var(--blue-soft);
}

.project-choice input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--blue);
}

.project-choice-name {
  min-width: 0;
  color: var(--ink);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.form-actions {
  align-items: center;
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.form-actions .field-hint {
  margin: 0;
  max-width: 58%;
}

.result-card {
  border-top: 4px solid var(--green);
}

.result-card[data-state="partial"] {
  border-top-color: var(--amber);
}

.result-heading {
  align-items: center;
}

.result-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 6px 11px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 12px;
  font-weight: 700;
}

.result-badge[data-state="partial"] {
  color: var(--amber);
  background: var(--amber-soft);
}

.target-box {
  display: grid;
  min-width: 0;
  gap: 5px;
  margin-top: 19px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
}

.target-label {
  color: var(--muted);
  font-size: 12px;
}

.target-name {
  min-width: 0;
  font-size: 16px;
  overflow-wrap: anywhere;
}

.target-link {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  gap: 5px;
  color: var(--blue-dark);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.result-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 0;
}

.result-summary > div {
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.result-summary dt {
  color: var(--muted);
  font-size: 12px;
}

.result-summary dd {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.15;
}

.result-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 25px;
  padding-top: 23px;
  border-top: 1px solid var(--line);
}

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

.result-group-failed h3 {
  color: var(--red);
}

.result-list {
  display: grid;
  min-width: 0;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.result-list li {
  min-width: 0;
  padding: 9px 10px;
  border-radius: 8px;
  background: var(--surface-soft);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.result-list .result-empty {
  color: var(--muted);
  font-style: italic;
}

.result-path {
  display: block;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.result-failure-message {
  display: block;
  margin-top: 3px;
  color: var(--red);
}

.partial-hint {
  margin: 22px 0 0;
  padding: 13px 15px;
  color: var(--amber);
  border: 1px solid #f0d49c;
  border-radius: 10px;
  background: var(--amber-soft);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.site-footer {
  padding-top: 20px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  overflow-wrap: anywhere;
}

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

@media (max-width: 720px) {
  .app-shell {
    padding-right: 18px;
    padding-left: 18px;
  }

  .status-card,
  .workspace-card,
  .result-card {
    padding-right: 23px;
    padding-left: 23px;
  }

  .result-details {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

@media (max-width: 520px) {
  .app-shell {
    padding-right: 12px;
    padding-left: 12px;
  }

  .site-header {
    min-height: 64px;
  }

  .header-note {
    display: none;
  }

  .status-card,
  .workspace-card,
  .result-card {
    border-radius: 14px;
    padding: 23px 17px;
  }

  .status-card {
    gap: 12px;
  }

  .status-icon {
    flex-basis: 35px;
    width: 35px;
    height: 35px;
    border-radius: 10px;
  }

  .status-icon::before {
    width: 16px;
    height: 12px;
  }

  .status-icon::after {
    width: 10px;
    margin-top: 6px;
  }

  .workspace-heading,
  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .button-quiet,
  .button-primary {
    width: 100%;
  }

  .mode-options,
  .result-summary {
    grid-template-columns: 1fr;
  }

  .mode-panel {
    padding: 16px;
  }

  .form-actions .field-hint {
    max-width: none;
  }
}

@media (max-width: 360px) {
  .app-shell {
    min-width: 0;
    padding-right: 9px;
    padding-left: 9px;
  }

  .status-card,
  .workspace-card,
  .result-card {
    padding-right: 13px;
    padding-left: 13px;
  }

  .status-card {
    gap: 9px;
  }

  .status-icon {
    flex-basis: 31px;
    width: 31px;
    height: 31px;
  }

  .mode-panel {
    padding-right: 12px;
    padding-left: 12px;
  }
}
