/* ============================================
   家庭网站 全局样式 v2（全面美化）
   ============================================ */
:root {
  --primary: #e07a5f;
  --primary-dark: #c9654a;
  --primary-light: #f5b8a4;
  --accent: #3d405b;
  --accent-2: #5d6a9e;
  --bg: #f6f4f1;
  --card: #ffffff;
  --text: #2f2a28;
  --muted: #948d87;
  --border: #e9e2db;
  --green: #2a9d8f;
  --red: #d64545;
  --warn: #e9a23b;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 3px rgba(61, 64, 91, 0.06), 0 4px 14px rgba(61, 64, 91, 0.06);
  --shadow-lg: 0 10px 30px rgba(61, 64, 91, 0.14);
  --font: "Segoe UI", "Microsoft YaHei", "PingFang SC", "Helvetica Neue", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(224, 122, 95, 0.08), transparent 60%),
    radial-gradient(900px 400px at 10% -20%, rgba(93, 106, 158, 0.08), transparent 60%),
    var(--bg);
  color: var(--text);
  line-height: 1.65;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary-dark); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--primary); }

::selection { background: rgba(224, 122, 95, 0.25); }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d6cfc8; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #c2b9b0; }
::-webkit-scrollbar-track { background: transparent; }

.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.container.narrow { max-width: 600px; }
.container.wide { max-width: 1280px; }
main.container { flex: 1; padding-top: 30px; padding-bottom: 60px; }

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 2px 12px rgba(61, 64, 91, 0.25);
}
.header-inner { display: flex; align-items: center; gap: 20px; padding: 12px 20px; flex-wrap: wrap; }
.brand {
  font-size: 1.3rem; font-weight: 800; color: #fff !important;
  letter-spacing: 0.5px; display: flex; align-items: center; gap: 8px;
}
.brand:hover { opacity: 0.9; text-decoration: none; }
.nav { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; }
.nav a {
  color: rgba(255, 255, 255, 0.85);
  padding: 7px 13px; border-radius: 9px; font-size: 0.95rem;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav a:hover { background: rgba(255, 255, 255, 0.12); text-decoration: none; color: #fff; }
.nav a.active { background: rgba(255, 255, 255, 0.22); color: #fff; font-weight: 600; }
.nav-user { display: flex; align-items: center; gap: 10px; }
.user-badge {
  font-size: 0.88rem; opacity: 0.95; padding: 4px 10px;
  background: rgba(255, 255, 255, 0.14); border-radius: 20px;
}
.nav-toggle {
  display: none;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff; font-size: 1.2rem; line-height: 1;
  padding: 6px 12px; border-radius: 9px; cursor: pointer;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block;
  padding: 9px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  font-size: 0.95rem; font-family: inherit; font-weight: 500;
  cursor: pointer;
  transition: all 0.16s ease;
  text-decoration: none !important;
  box-shadow: 0 1px 2px rgba(61, 64, 91, 0.05);
}
.btn:hover {
  border-color: var(--primary); color: var(--primary-dark);
  transform: translateY(-1px); box-shadow: var(--shadow);
}
.btn:active { transform: translateY(0); }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); border-color: transparent; color: #fff; }
.btn-primary:hover { background: linear-gradient(135deg, var(--primary-dark), var(--primary-dark)); color: #fff; }
.btn-danger { background: linear-gradient(135deg, #e05a5a, #c93d3d); border-color: transparent; color: #fff; }
.btn-danger:hover { color: #fff; }
.btn-ghost { background: transparent; border-color: rgba(255, 255, 255, 0.5); color: #fff; box-shadow: none; }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.15); border-color: #fff; color: #fff; }
.btn-warn { background: linear-gradient(135deg, var(--warn), #d98a22); border-color: transparent; color: #fff; }
.btn-warn:hover { color: #fff; }
.btn-ok { background: linear-gradient(135deg, var(--green), #21867a); border-color: transparent; color: #fff; }
.btn-ok:hover { color: #fff; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.btn-sm { padding: 5px 11px; font-size: 0.85rem; border-radius: 7px; }
.btn-block { display: block; width: 100%; }
.inline-form { display: inline-block; margin: 0 2px; }
.form-actions { display: flex; gap: 10px; margin-top: 16px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  transition: box-shadow 0.2s ease;
}
.card h2 { margin: 0 0 14px; font-size: 1.3rem; }
.card h3 { margin: 0 0 8px; font-size: 1.05rem; }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 6px 2px 16px; gap: 12px; flex-wrap: wrap;
}
.card-head h2 { margin: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { text-align: center; }
.stat-card .big { font-size: 2.1rem; font-weight: 800; margin: 6px 0 0; color: var(--primary-dark); }
.link-card { display: block; color: var(--text); }
.link-card:hover {
  border-color: var(--primary-light); color: var(--text);
  box-shadow: var(--shadow-lg); transform: translateY(-3px); text-decoration: none;
}
.link-card p { color: var(--muted); font-size: 0.9rem; margin: 0; }
.upload-card { background: linear-gradient(180deg, #fdfaf7, #fff); }

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: 52px 24px 40px;
  background: linear-gradient(160deg, #fff, #fdf0ea 55%, #fbe8df);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
  position: relative; overflow: hidden;
}
.hero::before {
  content: "🏡";
  position: absolute; font-size: 7rem; opacity: 0.06;
  right: -10px; bottom: -20px; transform: rotate(-12deg);
}
.hero h1 { margin: 0 0 10px; font-size: 2.1rem; letter-spacing: 0.5px; }
.hero-sub { color: var(--muted); margin: 0 0 24px; font-size: 1.08rem; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- 列表 / 表格 ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 13px 4px; border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.list li:last-child { border-bottom: none; }
.list li:hover { background: #fdfaf7; }
.list a { font-weight: 500; }
.muted { color: var(--muted); font-size: 0.9rem; }
.center { text-align: center; }

.table-card { padding: 12px 16px; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.table th, .table td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { color: var(--muted); font-weight: 600; white-space: nowrap; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.4px; }
.table tr:hover td { background: #faf7f4; }
.table.kv th { width: 160px; }
.thumb { width: 72px; height: 54px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.actions { white-space: nowrap; }
.tag {
  display: inline-block; padding: 3px 11px; border-radius: 20px; font-size: 0.8rem;
  font-weight: 500; vertical-align: middle;
}
.tag-green { background: #e2f3f0; color: #1f7a6e; }
.tag-red { background: #fbe9e9; color: #a83737; }

/* ---------- 表单 ---------- */
.form label { display: block; margin-bottom: 15px; font-size: 0.95rem; font-weight: 600; }
.form input[type="text"], .form input[type="password"], .form input[type="email"],
.form input[type="file"], .form select, .form textarea {
  display: block; width: 100%; margin-top: 6px;
  padding: 11px 13px; font-size: 0.95rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: #fff; color: var(--text); font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form input:focus, .form select:focus, .form textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(224, 122, 95, 0.15);
}
.form small { display: block; color: var(--muted); font-weight: 400; margin-top: 4px; }
.form hr { border: none; border-top: 1px solid var(--border); margin: 18px 0; }
.form .check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.form .check input { width: auto; margin: 0; }
.form-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.form-row input[type="text"] { flex: 1; min-width: 160px; width: auto; margin-top: 0; }

.pw-reset { display: inline-block; vertical-align: middle; }
.pw-reset summary { cursor: pointer; list-style: none; }
.pw-reset form { margin-top: 8px; display: flex; gap: 6px; }

.rename-input {
  width: 90px; padding: 5px 8px; font-size: 0.85rem;
  border: 1px solid var(--border); border-radius: 7px; font-family: inherit;
}
.rename-input:focus { outline: none; border-color: var(--primary); }

/* ---------- 提示条 ---------- */
.flash {
  padding: 13px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 0.95rem;
  animation: flashIn 0.3s ease;
}
@keyframes flashIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.flash.success { background: #e2f3f0; color: #1f7a6e; border: 1px solid #bfe3dc; }
.flash.error { background: #fbe9e9; color: #a03030; border: 1px solid #f0c4c4; }

/* ---------- 相册 ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 18px;
}
.photo-card {
  margin: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.photo-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.photo-card .img-wrap { display: block; overflow: hidden; background: #f1ede8; }
.photo-card img {
  width: 100%; height: 195px; object-fit: cover; display: block;
  transition: transform 0.3s ease;
}
.photo-card:hover img { transform: scale(1.05); }
.photo-card figcaption { padding: 12px 14px; }
.photo-card figcaption strong { display: block; font-size: 0.95rem; }
.photo-card figcaption .muted { display: block; font-size: 0.82rem; }
.photo-card figcaption .inline-form { margin-top: 8px; }
.tags {
  display: inline-block; margin-top: 8px; padding: 3px 10px;
  background: #fdf1ec; border: 1px solid #f5d8cd; color: var(--primary-dark);
  border-radius: 20px; font-size: 0.8rem; line-height: 1.5;
}
.ai-desc { margin-top: 6px; }
.photo-actions { display: flex; gap: 6px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.photo-actions .inline-form { margin: 0; }

.search-bar {
  display: flex; gap: 10px; align-items: center;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px; margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.search-bar input[type="text"] {
  flex: 1; padding: 10px 13px; font-size: 0.95rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm); font-family: inherit;
}
.search-bar input[type="text"]:focus { outline: none; border-color: var(--primary); }

/* ---------- AI 状态栏 / 人脸分类 ---------- */
.ai-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 14px 20px; flex-wrap: wrap;
}
.ai-status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ai-status strong { font-size: 1.05rem; }
.ai-status small { display: block; width: 100%; }
.ai-bar-warn { border-color: #f0c9bb; background: #fff8f5; }

.people-card { padding: 16px 20px; }
.people-row {
  display: flex; gap: 14px; overflow-x: auto; padding: 6px 2px 12px;
  -webkit-overflow-scrolling: touch;
}
.person-chip {
  flex: 0 0 auto; width: 96px; text-align: center; color: var(--text);
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 10px 6px 8px; box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.person-chip:hover { border-color: var(--primary-light); transform: translateY(-3px); box-shadow: var(--shadow-lg); text-decoration: none; }
.person-chip img { width: 62px; height: 62px; border-radius: 50%; object-fit: cover; display: block; margin: 0 auto; border: 2px solid #f5ece6; }
.person-chip .face-placeholder { width: 62px; height: 62px; border-radius: 50%; font-size: 1.8rem; margin: 0 auto; display: flex; align-items: center; justify-content: center; background: #f1ede8; }
.person-chip span { display: block; font-size: 0.85rem; font-weight: 600; margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-chip small { color: var(--muted); font-size: 0.75rem; }
.person-banner { background: linear-gradient(120deg, #fff8f4, #fff); }
.person-banner-main { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.person-banner-main img { width: 66px; height: 66px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border); }
.person-rename { display: flex; gap: 6px; align-items: center; }

/* ---------- 家庭网盘 ---------- */
.path-bar { padding: 8px 4px 12px; font-size: 0.95rem; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.path-bar a { font-weight: 500; }

/* ---------- 人脸（兼容旧样式） ---------- */
.face-sample-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.face-sample { width: 64px; height: 64px; object-fit: cover; border-radius: 50%; border: 2px solid var(--border); }

/* ---------- AI 助手 ---------- */
.chat-box {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; min-height: 340px; max-height: 58vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px;
}
.chat-msg { display: flex; align-items: flex-end; }
.chat-user { justify-content: flex-end; }
.chat-ai { justify-content: flex-start; }
.chat-bubble {
  max-width: 78%; padding: 11px 15px; border-radius: 15px; font-size: 0.95rem;
  white-space: pre-wrap; word-break: break-word;
  animation: bubbleIn 0.2s ease;
}
@keyframes bubbleIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.chat-user .chat-bubble {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-ai .chat-bubble { background: #f3efe9; border-bottom-left-radius: 4px; }
.chat-input { display: flex; gap: 10px; }
.chat-input input[type="text"] {
  flex: 1; padding: 12px 15px; font-size: 1rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm); font-family: inherit;
}
.chat-input input[type="text"]:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(224, 122, 95, 0.12); }

/* 打字动画（三点） */
.typing-dots { display: inline-flex; gap: 4px; align-items: center; padding: 4px 2px; }
.typing-dots span {
  width: 7px; height: 7px; border-radius: 50%; background: var(--muted);
  animation: typingBlink 1.2s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBlink { 0%, 80%, 100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

/* ---------- 错误页 ---------- */
.error-card { text-align: center; padding: 60px 20px; }
.error-code { font-size: 4.2rem; margin: 0; color: var(--primary-dark); font-weight: 800; }

/* ---------- 步骤 ---------- */
.steps { padding-left: 20px; }
.steps li { margin-bottom: 8px; }
code { background: #f1ede8; padding: 2px 6px; border-radius: 4px; font-size: 0.9em; }

/* ---------- AI 生图 ---------- */
.gen-img {
  max-width: 100%; max-height: 512px;
  border-radius: var(--radius); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg); margin-bottom: 12px;
}
#genPrompt {
  width: 100%; padding: 12px 14px; font-size: 0.95rem; font-family: inherit;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
#genPrompt:focus { outline: none; border-color: var(--primary); }

/* ---------- 系统占用条 ---------- */
.sysbar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 18px; margin-bottom: 18px; box-shadow: var(--shadow);
  font-size: 0.9rem;
}
.sysbar-title { font-weight: 700; }
.sysbar-item b { font-weight: 600; color: var(--primary-dark); }
.sysbar-ai { margin-left: auto; display: flex; gap: 6px; }
.ai-dot {
  font-size: 0.75rem; padding: 2px 9px; border-radius: 20px;
  background: #f1ede8; color: var(--muted); border: 1px solid var(--border);
}
.ai-dot.on { background: #e2f3f0; color: #1f7a6e; border-color: #bfe3dc; font-weight: 600; }

/* ---------- 页脚 ---------- */
.site-footer {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: rgba(255, 255, 255, 0.78);
  text-align: center; padding: 20px 0; font-size: 0.9rem; margin-top: auto;
}
.site-footer a { color: #fff; }

/* ============================================
   加载指示（转圈 / 进度条 / 图片占位）
   ============================================ */

/* 全屏遮罩 */
#loadingOverlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(255, 255, 255, 0.9); /* 移动端避免 backdrop-filter 模糊（吃 GPU 导致卡顿） */
  display: none;
  align-items: center; justify-content: center; flex-direction: column; gap: 16px;
}
#loadingOverlay.show { display: flex; }
#loadingOverlay .spinner { width: 46px; height: 46px; }
#loadingOverlay .loading-text { color: var(--muted); font-size: 0.95rem; animation: pulse 1.6s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

/* 转圈 */
.spinner {
  width: 22px; height: 22px;
  border: 3px solid rgba(224, 122, 95, 0.25);
  border-top-color: var(--primary);
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.8s linear infinite;
}
.spinner.light { border-color: rgba(255, 255, 255, 0.3); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 顶部进度条（页面跳转） */
#topBar {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  z-index: 9998; border-radius: 0 3px 3px 0;
  transition: width 0.2s ease, opacity 0.3s ease;
  opacity: 0;
}
#topBar.run { opacity: 1; }

/* 图片加载占位 */
.img-wrap img, .photo-card img {
  background: linear-gradient(110deg, #f1ede8 8%, #faf7f4 18%, #f1ede8 33%);
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
}
@keyframes shimmer { to { background-position-x: -200%; } }
.photo-card img.loaded { background: none; animation: none; }

/* ---------- 响应式（移动端） ---------- */
.nav-backdrop {
  position: fixed; inset: 0; z-index: 99;
  background: rgba(20, 20, 30, 0.35);
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}
.nav-backdrop.show { opacity: 1; pointer-events: auto; }

@media (max-width: 720px) {
  .header-inner { gap: 10px; position: relative; }
  .nav-toggle { display: block; order: 2; }
  .nav {
    /* 纯 transform/opacity 动画：GPU 合成，移动端丝滑不卡顿 */
    position: absolute; top: calc(100% + 6px); left: 10px; right: 10px; z-index: 120;
    display: flex; flex-direction: column; gap: 2px;
    background: rgba(61, 64, 91, 0.98);
    border-radius: 12px; padding: 10px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
    opacity: 0; visibility: hidden;
    transform: translateY(-14px);
    transition: transform 0.26s cubic-bezier(0.4, 0, 0.2, 1),
      opacity 0.22s ease, visibility 0.26s;
  }
  .nav.open { opacity: 1; visibility: visible; transform: none; }
  .nav a { padding: 11px 14px; font-size: 1rem; border-radius: 8px; }
  .nav-user { order: 3; margin-left: auto; }
  .brand { order: 1; }
  .list li { flex-direction: column; align-items: flex-start; gap: 4px; }
  .hero { padding: 34px 16px 28px; }
  .hero h1 { font-size: 1.7rem; }
  .photo-card img { height: auto; max-height: 280px; }
  .photo-card:hover img { transform: none; }
  .chat-bubble { max-width: 90%; }
  .table { font-size: 0.85rem; }
  .form-row { flex-direction: column; align-items: stretch; }
  .form-row input[type="text"], .form-row input[type="file"] { width: 100%; min-width: 0; }
  .search-bar { flex-wrap: wrap; }
  .search-bar input[type="text"] { min-width: 0; }
  .card { padding: 18px 16px; }
  /* 移动端入场动画更轻量，取消交错延迟 */
  @keyframes fadeUpMobile { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
  main > .card, main > .card-head, main > .sysbar, main > .search-bar,
  main > .gallery-grid, main > .people-card, main > .chat-box, main > .chat-input,
  main > .hero, main > .cards, main > .person-banner {
    animation: fadeUpMobile 0.3s ease both;
  }
  main > *:nth-child(n+2) { animation-delay: 0s; }
}

/* ---------- 动画质感 ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
main > .card, main > .card-head, main > .sysbar, main > .search-bar,
main > .gallery-grid, main > .people-card, main > .chat-box, main > .chat-input,
main > .hero, main > .cards, main > .person-banner {
  animation: fadeUp 0.45s ease both;
}
main > *:nth-child(2) { animation-delay: 0.06s; }
main > *:nth-child(3) { animation-delay: 0.12s; }
main > *:nth-child(4) { animation-delay: 0.18s; }
main > *:nth-child(5) { animation-delay: 0.24s; }
main > *:nth-child(6) { animation-delay: 0.3s; }

/* 按钮按压反馈 */
.btn:active { transform: translateY(1px) scale(0.97); }

/* 桌面导航悬停下划线滑入 */
@media (min-width: 721px) {
  .nav a { position: relative; }
  .nav a::after {
    content: ''; position: absolute; left: 12px; right: 12px; bottom: 3px;
    height: 2px; background: #fff; border-radius: 2px;
    transform: scaleX(0); transform-origin: left;
    transition: transform 0.25s ease;
  }
  .nav a:hover::after, .nav a.active::after { transform: scaleX(1); }
}

/* 系统占用数值变化脉冲 */
@keyframes valPulse {
  0% { color: var(--primary); }
  100% { color: var(--primary-dark); }
}
.sysbar-item b.pulse { animation: valPulse 0.6s ease; }

/* 尊重系统"减少动画"设置 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
