:root {
  color-scheme: light;
  font: 15px/1.6 "Segoe UI", "Microsoft YaHei", sans-serif;
  color: #223247;
  background: #f4f6fa;
  --background: #f4f6fa;
  --surface: #ffffff;
  --surface-subtle: #f8fafc;
  --navy: #173f67;
  --blue: #2168c5;
  --blue-hover: #1955a3;
  --blue-soft: #eaf2fc;
  --success: #17734c;
  --success-soft: #e9f6ef;
  --warning: #92510a;
  --warning-soft: #fff5df;
  --danger: #b42318;
  --danger-hover: #921d15;
  --danger-soft: #fff0ee;
  --text: #223247;
  --muted: #607086;
  --border: #dce3ec;
  --border-strong: #c4d0de;
  --shadow: 0 3px 14px rgba(23, 63, 103, .05);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--background);
}

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

button,
input,
select,
textarea,
summary,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  min-height: 40px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: var(--blue);
  color: #ffffff;
  font-weight: 600;
  line-height: 1.35;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}

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

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  opacity: .58;
  cursor: not-allowed;
}

button.primary {
  background: var(--blue);
}

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

button.secondary {
  border-color: var(--border-strong);
  background: #ffffff;
  color: var(--navy);
}

button.secondary:hover:not(:disabled) {
  border-color: #9fb2c6;
  background: #f3f7fb;
}

button.danger {
  background: var(--danger);
}

button.danger:hover:not(:disabled) {
  background: var(--danger-hover);
}

button.danger-outline {
  border-color: #e3b3ae;
  background: #ffffff;
  color: var(--danger);
}

button.danger-outline:hover:not(:disabled) {
  border-color: var(--danger);
  background: var(--danger-soft);
}

button.small-button {
  min-height: 34px;
  padding: 6px 11px;
  font-size: 13px;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
a:focus-visible,
[tabindex="-1"]:focus-visible {
  outline: 3px solid #91b9e9;
  outline-offset: 2px;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: #ffffff;
  color: var(--text);
  transition: border-color .15s ease, box-shadow .15s ease;
}

input,
select {
  min-height: 42px;
  padding: 9px 12px;
}

textarea {
  min-height: 88px;
  padding: 10px 12px;
  line-height: 1.55;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #8290a2;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(33, 104, 197, .11);
  outline: none;
}

input[aria-invalid="true"],
textarea[aria-invalid="true"],
select[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(180, 35, 24, .09);
}

input[type="file"] {
  padding: 6px;
  background: var(--surface-subtle);
}

input[type="file"]::file-selector-button {
  min-height: 30px;
  margin-right: 12px;
  padding: 5px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: #ffffff;
  color: var(--navy);
  font: 600 13px "Segoe UI", "Microsoft YaHei", sans-serif;
  cursor: pointer;
}

label {
  display: block;
  margin-bottom: 7px;
  color: #2d4057;
  font-weight: 600;
}

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

h1,
h2,
h3,
h4 {
  color: #182c42;
  line-height: 1.3;
}

h1 {
  margin-bottom: 10px;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -.02em;
}

h2 {
  margin-bottom: 8px;
  font-size: 22px;
  font-weight: 700;
}

h3 {
  margin-bottom: 8px;
  font-size: 17px;
  font-weight: 700;
}

p {
  margin-bottom: 12px;
}

code,
pre {
  font-family: Consolas, "SFMono-Regular", monospace;
}

code {
  overflow-wrap: anywhere;
  color: #294763;
  font-size: 12px;
}

pre {
  max-height: 460px;
  margin: 12px 0 0;
  padding: 16px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #f5f7fa;
  color: #263d54;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  tab-size: 2;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 9px 14px;
  border-radius: 6px;
  background: #ffffff;
  color: var(--navy);
  font-weight: 600;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.app-header {
  background: var(--navy);
  color: #ffffff;
  border-bottom: 3px solid #2168c5;
}

.header-inner {
  display: flex;
  width: min(100% - 48px, 1280px);
  min-height: 68px;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
}

.brand-mark {
  display: inline-flex;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, .4);
  border-radius: 7px;
  background: #ffffff;
  color: var(--navy);
  font-size: 19px;
  font-weight: 800;
}

.brand-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .12em;
}

.brand-divider {
  width: 1px;
  height: 20px;
  margin: 0 2px;
  background: rgba(255, 255, 255, .28);
}

.brand-subtitle {
  color: #d8e4ef;
  font-size: 14px;
}

.environment-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  padding: 4px 11px;
  border: 1px solid rgba(255, 255, 255, .26);
  border-radius: 20px;
  color: #e5edf5;
  font-size: 12px;
}

.environment-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #77d5a7;
}

.container {
  width: min(100% - 48px, 1280px);
  margin: 0 auto;
  padding: 32px 0 18px;
}

.page-intro {
  margin-bottom: 26px;
}

.page-intro > p:last-child {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
}

.eyebrow {
  margin-bottom: 6px;
  color: #56718f;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.panel {
  min-width: 0;
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-panel {
  max-width: 720px;
}

.panel-heading {
  margin-bottom: 22px;
}

.panel-heading > p:last-child,
.sectionhead p,
.subsection-heading p {
  margin-bottom: 0;
  color: var(--muted);
}

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

.required-mark {
  margin-left: 5px;
  color: var(--danger);
  font-size: 12px;
  font-weight: 500;
}

.field-help {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.form-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.form-row > input {
  flex: 1;
}

.form-row > button {
  flex: 0 0 auto;
}

.auth-row > button {
  min-width: 116px;
}

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

.side-nav {
  position: sticky;
  top: 20px;
  display: flex;
  min-width: 0;
  padding: 10px;
  flex-direction: column;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

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

button.nav-button {
  width: 100%;
  min-height: 42px;
  padding: 10px 13px;
  border-color: transparent;
  background: transparent;
  color: #4d6178;
  text-align: left;
  white-space: nowrap;
}

button.nav-button:hover:not(:disabled) {
  background: #f1f5f9;
  color: var(--navy);
}

button.nav-button.active,
button.nav-button[aria-selected="true"] {
  background: var(--blue-soft);
  color: #18569f;
  box-shadow: inset 3px 0 0 var(--blue);
}

button.logout-button {
  margin-top: 2px;
  border-top-color: var(--border);
  border-radius: 0 0 6px 6px;
  color: #6a5360;
}

.workspace-content {
  min-width: 0;
}

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

.sectionhead > div:first-child {
  min-width: 0;
}

.search-form {
  display: flex;
  width: min(100%, 360px);
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.search-form input {
  flex: 1;
}

.notice {
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid #cbdcee;
  border-radius: 7px;
  background: #f0f6fc;
  color: #28557f;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.notice[data-state="success"] {
  border-color: #b8ddca;
  background: var(--success-soft);
  color: #12603f;
}

.notice[data-state="warning"] {
  border-color: #ead2a4;
  background: var(--warning-soft);
  color: #7c450c;
}

.notice[data-state="error"] {
  border-color: #edc1bc;
  background: var(--danger-soft);
  color: #982017;
}

.global-status {
  margin: 18px 0 0;
  padding: 10px 2px;
  color: var(--muted);
  font-size: 13px;
}

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

.global-status[data-state="error"] {
  color: var(--danger);
}

.more-button {
  display: block;
  min-width: 130px;
  margin: 18px auto 0;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #ffffff;
}

table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  text-align: left;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid #e7ecf2;
  vertical-align: middle;
}

th {
  background: #f6f8fb;
  color: #52667d;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

td {
  color: #30445b;
  font-size: 13px;
}

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

tbody tr:hover td {
  background: #fafcfe;
}

.reports-table {
  min-width: 720px;
}

.releases-table {
  min-width: 740px;
}

.audit-table {
  min-width: 720px;
}

.diff-table {
  min-width: 760px;
}

.cell-primary {
  display: block;
  color: #1d354e;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.cell-secondary {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  max-width: 100%;
  min-height: 24px;
  padding: 2px 8px;
  align-items: center;
  border: 1px solid #d4dde7;
  border-radius: 5px;
  background: #f1f4f8;
  color: #526478;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.badge-success {
  border-color: #bfe0cf;
  background: var(--success-soft);
  color: var(--success);
}

.badge-info {
  border-color: #c6d9ef;
  background: var(--blue-soft);
  color: #18569f;
}

.badge-warning {
  border-color: #ead4aa;
  background: var(--warning-soft);
  color: var(--warning);
}

.badge-danger {
  border-color: #edc4bf;
  background: var(--danger-soft);
  color: var(--danger);
}

.state {
  padding: 30px 20px;
  border: 1px dashed var(--border-strong);
  border-radius: 9px;
  background: var(--surface-subtle);
  text-align: center;
}

.state h3 {
  margin-bottom: 6px;
  font-size: 15px;
}

.state p {
  max-width: 600px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.state button {
  margin-top: 16px;
}

.state-error {
  border-color: #e7bbb6;
  background: #fffafa;
}

.state-error h3 {
  color: var(--danger);
}

.detail-panel {
  margin-top: 26px;
  padding: 22px;
  border: 1px solid #cdd9e6;
  border-radius: 10px;
  background: #fbfcfe;
}

.detail-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.detail-section {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
}

.detail-section h4 {
  margin-bottom: 10px;
  color: #35516e;
  font-size: 13px;
}

.definition-list,
.review-list {
  margin: 0;
}

.definition-list > div,
.review-list > div {
  display: grid;
  grid-template-columns: minmax(110px, .42fr) minmax(0, 1fr);
  gap: 14px;
  padding: 8px 0;
  border-bottom: 1px solid #edf1f5;
}

.definition-list > div:last-child,
.review-list > div:last-child {
  border-bottom: 0;
}

.definition-list dt,
.review-list dt {
  color: var(--muted);
  font-size: 12px;
}

.definition-list dd,
.review-list dd {
  min-width: 0;
  margin: 0;
  color: #263c53;
  font-size: 13px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.technical-details {
  margin-top: 16px;
  padding: 0 14px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
}

.technical-details summary,
.inline-details summary {
  color: #355a7e;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.technical-details summary {
  padding: 12px 0;
}

.upload-form {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.analysis-card {
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #ffffff;
}

.analysis-card-header {
  display: flex;
  padding: 18px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}

.analysis-card-header h3 {
  margin-bottom: 4px;
  overflow-wrap: anywhere;
}

.analysis-card-header p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.analysis-summary {
  padding: 8px 18px;
}

.diff-section {
  padding: 18px;
  border-top: 1px solid var(--border);
}

.diff-section h4 {
  margin-bottom: 12px;
  font-size: 14px;
}

.hash {
  display: inline-block;
  max-width: 100%;
  vertical-align: bottom;
}

.error-list {
  margin: 0;
  padding: 16px 18px 16px 38px;
  border-top: 1px solid #edc1bc;
  background: var(--danger-soft);
  color: #8f2119;
}

.error-list li {
  padding: 3px 0;
  overflow-wrap: anywhere;
}

.error-list-title {
  margin: 0;
  padding: 14px 18px 0;
  border-top: 1px solid #edc1bc;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 14px;
  font-weight: 700;
}

.publish-box {
  margin-top: 22px;
  padding: 20px;
  border: 1px solid #cdd9e6;
  border-radius: 10px;
  background: #f8fafc;
}

.subsection-heading {
  margin-bottom: 16px;
}

.publish-fields {
  display: grid;
  grid-template-columns: minmax(190px, .6fr) minmax(260px, 1.4fr);
  align-items: start;
  gap: 16px;
}

.field {
  min-width: 0;
}

.action-row {
  display: flex;
  margin-top: 16px;
  justify-content: flex-end;
}

.history-heading {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.record-list {
  display: grid;
  gap: 14px;
}

.record-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #ffffff;
}

.record-card-header {
  display: flex;
  margin-bottom: 12px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.record-card-header h3 {
  margin: 0;
  overflow-wrap: anywhere;
}

.inline-details {
  margin-top: 12px;
  border-top: 1px solid var(--border);
}

.inline-details summary {
  padding-top: 12px;
}

.dialog {
  width: min(650px, calc(100% - 32px));
  max-height: min(88vh, 850px);
  padding: 0;
  overflow: auto;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 20px 60px rgba(14, 35, 58, .24);
}

.dialog::backdrop {
  background: rgba(15, 35, 55, .48);
}

.dialog form {
  padding: 24px;
}

.dialog-heading {
  margin-bottom: 18px;
}

.dialog-heading > p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.review-list {
  margin-bottom: 20px;
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-subtle);
}

.review-list > div {
  grid-template-columns: minmax(125px, .4fr) minmax(0, 1fr);
  padding: 11px 0;
}

.dialog-actions {
  display: flex;
  margin-top: 22px;
  padding-top: 18px;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--border);
}

.danger-text {
  color: var(--danger);
}

footer {
  padding: 10px 24px 24px;
  color: #7a8899;
  font-size: 12px;
  text-align: center;
}

@media (max-width: 1020px) {
  .workspace {
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 16px;
  }

  .panel {
    padding: 22px;
  }

  .sectionhead {
    flex-direction: column;
    gap: 16px;
  }

  .search-form {
    width: 100%;
  }
}

@media (max-width: 820px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .side-nav {
    position: static;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
  }

  .nav-group {
    flex: 1 0 auto;
    flex-direction: row;
  }

  button.nav-button {
    width: auto;
  }

  button.nav-button.active,
  button.nav-button[aria-selected="true"] {
    box-shadow: inset 0 -3px 0 var(--blue);
  }

  button.logout-button {
    margin: 0 0 0 auto;
    border-top-color: transparent;
    border-left-color: var(--border);
    border-radius: 0 6px 6px 0;
  }

  .publish-fields {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .header-inner,
  .container {
    width: min(100% - 30px, 1280px);
  }

  .header-inner {
    min-height: 62px;
    gap: 12px;
  }

  .container {
    padding-top: 24px;
  }

  .brand {
    gap: 8px;
  }

  .brand-divider,
  .brand-subtitle {
    display: none;
  }

  .brand-name {
    font-size: 14px;
  }

  .environment-badge {
    padding: 3px 8px;
    font-size: 11px;
  }

  h1 {
    font-size: 26px;
  }

  h2 {
    font-size: 20px;
  }

  .panel {
    padding: 18px;
    border-radius: 10px;
  }

  .page-intro {
    margin-bottom: 20px;
  }

  .form-row,
  .search-form {
    align-items: stretch;
    flex-direction: column;
  }

  .form-row > button,
  .search-form > button,
  .action-row > button {
    width: 100%;
  }

  .detail-panel {
    padding: 16px;
  }

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

  .analysis-card-header,
  .record-card-header {
    flex-direction: column;
    gap: 10px;
  }

  .dialog form {
    padding: 20px;
  }

  .definition-list > div,
  .review-list > div {
    grid-template-columns: 1fr;
    gap: 3px;
  }

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

  .dialog-actions button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
