:root {
  --ink-strong: #0f172a;
  --ink-soft: #475467;
  --ink-faint: #667085;
  --accent: #0071e3;
  --accent-strong: #0058b0;
  --danger: #dc2626;
  --surface-strong: rgba(255, 255, 255, 0.9);
  --surface-soft: rgba(255, 255, 255, 0.76);
  --surface-line: rgba(15, 23, 42, 0.09);
  --radius-panel: 28px;
  --radius-card: 22px;
  --radius-input: 15px;
  --shadow-panel: 0 28px 80px rgba(15, 23, 42, 0.14);
  --shadow-soft: 0 12px 32px rgba(15, 23, 42, 0.1);
  --shadow-hover: 0 16px 36px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink-strong);
  font-family: "SF Pro Display", "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  background:
    radial-gradient(1200px 800px at -12% -8%, rgba(0, 113, 227, 0.13), rgba(0, 113, 227, 0) 62%),
    radial-gradient(1000px 700px at 108% 104%, rgba(95, 145, 210, 0.14), rgba(95, 145, 210, 0) 60%),
    linear-gradient(160deg, #f8fafc 0%, #eef2f7 48%, #f6f8fb 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  color: #0b1220;
  letter-spacing: -0.02em;
}

h1 {
  font-weight: 740;
}

p {
  color: var(--ink-soft);
}

.glass-panel {
  background: linear-gradient(165deg, var(--surface-strong), rgba(255, 255, 255, 0.82));
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: var(--radius-panel);
  backdrop-filter: blur(22px) saturate(145%);
  -webkit-backdrop-filter: blur(22px) saturate(145%);
  box-shadow: var(--shadow-panel);
}

.glass-sub {
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.92), var(--surface-soft));
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.glass-sub:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}

.bg-orb {
  position: fixed;
  border-radius: 9999px;
  pointer-events: none;
  filter: blur(2px);
}

.bg-orb-a {
  width: 30rem;
  height: 30rem;
  top: -12rem;
  left: -8rem;
  background: radial-gradient(circle at 34% 35%, rgba(0, 113, 227, 0.28), rgba(0, 113, 227, 0));
}

.bg-orb-b {
  width: 26rem;
  height: 26rem;
  right: -8rem;
  bottom: -7rem;
  background: radial-gradient(circle at 58% 48%, rgba(116, 146, 186, 0.24), rgba(116, 146, 186, 0));
}

.bg-noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.16;
  background-image: radial-gradient(rgba(148, 163, 184, 0.18) 0.5px, transparent 0.5px);
  background-size: 4px 4px;
}

.step-pill {
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.step-pill:hover {
  transform: translateY(-1px);
}

.step-pill.active {
  background: linear-gradient(135deg, var(--accent), #2f8cff);
  color: #fff;
  border-color: rgba(0, 113, 227, 0.38);
  box-shadow: 0 14px 28px rgba(0, 113, 227, 0.28);
}

.soft-input,
.soft-select,
.soft-textarea {
  width: 100%;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: var(--radius-input);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink-strong);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.soft-input,
.soft-select {
  height: 2.7rem;
  padding: 0 0.9rem;
}

.soft-textarea {
  min-height: 8.5rem;
  padding: 0.82rem 0.9rem;
  resize: vertical;
}

.soft-input:hover,
.soft-select:hover,
.soft-textarea:hover {
  border-color: rgba(0, 113, 227, 0.36);
}

.soft-input:focus,
.soft-select:focus,
.soft-textarea:focus {
  border-color: rgba(0, 113, 227, 0.66);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.14);
  background: #fff;
}

.custom-select {
  position: relative;
  min-width: 5rem;
}

.custom-select-trigger {
  width: 100%;
  height: 2.7rem;
  border-radius: var(--radius-input);
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.85));
  color: var(--ink-strong);
  padding: 0 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.custom-select-trigger:hover {
  border-color: rgba(0, 113, 227, 0.36);
}

.custom-select.open .custom-select-trigger {
  border-color: rgba(0, 113, 227, 0.68);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.14);
}

.custom-select-value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.custom-select-caret {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #6b7280;
  transition: transform 0.18s ease;
}

.custom-select.open .custom-select-caret {
  transform: rotate(180deg);
}

.custom-select-menu {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  right: 0;
  z-index: 35;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.17);
  padding: 0.34rem;
  display: none;
  max-height: 17rem;
  overflow: auto;
}

.custom-select.open .custom-select-menu {
  display: block;
}

.custom-select-item {
  width: 100%;
  border: 0;
  background: transparent;
  border-radius: 11px;
  text-align: left;
  padding: 0.52rem 0.6rem;
  font-size: 0.8rem;
  color: #1f2937;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.custom-select-item:hover {
  background: rgba(0, 113, 227, 0.09);
  color: #111827;
}

.custom-select-item.is-selected {
  background: rgba(0, 113, 227, 0.15);
  color: #0058b0;
  font-weight: 700;
}

.custom-select.is-compact .custom-select-trigger {
  height: 2.25rem;
  font-size: 0.76rem;
  border-radius: 13px;
}

.custom-select.is-tight .custom-select-trigger {
  height: 2.05rem;
  font-size: 0.75rem;
  border-radius: 12px;
}

.custom-select.is-disabled {
  opacity: 0.56;
}

.custom-select.is-disabled .custom-select-trigger {
  cursor: not-allowed;
}

.btn {
  border-radius: 999px;
  padding: 0.62rem 1.05rem;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease, background-color 0.2s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.54;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #3e9aff);
  box-shadow: 0 14px 28px rgba(0, 113, 227, 0.28);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 18px 30px rgba(0, 113, 227, 0.34);
  filter: saturate(108%);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(15, 23, 42, 0.13);
  color: #0f172a;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

.btn-ghost:hover:not(:disabled) {
  background: #fff;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.1);
}

.btn-danger {
  color: #fff;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 12px 24px rgba(220, 38, 38, 0.27);
}

.btn-danger:hover:not(:disabled) {
  box-shadow: 0 16px 30px rgba(220, 38, 38, 0.32);
}

.btn-soft-red {
  color: #9f2f2f;
  background: linear-gradient(135deg, #fff2f2, #ffe7e7);
  border-color: rgba(239, 68, 68, 0.28);
  box-shadow: 0 8px 16px rgba(239, 68, 68, 0.14);
}

.btn-soft-red:hover:not(:disabled) {
  background: linear-gradient(135deg, #ffe9e9, #ffdddd);
  box-shadow: 0 12px 20px rgba(239, 68, 68, 0.18);
}

.sample-item {
  cursor: pointer;
  border-radius: 16px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.sample-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.09);
}

.sample-item.active {
  border-color: rgba(0, 113, 227, 0.46);
  background: linear-gradient(150deg, rgba(0, 113, 227, 0.1), rgba(0, 113, 227, 0.05));
}

.metric-card {
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.09);
  background: rgba(255, 255, 255, 0.92);
  padding: 0.92rem 0.95rem;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.matrix-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.09);
  border-radius: 14px;
  overflow: hidden;
}

.matrix-table th,
.matrix-table td {
  border-right: 1px solid rgba(15, 23, 42, 0.08);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  padding: 0.38rem 0.48rem;
  text-align: center;
  font-size: 0.78rem;
  white-space: nowrap;
  height: 2.1rem;
}

.matrix-table tr > *:last-child {
  border-right: 0;
}

.matrix-table tr:last-child > * {
  border-bottom: 0;
}

.matrix-table th {
  background: rgba(248, 250, 252, 0.92);
  color: var(--ink-faint);
  font-weight: 700;
}

.sheet-table {
  table-layout: fixed;
  border-radius: 0;
  border: 0;
  background: transparent;
}

.sheet-table td {
  padding: 0;
}

.sheet-table th,
.sheet-table td {
  width: calc(100% / var(--sheet-cols, 6));
}

.row-head {
  text-align: center !important;
  color: #344054;
  font-weight: 700;
  background: rgba(248, 250, 252, 0.96) !important;
}

.sheet-input {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0.45rem 0.34rem;
  text-align: center;
  font-size: 0.74rem;
  color: #0f172a;
  outline: none;
}

.sheet-input:focus {
  box-shadow: inset 0 0 0 2px rgba(0, 113, 227, 0.55);
  background: rgba(255, 255, 255, 0.96);
}

.sheet-table td.cell-selected {
  box-shadow: inset 0 0 0 2px rgba(0, 113, 227, 0.45);
}

.concentration-row th,
.concentration-row td {
  background: linear-gradient(180deg, #eff7ff, #e5f2ff) !important;
  color: #0b63c2;
  font-weight: 700;
}

.matrix-table td.outlier {
  background: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
  font-weight: 700;
}

.fade-up {
  animation: fadeUp 0.42s cubic-bezier(0.2, 0.7, 0.2, 1);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translate3d(0, 12px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.42);
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.7);
}

::-webkit-scrollbar-track {
  background: rgba(248, 250, 252, 0.8);
}

@media (max-width: 1024px) {
  .glass-panel {
    border-radius: 22px;
  }

  .glass-sub {
    border-radius: 18px;
  }
}

@media (max-width: 768px) {
  .glass-panel {
    border-radius: 18px;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.12);
  }

  .glass-sub {
    border-radius: 16px;
  }

  .btn {
    font-size: 0.82rem;
    padding: 0.54rem 0.9rem;
  }

  .custom-select-trigger,
  .soft-input,
  .soft-select {
    height: 2.5rem;
  }
}

.cck8-modal-layer {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.cck8-modal-layer.hidden {
  display: none;
}

.cck8-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.cck8-modal {
  position: relative;
  width: min(980px, calc(100vw - 32px));
  max-height: min(88vh, 980px);
  overflow: auto;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.9));
  box-shadow: 0 28px 72px rgba(15, 23, 42, 0.3);
  padding: 22px 24px 18px;
}

.cck8-modal-title {
  font-size: 1.12rem;
  font-weight: 740;
  color: #0f172a;
  margin-bottom: 10px;
}

.cck8-modal-body {
  font-size: 0.94rem;
  line-height: 1.72;
  color: #334155;
  white-space: normal;
  margin-bottom: 16px;
  padding: 2px 2px 4px;
}

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

.cck8-help p {
  margin: 0 0 10px;
}

.cck8-help p:last-child {
  margin-bottom: 0;
}

.cck8-help {
  display: grid;
  gap: 12px;
}

.cck8-help-section {
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.9);
  padding: 12px 14px;
}

.cck8-help-section h4 {
  margin: 0 0 8px;
  font-size: 0.98rem;
  color: #0f172a;
  font-weight: 730;
}

.cck8-help-list {
  margin: 0;
  padding-left: 18px;
  color: #334155;
}

.cck8-help-list li {
  margin: 0 0 6px;
}

.cck8-help-list li:last-child {
  margin-bottom: 0;
}

.settings-fold {
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.78);
  padding: 8px 10px 10px;
}

.settings-fold + .settings-fold {
  margin-top: 10px;
}

.settings-fold > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  font-size: 0.84rem;
  font-weight: 700;
  color: #334155;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.settings-fold > summary::-webkit-details-marker {
  display: none;
}

.settings-fold > summary::after {
  content: '展开';
  font-size: 0.74rem;
  color: #64748b;
}

.settings-fold[open] > summary::after {
  content: '收起';
}
