/* Reset & Base */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: var(--theme-transition);
}

button, input, select { font: inherit; }
button { background: none; border: none; cursor: pointer; color: inherit; }
input { outline: none; }
a { color: inherit; text-decoration: none; }

/* 键盘焦点环 */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

/* 图标 */
.icon-svg { display: block; flex-shrink: 0; }
.icon { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: var(--radius-full);
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); background-clip: padding-box; }

/* Animations */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid var(--border-strong); border-top-color: var(--text-secondary);
  border-radius: 50%; animation: spin 0.6s linear infinite;
}

.spinner-small {
  width: 14px; height: 14px;
  border: 2px solid var(--accent-soft);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.loading-overlay {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center; z-index: 10;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  color: var(--text-muted); font-size: var(--fs-sm);
}

/* 空状态 */
.empty-state {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 40px 16px; color: var(--text-muted); font-size: var(--fs-md);
  text-align: center;
}
.empty-state svg { opacity: 0.5; }
