/* ============================================================================
   基础：重置 + 排版 + 通用原子类
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-700);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1 {
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.015em;
  color: var(--ink-900);
}

h2 {
  font-size: 15px;
  font-weight: 620;
  letter-spacing: -0.01em;
  color: var(--ink-900);
}

h3 {
  font-size: 13px;
  font-weight: 620;
  color: var(--ink-700);
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}

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

a {
  color: var(--tiffany-600);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  display: block;
  max-width: 100%;
}

svg {
  display: block;
  flex: none;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: var(--r-sm);
}

::selection {
  background: var(--tiffany-100);
  color: var(--ink-900);
}

/* 滚动条：细、浅、不抢视线 */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--ink-200) transparent;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-thumb {
  background: var(--ink-200);
  border-radius: var(--r-pill);
}

*::-webkit-scrollbar-track {
  background: transparent;
}

/* ---------- 原子类：只保留高频使用的 ---------- */
.num {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

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

.dim {
  color: var(--ink-500);
}

.strong {
  color: var(--ink-900);
  font-weight: 600;
}

.tiny {
  font-size: 12px;
}

.small {
  font-size: 13px;
}

.nowrap {
  white-space: nowrap;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}

.row-tight {
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.row-tight > .field__hint,
.row-tight > .muted {
  white-space: nowrap;
  flex: none;
}

.col {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
}

.between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
}

.wrap {
  flex-wrap: wrap;
}

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

.right {
  text-align: right;
}

.center {
  text-align: center;
}

.stack-2 {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.stack-3 {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.stack-4 {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}
.stack-5 {
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
}
.stack-6 {
  display: flex;
  flex-direction: column;
  gap: var(--s-6);
}

/* ---------- 启动遮罩 ---------- */
.boot {
  position: fixed;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: var(--s-5);
  background: var(--canvas);
  z-index: 90;
}

.boot__mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(140deg, var(--tiffany-300), var(--tiffany-600));
  box-shadow: 0 12px 30px rgba(10, 186, 181, 0.28);
  animation: boot-pulse 1.6s var(--ease) infinite;
}

.boot__text {
  font-size: 13px;
  color: var(--ink-400);
  letter-spacing: 0.02em;
}

@keyframes boot-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(0.9);
    opacity: 0.72;
  }
}

.noscript {
  position: fixed;
  inset: auto 0 0;
  padding: var(--s-4);
  background: var(--warn-bg);
  color: var(--warn);
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
  }
}
