/* ============================================================
   Work 套件 · 系统级设计语言（浅色 / macOS 风 / 圆润 / 有动效）
   ============================================================ */

:root {
  /* 色板 */
  --bg: #f5f5f7;
  --bg-2: #eef0f4;
  --surface: #ffffff;
  --surface-2: #fbfbfd;
  --ink: #1d1d1f;
  --ink-2: #424245;
  --muted: #6e6e73;
  --faint: #a1a1a6;
  --line: rgba(0, 0, 0, 0.08);
  --line-strong: rgba(0, 0, 0, 0.14);

  --accent: #0a84ff;
  --accent-ink: #ffffff;
  --accent-soft: rgba(10, 132, 255, 0.10);
  --green: #34c759;
  --orange: #ff9f0a;
  --red: #ff3b30;
  --purple: #af52de;

  /* 形状 */
  --r-xs: 10px;
  --r-sm: 14px;
  --r-md: 20px;
  --r-lg: 28px;
  --r-xl: 36px;
  --r-pill: 999px;

  /* 阴影 */
  --sh-1: 0 1px 2px rgba(0, 0, 0, .04), 0 1px 1px rgba(0, 0, 0, .03);
  --sh-2: 0 2px 6px rgba(0, 0, 0, .05), 0 8px 24px rgba(0, 0, 0, .06);
  --sh-3: 0 12px 40px rgba(0, 0, 0, .12), 0 2px 8px rgba(0, 0, 0, .06);

  /* 动效 */
  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --t-fast: .16s;
  --t: .24s;
  --t-slow: .45s;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro SC", "SF Pro Text", "PingFang SC",
          "Helvetica Neue", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  font: 15px/1.6 var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

/* 动态背景：三团缓慢漂移的柔光 */
.mesh {
  position: fixed;
  inset: -20vh -10vw;
  z-index: -1;
  pointer-events: none;
  filter: blur(60px);
  opacity: .65;
}
.mesh i {
  position: absolute;
  display: block;
  border-radius: 50%;
  will-change: transform;
}
.mesh i:nth-child(1) { width: 46vw; height: 46vw; left: 2vw;  top: -6vh;  background: radial-gradient(circle at 30% 30%, #cfe3ff, transparent 70%); animation: drift1 26s var(--ease) infinite alternate; }
.mesh i:nth-child(2) { width: 38vw; height: 38vw; right: -4vw; top: 6vh;  background: radial-gradient(circle at 60% 40%, #e6dcff, transparent 72%); animation: drift2 32s var(--ease) infinite alternate; }
.mesh i:nth-child(3) { width: 34vw; height: 34vw; left: 26vw; bottom: -12vh; background: radial-gradient(circle at 50% 50%, #d6f5e6, transparent 72%); animation: drift3 38s var(--ease) infinite alternate; }

@keyframes drift1 { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(6vw, 4vh, 0) scale(1.12); } }
@keyframes drift2 { from { transform: translate3d(0,0,0) scale(1.05); } to { transform: translate3d(-5vw, 6vh, 0) scale(.94); } }
@keyframes drift3 { from { transform: translate3d(0,0,0) scale(.96); } to { transform: translate3d(4vw, -5vh, 0) scale(1.08); } }

/* 顶栏：毛玻璃 */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) 22px 12px;
  background: rgba(245, 245, 247, .72);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand .mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(145deg, #2b8cff, #7f5cff);
  color: #fff; font-weight: 800; font-size: 14px;
  display: grid; place-items: center;
  box-shadow: 0 4px 12px rgba(43, 140, 255, .32);
}
.brand b { font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.brand span { color: var(--faint); font-size: 12px; font-weight: 500; }

.spacer { flex: 1; }

/* 按钮：胶囊 + 按压反馈 + 涟漪 */
.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: 500 13.5px/1 var(--font);
  padding: 9px 16px;
  border-radius: var(--r-pill);
  cursor: pointer;
  box-shadow: var(--sh-1);
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t) var(--ease),
              background var(--t) var(--ease), border-color var(--t) var(--ease), color var(--t) var(--ease);
  -webkit-user-select: none; user-select: none;
}
.btn:hover { background: #fff; border-color: var(--line-strong); box-shadow: var(--sh-2); transform: translateY(-1px); }
.btn:active { transform: scale(.96); box-shadow: var(--sh-1); }
.btn:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; box-shadow: var(--sh-1); }

.btn.primary {
  background: linear-gradient(180deg, #2b8cff, #0a7bff);
  border-color: transparent; color: var(--accent-ink);
  box-shadow: 0 6px 18px rgba(10, 132, 255, .30), inset 0 1px 0 rgba(255,255,255,.28);
}
.btn.primary:hover { filter: brightness(1.04); box-shadow: 0 10px 26px rgba(10, 132, 255, .36), inset 0 1px 0 rgba(255,255,255,.28); }

.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--accent); }
.btn.ghost:hover { background: var(--accent-soft); }

.btn.icon { width: 34px; height: 34px; padding: 0; border-radius: 50%; }

/* 涟漪 */
.ripple {
  position: absolute; border-radius: 50%; transform: scale(0); opacity: .45;
  background: currentColor; pointer-events: none;
  animation: ripple .6s var(--ease-out) forwards;
}
@keyframes ripple { to { transform: scale(2.6); opacity: 0; } }

/* 卡片 / 磁贴 */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t) var(--ease);
}
.card:hover { box-shadow: var(--sh-2); }

.tile {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  padding: 20px; text-decoration: none; color: inherit; overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t) var(--ease);
}
.tile::after {
  content: ""; position: absolute; inset: -40% -20% auto auto; width: 160px; height: 160px;
  background: radial-gradient(circle, var(--tint, rgba(10,132,255,.14)), transparent 70%);
  opacity: 0; transition: opacity var(--t-slow) var(--ease);
}
.tile:hover { transform: translateY(-3px); box-shadow: var(--sh-2); border-color: var(--line-strong); }
.tile:hover::after { opacity: 1; }
.tile:active { transform: scale(.985); }

.tile .glyph {
  width: 46px; height: 46px; border-radius: 16px;
  display: grid; place-items: center; font-size: 20px;
  background: var(--glyph-bg, var(--accent-soft));
  color: var(--glyph-ink, var(--accent));
}
.tile h3 { margin: 0; font-size: 15.5px; font-weight: 620; letter-spacing: -.01em; }
.tile p { margin: 0; color: var(--muted); font-size: 12.8px; line-height: 1.5; }
.tile .tag {
  align-self: flex-start; margin-top: 2px;
  font-size: 11px; font-weight: 550; color: var(--accent);
  background: var(--accent-soft); border-radius: var(--r-pill); padding: 3px 9px;
}

/* 输入 */
.field {
  width: 100%; font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--r-sm); padding: 11px 14px;
  transition: border-color var(--t), box-shadow var(--t), background var(--t);
}
.field::placeholder { color: var(--faint); }
.field:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

/* 徽标 / 状态点 */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 550; color: var(--muted);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-pill); padding: 5px 11px;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(52,199,89,.15); }
.dot.warn { background: var(--orange); box-shadow: 0 0 0 3px rgba(255,159,10,.16); }
.dot.err { background: var(--red); box-shadow: 0 0 0 3px rgba(255,59,48,.16); }

/* 进入动画 */
.js .reveal { opacity: 0; transform: translateY(14px) scale(.985); }
.js .reveal.in { animation: reveal var(--t-slow) var(--ease-out) forwards; }
@keyframes reveal { to { opacity: 1; transform: none; } }

.pop { animation: pop .5s var(--ease-out) both; }
@keyframes pop { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: none; } }

.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 提示条 */
.toast-wrap { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  display: flex; align-items: center; gap: 9px;
  background: rgba(29,29,31,.92); color: #fff;
  padding: 10px 16px; border-radius: var(--r-pill);
  font-size: 13px; box-shadow: var(--sh-3);
  animation: toastIn .32s var(--ease-out);
}
.toast.out { animation: toastOut .28s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px) scale(.96); } }

/* 骨架 */
.skeleton { background: linear-gradient(90deg, #ececf0 25%, #f6f6f8 37%, #ececf0 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: var(--r-sm); }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* 布局容器 */
.shell { max-width: 1080px; margin: 0 auto; padding: 26px 22px 64px; }

/* 滚动条（macOS 风） */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,.18); border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,.30); background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

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

@media (max-width: 640px) {
  .shell { padding: 18px 14px 48px; }
  .topbar { padding-left: 14px; padding-right: 14px; }
}
