/* 万星门店工作台 · 3D 与景深 */

/* 卡片从下方带一点俯角翻入 */
@keyframes rise3d {
  from { opacity: 0; transform: perspective(1100px) translate3d(0, 18px, -40px) rotateX(9deg); }
  to { opacity: 1; transform: none; }
}

/* 悬停倾斜 + 柔光 */
.tilt {
  position: relative;
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transform-style: preserve-3d;
  transition: transform .6s var(--ease), box-shadow .35s var(--ease), border-color .2s;
}
.tilt.tilting { transition: transform .14s linear, box-shadow .35s var(--ease), border-color .2s; box-shadow: 0 2px 4px rgba(20,20,19,.04), 0 18px 40px -12px rgba(20,20,19,.18); }
.tilt::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 0%), rgba(255,255,255,.55), rgba(255,255,255,0) 55%);
  opacity: 0; transition: opacity .35s var(--ease); mix-blend-mode: soft-light;
}
.tilt.tilting::after { opacity: 1; }
.tilt .lift { transform: translateZ(26px); }
.tilt .lift-sm { transform: translateZ(14px); }
.tilt.clickable:active { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(.975); }
.stat.tilt .value, .stat.tilt .label { transform-style: preserve-3d; }

/* 抽屉打开时，后面的页面往后退一点 */
#view { transition: transform .45s var(--ease), opacity .45s var(--ease); transform-origin: 50% 0; }
body.has-drawer #view { transform: perspective(1400px) translateZ(-36px); opacity: .78; }
.drawer { transform-origin: 100% 50%; }
@media (min-width: 861px) {
  .drawer { transform: perspective(1400px) translateX(104%) rotateY(-10deg); }
  .drawer.show { transform: perspective(1400px) translateX(0) rotateY(0); }
}

/* 3D 舞台 */
.stage3d { position: relative; }
.stage3d canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transform: scale(.9) translateY(10px); filter: blur(8px); transition: opacity 1s var(--ease), transform 1.2s var(--ease), filter 1s var(--ease); }
.stage3d.ready canvas { opacity: 1; transform: none; filter: none; }
.stage3d::before { /* 落在地面的柔影 */
  content: ""; position: absolute; left: 18%; right: 18%; bottom: 6%; height: 12%;
  background: radial-gradient(closest-side, rgba(20,20,19,.16), rgba(20,20,19,0)); filter: blur(4px);
}
/* 电脑不支持 3D 时，用一张静态渲染图代替，并轻轻浮动 */
.stage3d.no-gl::after { content: ""; position: absolute; inset: 0; background: url(hero-fallback.png) center / contain no-repeat; animation: floaty 7s ease-in-out infinite; }
@keyframes floaty { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-8px) rotate(-2deg); } }

/* 登录页 */
.login-art { justify-content: space-between; }
.login-art::after { display: none; }
.login-art .stage3d { position: absolute; right: 3%; bottom: 3%; width: min(64%, 600px); aspect-ratio: 1; }
.login-copy { position: relative; z-index: 1; margin: 8vh 0 auto; }
.login.leaving .login-box, .login.leaving .login-copy { animation: away .42s var(--ease) forwards; }
.login.leaving .stage3d { animation: away .5s var(--ease) forwards; }
@keyframes away { to { opacity: 0; transform: perspective(1200px) translateZ(-120px) rotateX(6deg); } }
.acct { transform-style: preserve-3d; }
.acct .av { transform: translateZ(18px); box-shadow: 0 6px 16px -6px rgba(20,20,19,.35); }
.m-stage { display: none; }
@media (max-width: 860px) {
  .m-stage { display: block; height: 210px; margin: -12px -20px 6px; }
  .m-brand { margin-bottom: 0; }
}

/* 欢迎横幅（总览 / 员工今日任务） */
.welcome {
  position: relative; overflow: hidden; border-radius: 22px; margin-bottom: 8px;
  padding: 34px 36px; min-height: 216px; display: flex; flex-direction: column; justify-content: center;
  background: linear-gradient(120deg, var(--surface) 30%, color-mix(in srgb, var(--accent-soft) 70%, var(--surface)) 100%);
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.welcome .w-text { position: relative; z-index: 1; max-width: 60%; }
.welcome h1 { font-family: var(--serif); font-weight: 600; font-size: 34px; line-height: 1.2; letter-spacing: -.01em; }
.welcome .sub { margin-top: 8px; color: var(--text-2); font-size: 14.5px; }
.welcome .w-line { margin-top: 14px; font-size: 15px; color: var(--text); }
.welcome .w-line b { color: var(--accent-2); font-family: var(--num); font-size: 18px; font-weight: 400; margin: 0 2px; }
.welcome .actions { display: flex; gap: 8px; margin-top: 22px; flex-wrap: wrap; }
.welcome .stage3d { position: absolute; right: 8px; top: 0; bottom: 0; width: 420px; }
@media (max-width: 860px) {
  .welcome { padding: 22px 20px; min-height: 0; margin-top: 6px; }
  .welcome .w-text { max-width: none; }
  .welcome h1 { font-size: 25px; padding-right: 116px; }
  .welcome .sub { padding-right: 116px; }
  .welcome .stage3d { width: 150px; height: 140px; right: -6px; top: 0; bottom: auto; }
  .welcome .actions .btn { flex: 1; }
}

/* 头像照片 */
img.av { object-fit: cover; background: var(--bg-2); border: 2px solid var(--surface); box-shadow: 0 1px 3px rgba(20,20,19,.12); }
.av.lg { width: 48px; height: 48px; }
.av.xl { width: 72px; height: 72px; }

/* 海报：翻转入场 + 悬停倾斜 */
.poster { animation: posterIn .9s var(--ease) backwards; }
@keyframes posterIn {
  from { opacity: 0; filter: blur(16px) saturate(.6); transform: perspective(1000px) rotateY(-22deg) rotateX(6deg) scale(.92); }
}
.poster .po-title, .poster .po-price { transform-style: preserve-3d; }

/* 完成打勾：带一点立体弹出 */
.done-check { animation: checkPop .6s var(--spring) both; }
@keyframes checkPop { from { transform: perspective(600px) rotateY(-70deg) scale(.6); opacity: 0; } }

/* 头像占位：人像剪影（等真实头像放进 assets/avatars/ 后自动替换） */
.av-ph { overflow: hidden; background: color-mix(in srgb, var(--c) 20%, var(--surface)); border: 2px solid var(--surface); box-shadow: 0 1px 3px rgba(20,20,19,.12); display: block; }
.av-ph svg { width: 100%; height: 100%; display: block; fill: var(--c); opacity: .72; }
