:root {
  --bg: #eff5fb;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-strong: rgba(255, 255, 255, 0.95);
  --text: #17324d;
  --text-soft: #59748f;
  --line: rgba(32, 85, 136, 0.14);
  --primary: #1f73c9;
  --primary-deep: #154a86;
  --success: #1c9a67;
  --warning: #cc8b16;
  --danger: #d14f5c;
  --shadow: 0 18px 48px rgba(21, 74, 134, 0.12);
  --radius-lg: 24px;
  --radius-md: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(31, 115, 201, 0.18), transparent 34%),
    radial-gradient(circle at top right, rgba(28, 154, 103, 0.12), transparent 28%),
    linear-gradient(180deg, #f7fbff 0%, var(--bg) 100%);
  color: var(--text);
  font-family: "Segoe UI Variable Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(31, 115, 201, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 115, 201, 0.03) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.35), transparent 80%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.56;
  box-shadow: none;
  transform: none !important;
}

.page-shell {
  position: relative;
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px;
}

.page-shell--narrow {
  max-width: 720px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 24px;
  padding: 28px 30px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 30px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(230, 240, 250, 0.88));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  animation: rise-in 0.5s ease-out;
}

.eyebrow,
.section-kicker {
  margin: 0 0 6px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}

.topbar h1,
.panel h2,
.panel h3 {
  margin: 0;
  font-family: "Georgia", "Songti SC", "STSong", serif;
  letter-spacing: 0.02em;
}

.topbar__subtitle,
.muted {
  margin: 10px 0 0;
  color: var(--text-soft);
}

.topbar__actions,
.section-heading,
.toolbar,
.result-card__header,
.pagination,
.record-meta {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.topbar__actions {
  justify-content: flex-end;
}

.nav-link,
.button,
.tab-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.nav-link {
  color: var(--text-soft);
}

.nav-link--active,
.nav-link:hover {
  color: var(--primary-deep);
  background: rgba(31, 115, 201, 0.1);
}

.button {
  font-weight: 600;
}

.button:hover,
.nav-link:hover,
.upload-dropzone:hover,
.tab-button:hover {
  transform: translateY(-1px);
}

.button--primary,
.tab-button--active {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #3b8fe7);
  box-shadow: 0 12px 24px rgba(31, 115, 201, 0.2);
}

.button--secondary {
  color: var(--primary-deep);
  background: rgba(31, 115, 201, 0.1);
}

.button--ghost,
.tab-button {
  color: var(--primary-deep);
  border-color: rgba(31, 115, 201, 0.18);
  background: rgba(255, 255, 255, 0.78);
}

.dashboard-grid,
.annotate-layout,
.stack-layout,
.stats-grid,
.result-grid,
.form-grid,
.followup-stack {
  display: grid;
  gap: 18px;
}

.dashboard-grid {
  grid-template-columns: 1.15fr 0.85fr;
}

.annotate-layout {
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
}

.stats-grid,
.result-grid,
.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel {
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  animation: rise-in 0.55s ease-out;
}

.auth-panel {
  margin-top: 72px;
}

.auth-form {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.panel--accent {
  background: linear-gradient(180deg, rgba(247, 251, 255, 0.98), rgba(233, 243, 252, 0.9));
}

.upload-dropzone {
  width: 100%;
  padding: 36px 24px;
  margin-top: 18px;
  border-radius: 28px;
  border: 2px dashed rgba(31, 115, 201, 0.35);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.75), rgba(222, 236, 249, 0.85));
  color: var(--primary-deep);
  display: grid;
  gap: 10px;
  text-align: center;
}

.upload-dropzone--dragover {
  border-style: solid;
  box-shadow: 0 0 0 4px rgba(31, 115, 201, 0.08);
}

.upload-dropzone__icon {
  width: 52px;
  height: 52px;
  margin: 0 auto;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 26px;
  color: white;
  background: linear-gradient(135deg, var(--primary), #7bb8ff);
}

.stat-card,
.result-card,
.helper-callout,
.followup-card,
.form-section,
.key-value-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-strong);
}

.stat-card,
.helper-callout,
.result-card,
.form-section,
.followup-card {
  padding: 18px;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 34px;
  line-height: 1;
}

.stat-card--warn strong {
  color: var(--warning);
}

.stat-card--info strong {
  color: var(--primary);
}

.stat-card--success strong {
  color: var(--success);
}

.helper-callout ol {
  margin: 12px 0 0;
  padding-left: 20px;
  color: var(--text-soft);
}

.result-errors {
  margin: 16px 0 0;
  max-height: 180px;
  overflow: auto;
  padding: 12px;
  border-radius: 14px;
  background: #f6f9fd;
  color: var(--text-soft);
  white-space: pre-wrap;
}

.banner {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
}

.banner--info {
  border-color: rgba(31, 115, 201, 0.2);
  background: rgba(233, 243, 252, 0.92);
}

.banner--success {
  border-color: rgba(28, 154, 103, 0.22);
  background: rgba(232, 247, 240, 0.94);
}

.banner--error {
  border-color: rgba(209, 79, 92, 0.24);
  background: rgba(253, 241, 242, 0.96);
}

.banner--rich {
  display: grid;
  gap: 10px;
  box-shadow: 0 12px 28px rgba(209, 79, 92, 0.08);
}

.banner__title {
  font-weight: 700;
  color: var(--text);
}

.banner__summary {
  color: var(--text-soft);
  line-height: 1.6;
}

.banner__tips {
  margin: 0;
  padding-left: 20px;
  color: var(--text);
}

.banner__tips li + li {
  margin-top: 6px;
}

.banner__detail {
  border-top: 1px dashed rgba(209, 79, 92, 0.22);
  padding-top: 10px;
}

.banner__detail summary {
  cursor: pointer;
  color: var(--danger);
  font-weight: 600;
}

.banner__detail pre {
  margin: 10px 0 0;
  max-height: 180px;
  overflow: auto;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text-soft);
  white-space: pre-wrap;
}

.toolbar label,
.form-field {
  display: grid;
  gap: 8px;
  color: var(--text-soft);
  font-size: 13px;
}

.toolbar {
  margin-top: 18px;
  align-items: flex-end;
  flex-wrap: nowrap;
}

.toolbar__group {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: nowrap;
}

.toolbar__group label {
  min-width: 150px;
}

.toolbar__group--grow {
  flex: 1 1 360px;
}

.toolbar__group--grow label {
  min-width: 0;
  flex: 1 1 auto;
}

.toolbar__group .button {
  white-space: nowrap;
}

.inline-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.inline-form-grid--compact {
  margin-top: 0;
}

.workflow-card {
  display: grid;
  gap: 16px;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-strong);
}

.workflow-card--summary {
  align-items: start;
}

.workflow-card--export {
  background: linear-gradient(180deg, rgba(247, 251, 255, 0.98), rgba(233, 243, 252, 0.9));
}

.workflow-card__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.list-status-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.status-chip {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
}

.status-chip strong {
  font-size: 28px;
  line-height: 1;
}

.status-chip--warn strong {
  color: var(--warning);
}

.status-chip--info strong {
  color: var(--primary);
}

.status-chip--success strong {
  color: var(--success);
}

.pending-priority {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(31, 115, 201, 0.18);
  background: linear-gradient(135deg, rgba(31, 115, 201, 0.08), rgba(255, 255, 255, 0.92));
}

.save-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.review-grid {
  border-top: 1px solid rgba(23, 50, 77, 0.08);
  padding-top: 16px;
}

.section-heading--compact {
  align-items: flex-start;
}

.helper-callout--export {
  display: grid;
  gap: 10px;
}

.stepper-shell {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-strong);
  display: grid;
  gap: 12px;
}

.stepper-track {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.stepper-chip {
  border: 1px solid rgba(31, 115, 201, 0.2);
  background: rgba(255, 255, 255, 0.86);
  color: var(--primary-deep);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.stepper-chip:hover {
  transform: translateY(-1px);
}

.stepper-chip--done {
  background: rgba(28, 154, 103, 0.12);
  color: #0f6847;
  border-color: rgba(28, 154, 103, 0.24);
}

.stepper-chip--active {
  background: linear-gradient(135deg, var(--primary), #3b8fe7);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 12px 24px rgba(31, 115, 201, 0.2);
}

.stepper-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stepper-nav__summary {
  margin: 0;
  flex: 1 1 auto;
  text-align: center;
}

.is-hidden {
  display: none !important;
}

.input,
textarea.input {
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  border: 1px solid rgba(31, 115, 201, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
}

textarea.input {
  min-height: 92px;
  resize: vertical;
}

.tabs {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.table-wrap {
  overflow: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 16px 12px;
  border-bottom: 1px solid rgba(23, 50, 77, 0.08);
  text-align: left;
}

.data-table th {
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 600;
}

.table-empty {
  text-align: center !important;
  color: var(--text-soft);
}

.table-empty--rich {
  padding: 30px 16px !important;
  font-size: 14px;
  line-height: 1.7;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(31, 115, 201, 0.12);
  color: var(--primary-deep);
  font-size: 13px;
  font-weight: 600;
}

.tag--warn {
  background: rgba(204, 139, 22, 0.12);
  color: var(--warning);
}

.tag--success {
  background: rgba(28, 154, 103, 0.12);
  color: var(--success);
}

.tag--danger {
  background: rgba(209, 79, 92, 0.12);
  color: var(--danger);
}

.tag--info {
  background: rgba(31, 115, 201, 0.1);
  color: var(--primary);
}

.banner {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid transparent;
}

.banner--error {
  color: #7a2431;
  background: rgba(209, 79, 92, 0.12);
  border-color: rgba(209, 79, 92, 0.16);
}

.banner--success {
  color: #0f6847;
  background: rgba(28, 154, 103, 0.12);
  border-color: rgba(28, 154, 103, 0.18);
}

.banner--info {
  color: var(--primary-deep);
  background: rgba(31, 115, 201, 0.1);
  border-color: rgba(31, 115, 201, 0.16);
}

.key-value-list {
  display: grid;
  margin: 0;
  gap: 12px;
}

.key-value-item {
  padding: 14px;
}

.key-value-item dt {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-soft);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.key-value-item dd {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.raw-value {
  display: grid;
  gap: 6px;
}

.raw-line {
  display: block;
  line-height: 1.6;
}

.raw-line strong {
  color: var(--primary-deep);
}

.followup-card__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1080px) {
  .dashboard-grid,
  .annotate-layout {
    grid-template-columns: 1fr;
  }

  .toolbar {
    flex-wrap: wrap;
  }

  .toolbar__group {
    width: 100%;
    flex-wrap: wrap;
  }

  .toolbar__group label {
    flex: 1 1 220px;
    min-width: 220px;
  }

  .toolbar__group--grow {
    flex-basis: 100%;
  }
}

@media (max-width: 760px) {
  .page-shell {
    padding: 16px;
  }

  .stats-grid,
  .result-grid,
  .form-grid,
  .inline-form-grid {
    grid-template-columns: 1fr;
  }

  .list-status-overview {
    grid-template-columns: 1fr;
  }

  .pending-priority {
    flex-direction: column;
    align-items: stretch;
  }

  .save-actions {
    justify-content: stretch;
  }

  .workflow-card__actions {
    justify-content: stretch;
  }

  .toolbar__group label {
    flex-basis: 100%;
    min-width: 0;
  }

  .stepper-nav {
    flex-direction: column;
    align-items: stretch;
  }

  .stepper-nav__summary {
    text-align: left;
  }
}
