/* 动作图鉴 · 纯白 Operate 主题 */
:root {
  --ink: #18181b;
  --ink-2: #52525b;
  --ink-3: #71717a;
  --hair: #ececee;
  --chip: #f4f4f5;
  --heart: #e11d48;
  --ease: cubic-bezier(.22, .8, .3, 1);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}
::selection { background: var(--ink); color: #fff; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 8px; }
img { -webkit-user-drag: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
[hidden] { display: none !important; }
.wrap { max-width: 640px; margin: 0 auto; padding: 0 18px; }

/* ---------- 顶栏 ---------- */
.top { position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 1px solid var(--hair); }
.top .wrap { padding-top: 14px; }
.brand { display: flex; align-items: baseline; gap: 8px; }
.brand h1 { margin: 0; font-size: 1.0625rem; font-weight: 700; letter-spacing: .01em; }
.count { font-size: .75rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.search { position: relative; display: flex; align-items: center; margin: 12px 0 12px; }
.search > svg { position: absolute; left: 13px; width: 17px; height: 17px; color: var(--ink-3); pointer-events: none; }
.search input {
  width: 100%; height: 44px; padding: 0 42px 0 40px;
  border: 1px solid var(--hair); border-radius: 12px;
  background: var(--chip); color: var(--ink); font-size: 1rem; outline: none;
  transition: border-color .18s, background .18s, box-shadow .18s;
}
.search input::placeholder { color: var(--ink-2); }
.search input:focus { background: #fff; border-color: var(--ink); box-shadow: 0 1px 0 var(--ink); }
.search input::-webkit-search-cancel-button { display: none; }
.q-clear { position: absolute; right: 8px; width: 30px; height: 30px; display: grid; place-items: center; color: var(--ink-3); border-radius: 8px; }
.q-clear svg { width: 15px; height: 15px; }
.q-clear:hover { color: var(--ink); }

/* ---------- 筛选 chips ---------- */
.chips-wrap { overflow-x: auto; scrollbar-width: none; }
.chips-wrap::-webkit-scrollbar { display: none; }
.chips-eq { border-top: 1px solid var(--hair); }
.chips {
  display: flex; gap: 8px; padding: 10px 18px;
  width: max-content; min-width: 100%;
}
.chip {
  flex: 0 0 auto; height: 32px; padding: 0 13px; border-radius: 999px;
  background: var(--chip); color: var(--ink-2);
  font-size: .8125rem; line-height: 32px; white-space: nowrap;
  transition: background .15s, color .15s;
}
.chip:hover { color: var(--ink); }
.chip:active { transform: scale(.97); }
.chip[aria-selected="true"] { background: var(--ink); color: #fff; }
.chip.fav-chip[aria-selected="true"] { background: var(--heart); }
.chip svg { width: 13px; height: 13px; vertical-align: -2px; margin-right: 3px; }

/* ---------- 网格 ---------- */
main { padding-bottom: 40px; }
.result-line {
  margin: 14px 2px 10px; font-size: .75rem; color: var(--ink-3);
  font-variant-numeric: tabular-nums; letter-spacing: .02em;
}
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px 12px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(4, 1fr); } }

.card { position: relative; text-align: left; border-radius: 10px; }
.card img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: #fafafa; border-radius: 8px; }
.card .n {
  margin-top: 7px; font-size: .8125rem; font-weight: 550; line-height: 1.35;
  color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card .e {
  margin-top: 2px; font-size: .75rem; color: var(--ink-3);
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.card .heart {
  position: absolute; top: 6px; right: 6px; width: 30px; height: 30px;
  display: grid; place-items: center; border-radius: 999px;
  color: #fff; background: rgba(24,24,27,.28);
  opacity: 0; transition: opacity .15s;
}
.card:hover .heart, .card .heart.on { opacity: 1; }
.card .heart svg { width: 16px; height: 16px; }
.card .heart.on { color: var(--heart); background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
@media (hover: none) { .card .heart { opacity: 1; } }
.card .heart.on svg path { fill: currentColor; }

/* 心形 pop 动效 */
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.3); } 100% { transform: scale(1); } }
.pop { animation: pop .28s var(--ease); }

.more {
  display: block; margin: 26px auto 0; height: 38px; padding: 0 20px;
  border: 1px solid var(--hair); border-radius: 999px;
  font-size: .8125rem; color: var(--ink-2);
  transition: border-color .15s, color .15s;
}
.more:hover { border-color: var(--ink); color: var(--ink); }

.empty { padding: 72px 0; text-align: center; color: var(--ink-3); font-size: .875rem; }
.foot { margin-top: 56px; font-size: .75rem; color: var(--ink-3); }
.foot a { color: var(--ink-2); }

/* ---------- 骨架屏 ---------- */
@keyframes pulse { 50% { opacity: .45; } }
.sk { border-radius: 8px; background: #f4f4f5; animation: pulse 1.4s ease-in-out infinite; }
.sk-line { height: .75rem; margin-top: 8px; }

/* ---------- 详情覆盖页 ---------- */
.detail {
  position: fixed; inset: 0; z-index: 40; background: #fff;
  overflow-y: auto; overscroll-behavior: contain;
  animation: slidein .24s var(--ease);
}
@keyframes slidein { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.detail.closing { animation: slideout .2s var(--ease) forwards; }
@keyframes slideout { to { transform: translateX(24px); opacity: 0; } }

.detail-top { position: sticky; top: 0; background: #fff; border-bottom: 1px solid var(--hair); z-index: 5; }
.detail-top-row { display: flex; align-items: center; height: 54px; gap: 10px; }
.detail-crumb { flex: 1; font-size: .8125rem; color: var(--ink-3); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iconbtn {
  width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: 10px; color: var(--ink); transition: background .15s;
}
.iconbtn:hover { background: var(--chip); }
.iconbtn svg { width: 20px; height: 20px; }
.iconbtn.heart[aria-pressed="true"] { color: var(--heart); }
.iconbtn.heart[aria-pressed="true"] svg path { fill: currentColor; }

.detail-body { padding-bottom: 48px; }
.stage { display: grid; place-items: center; padding: 10px 0 4px; }
.stage img { width: min(100%, 400px); aspect-ratio: 1; object-fit: contain; border-radius: 12px; background: #fafafa; }
.d-zh { margin: 14px 0 0; font-size: 1.25rem; font-weight: 650; line-height: 1.4; letter-spacing: .005em; }
.d-en { margin: 3px 0 0; font-size: .75rem; color: var(--ink-3); }
.d-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.d-meta span {
  font-size: .75rem; color: var(--ink-2); background: var(--chip);
  border-radius: 7px; padding: 4px 9px;
}
.d-h { margin: 30px 0 0; font-size: .9375rem; font-weight: 650; }
.steps { margin: 12px 0 0; padding: 0; list-style: none; counter-reset: s; max-width: 72ch; }
.steps li {
  counter-increment: s; position: relative;
  padding: 11px 0 11px 34px; font-size: .9375rem; line-height: 1.65; color: #3f3f46;
}
.steps li + li { border-top: 1px solid var(--hair); }
.steps li::before {
  content: counter(s); position: absolute; left: 2px; top: 12px;
  width: 21px; height: 21px; border-radius: 7px;
  background: var(--chip); color: var(--ink-2);
  font-size: .75rem; font-weight: 600; line-height: 21px; text-align: center;
  font-variant-numeric: tabular-nums;
}
.d-attr { margin-top: 36px; font-size: .75rem; color: var(--ink-3); }

/* ---------- 细滚动条(桌面) ---------- */
@media (pointer: fine) {
  ::-webkit-scrollbar { width: 8px; height: 8px; }
  ::-webkit-scrollbar-thumb { background: #d4d4d8; border-radius: 4px; }
  ::-webkit-scrollbar-track { background: transparent; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
