/* ========================================
   基础层：reset、页面背景、滚动条、工具类、共享动画
   ======================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text-primary);
  line-height: 1.6;
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
  position: relative;
}

/* 柔光层1 — 顶部暖金光晕 */
body::before {
  content: '';
  position: fixed;
  top: -32%;
  left: 50%;
  transform: translateX(-50%);
  width: 85%;
  height: 70%;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 0%,
    rgba(201, 169, 78, 0.10) 0%,
    rgba(201, 169, 78, 0.04) 35%,
    transparent 68%);
  filter: blur(70px);
}

/* 柔光层2 — 右下角暖灰 */
body::after {
  content: '';
  position: fixed;
  bottom: -18%;
  right: -12%;
  width: 55%;
  height: 50%;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center,
    rgba(176, 138, 53, 0.05) 0%,
    transparent 70%);
  filter: blur(60px);
}

/* 点阵纹理 — 极淡暖灰点阵，增加纸感层次 */
.background-dots {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image: radial-gradient(rgba(90, 80, 50, 0.07) 1px, transparent 1px);
  background-size: 22px 22px;
}

::selection {
  background: rgba(201, 169, 78, 0.22);
  color: var(--color-text-primary);
}

input, textarea, select, button { font-family: inherit; font-size: inherit; }

a { color: inherit; text-decoration: none; }

/* ---- 滚动条 ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-border-strong); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-text-muted); }

/* ---- 工具类 ---- */
.hidden { display: none !important; }

/* ---- 共享动画（各组件共用，避免重复定义） ---- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes logIn {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(100%) scale(0.95); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateX(100%) scale(0.95); }
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.92) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 执行中任务卡片的呼吸光晕（金色系） */
@keyframes executingPulse {
  0%, 100% {
    box-shadow: 0 0 0 1px rgba(165, 130, 46, 0.25), 0 0 14px rgba(165, 130, 46, 0.10);
  }
  50% {
    box-shadow: 0 0 0 1px rgba(165, 130, 46, 0.45), 0 0 24px rgba(165, 130, 46, 0.20);
  }
}
