/* base.css — 重置、排版基元、布局容器 */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.75;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--selection);
}

h1, h2, h3, h4, p, ul, ol, figure {
  margin: 0 0 1em;
}
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.35;
}
p:last-child {
  margin-bottom: 0;
}

a {
  color: inherit;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

button {
  font-family: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.mono { font-family: var(--font-mono); font-size: 0.92em; }
.serif { font-family: var(--font-serif); }
.dim { color: var(--fg-dim); }
.faint { color: var(--fg-faint); }

.rowlink {
  display: block;
  color: inherit;
}
.rowlink:hover { text-decoration: none; }

/* 内容容器 */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* 视图切换入场 */
.view {
  animation: arc-fade 0.5s var(--ease);
}
@keyframes arc-fade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.pop {
  animation: arc-pop 0.4s var(--ease);
}
@keyframes arc-pop {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

/* 加载 / 空态 */
.loading {
  padding: 80px 0;
  text-align: center;
  color: var(--fg-faint);
}
.loading::before {
  content: '';
  display: inline-block;
  width: 18px; height: 18px;
  margin-right: 10px;
  vertical-align: -3px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: arc-spin 0.8s linear infinite;
}
@keyframes arc-spin { to { transform: rotate(360deg); } }

.empty {
  padding: 60px 24px;
  text-align: center;
  color: var(--fg-faint);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  margin: 24px 0;
}

.hint {
  color: var(--fg-faint);
  font-size: 13px;
  margin-top: 20px;
  text-align: center;
}

.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;
}

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