/* ============================================================
   名侦探档案 · ARCHIVE OF DETECTIVES
   ============================================================ */

/* —— 馆藏统计条 —— */
.arc-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 30px;
  align-items: baseline;
  margin-top: 26px;
}
.arc-stats .stat b {
  font-family: var(--f-display);
  color: var(--brass);
  font-size: 1.7rem;
  letter-spacing: .02em;
  margin-right: 6px;
}
.arc-stats .stat span {
  font-size: .82rem;
  color: var(--fog-38);
  letter-spacing: .04em;
}

/* —— 过滤条 —— */
.arc-bar {
  position: sticky;
  top: 64px;
  z-index: 60;
  margin: 8px auto 30px;
  padding: 14px 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 18px;
  background: linear-gradient(180deg, rgba(12,14,18,0.96), rgba(12,14,18,0.82));
  border: 1px solid var(--fog-08);
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.arc-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 230px;
  min-width: 200px;
  padding: 9px 14px;
  background: var(--ink-900);
  border: 1px solid var(--fog-18);
  border-radius: 999px;
  transition: border-color .3s var(--ease);
}
.arc-search:focus-within { border-color: var(--brass); }
.arc-search svg { width: 16px; height: 16px; color: var(--fog-38); flex: none; }
.arc-search input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--fog-100);
  font-family: var(--f-sans);
  font-size: .9rem;
}
.arc-search input::placeholder { color: var(--fog-38); }

.arc-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.arc-chips .grp-label {
  font-family: var(--f-type);
  font-size: .62rem;
  letter-spacing: .2em;
  color: var(--fog-38);
  align-self: center;
  margin-right: 2px;
  text-transform: uppercase;
}
.chip {
  font-family: var(--f-sans);
  font-size: .82rem;
  color: var(--fog-60);
  padding: 7px 15px;
  border: 1px solid var(--fog-18);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  transition: all .25s var(--ease);
  white-space: nowrap;
}
.chip:hover { color: var(--fog-100); border-color: var(--fog-38); }
.chip.on {
  color: var(--ink-900);
  background: var(--brass);
  border-color: var(--brass);
  font-weight: 500;
}
.chip-sep { width: 1px; height: 18px; background: var(--fog-18); align-self: center; margin: 0 2px; }

.arc-count { margin-left: auto; font-size: .78rem; color: var(--fog-38); }
.arc-count b { color: var(--brass); }

/* —— 卡片网格 —— */
.arc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}
@media (max-width: 1080px) { .arc-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px)  { .arc-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px)  { .arc-grid { grid-template-columns: 1fr; } }

.det-card {
  position: relative;
  perspective: 1400px;
  cursor: pointer;
  min-height: 380px;
  animation: detIn .55s var(--ease) both;
}
@keyframes detIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

.det-inner {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 380px;
  transition: transform .85s var(--ease-io);
  transform-style: preserve-3d;
}
.det-card.flipped .det-inner { transform: rotateY(180deg); }
body.hoverable .det-card:hover .det-inner { transform: rotateY(180deg); }
body.hoverable .det-card:hover { z-index: 3; }

.det-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border: 1px solid var(--fog-08);
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(160deg, var(--ink-700), var(--ink-850));
  display: flex;
  flex-direction: column;
}

/* 正面 */
.det-front { padding: 0; }
.det-portrait {
  position: relative;
  height: 232px;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(201,162,39,0.10), transparent 60%),
    linear-gradient(180deg, #0f1319, #0a0c10);
  display: grid;
  place-items: center;
  border-bottom: 1px solid var(--fog-08);
  overflow: hidden;
}
.det-portrait svg { width: 78%; height: 100%; filter: drop-shadow(0 10px 18px rgba(0,0,0,.5)); }
.det-portrait::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(120% 120% at 50% 30%, transparent 55%, rgba(0,0,0,.45));
  pointer-events: none;
}
.det-meta { padding: 16px 18px 18px; flex: 1; display: flex; flex-direction: column; }
.det-name {
  font-family: var(--f-display);
  font-size: 1.22rem;
  color: var(--fog-100);
  letter-spacing: .02em;
  line-height: 1.1;
}
.det-name em {
  display: block;
  font-style: normal;
  font-family: var(--f-type);
  font-size: .66rem;
  letter-spacing: .18em;
  color: var(--brass);
  margin-top: 5px;
  text-transform: uppercase;
}
.det-sub {
  margin-top: 10px;
  font-size: .8rem;
  color: var(--fog-38);
  line-height: 1.55;
}
.det-tags { margin-top: auto; display: flex; flex-wrap: wrap; gap: 6px; padding-top: 12px; }
.det-tags .t {
  font-size: .68rem;
  color: var(--fog-60);
  border: 1px solid var(--fog-18);
  border-radius: 999px;
  padding: 3px 10px;
  letter-spacing: .03em;
}

.det-flip-hint {
  position: absolute;
  right: 12px; bottom: 12px;
  font-size: .62rem;
  letter-spacing: .14em;
  color: var(--fog-38);
  font-family: var(--f-type);
  display: flex; align-items: center; gap: 5px;
}
.det-flip-hint svg { width: 13px; height: 13px; }

/* 反面（方法论） */
.det-back {
  transform: rotateY(180deg);
  padding: 22px 22px 20px;
  background:
    linear-gradient(160deg, #14110a, #0c0b09);
  border-color: rgba(201,162,39,0.22);
}
.det-back .method-eyebrow {
  font-family: var(--f-type);
  font-size: .6rem;
  letter-spacing: .22em;
  color: var(--brass);
  text-transform: uppercase;
}
.det-back h3 {
  font-family: var(--f-display);
  font-size: 1.18rem;
  color: var(--paper-100);
  margin: 8px 0 12px;
}
.det-back .method-body {
  font-size: .86rem;
  line-height: 1.7;
  color: var(--fog-60);
}
.det-back .method-quote {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--fog-18);
  font-family: var(--f-serif);
  font-style: italic;
  font-size: .92rem;
  color: var(--brass-100);
  line-height: 1.5;
}
.det-back .method-quote::before { content: "“"; }
.det-back .method-quote::after  { content: "”"; }

/* 收藏印章 */
.det-seal {
  position: absolute;
  top: 12px; right: 12px;
  z-index: 5;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--fog-18);
  background: rgba(8,9,11,0.55);
  color: var(--fog-38);
  display: grid; place-items: center;
  cursor: pointer;
  transition: all .25s var(--ease);
  backdrop-filter: blur(3px);
}
.det-seal svg { width: 17px; height: 17px; }
.det-seal:hover { color: var(--paper-100); border-color: var(--fog-38); }
.det-seal.on {
  color: #fff;
  background: var(--blood);
  border-color: var(--blood-glow);
  box-shadow: 0 0 14px rgba(199,58,44,.5);
}

/* 空状态 */
.arc-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--fog-38);
  font-family: var(--f-serif);
  font-style: italic;
  font-size: 1.1rem;
}

/* ============================================================
   详情抽屉（右侧滑出）
   ============================================================ */
.drawer-scrim {
  position: fixed; inset: 0;
  background: rgba(4,5,7,0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9300;
  opacity: 0;
  visibility: hidden;
  transition: opacity .45s var(--ease), visibility .45s;
}
.drawer-scrim.open { opacity: 1; visibility: visible; }

.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(560px, 94vw);
  z-index: 9400;
  background: linear-gradient(180deg, #10131a, #0a0c10);
  border-left: 1px solid rgba(201,162,39,0.25);
  box-shadow: -30px 0 70px rgba(0,0,0,.6);
  transform: translateX(100%);
  transition: transform .55s var(--ease-io);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.drawer.open { transform: none; }

.drawer-top {
  position: relative;
  padding: 26px 28px 22px;
  border-bottom: 1px solid var(--fog-08);
  background:
    radial-gradient(120% 90% at 80% 0%, rgba(201,162,39,0.12), transparent 55%);
}
.drawer-close {
  position: absolute;
  top: 18px; right: 18px;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--fog-18);
  background: rgba(8,9,11,0.5);
  color: var(--fog-60);
  display: grid; place-items: center;
  cursor: pointer;
  transition: all .25s var(--ease);
}
.drawer-close:hover { color: var(--paper-100); border-color: var(--brass); transform: rotate(90deg); }
.drawer-close svg { width: 18px; height: 18px; }

.drawer-head { display: flex; gap: 20px; align-items: flex-end; }
.drawer-portrait {
  width: 116px; height: 140px;
  flex: none;
  border-radius: var(--radius);
  border: 1px solid var(--fog-18);
  background: linear-gradient(180deg, #0f1319, #0a0c10);
  overflow: hidden;
  display: grid; place-items: center;
}
.drawer-portrait svg { width: 92%; height: 100%; }
.drawer-id .d-eyebrow {
  font-family: var(--f-type);
  font-size: .62rem;
  letter-spacing: .2em;
  color: var(--brass);
  text-transform: uppercase;
}
.drawer-id h2 {
  font-family: var(--f-display);
  font-size: 1.7rem;
  color: var(--fog-100);
  margin: 6px 0 4px;
  line-height: 1.05;
}
.drawer-id .d-en { font-family: var(--f-type); font-size: .72rem; color: var(--fog-38); letter-spacing: .14em; }
.drawer-id .d-line { margin-top: 10px; font-size: .82rem; color: var(--fog-60); line-height: 1.55; }

.drawer-fav {
  margin-top: 16px;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 22px 28px 40px;
  scrollbar-width: thin;
  scrollbar-color: var(--fog-18) transparent;
}
.drawer-body::-webkit-scrollbar { width: 8px; }
.drawer-body::-webkit-scrollbar-thumb { background: var(--fog-18); border-radius: 4px; }

.d-sec { margin-bottom: 26px; }
.d-sec h4 {
  font-family: var(--f-display);
  font-size: .82rem;
  letter-spacing: .12em;
  color: var(--brass);
  text-transform: uppercase;
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 10px;
}
.d-sec h4::after { content: ""; flex: 1; height: 1px; background: var(--fog-08); }
.d-sec p { font-size: .9rem; line-height: 1.78; color: var(--fog-60); }

.d-method-steps { display: flex; flex-direction: column; gap: 12px; }
.d-step {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 13px 15px;
  background: linear-gradient(150deg, var(--ink-700), var(--ink-850));
  border: 1px solid var(--fog-08);
  border-left: 2px solid var(--brass);
  border-radius: var(--radius);
}
.d-step .n {
  font-family: var(--f-display);
  color: var(--brass);
  font-size: 1.05rem;
  line-height: 1.2;
  flex: none;
  width: 26px;
}
.d-step .s-t { color: var(--paper-100); font-size: .9rem; font-weight: 500; margin-bottom: 3px; }
.d-step .s-d { color: var(--fog-38); font-size: .8rem; line-height: 1.55; }

.d-cases { display: flex; flex-direction: column; gap: 10px; }
.d-case {
  padding: 12px 15px;
  background: rgba(255,255,255,0.015);
  border: 1px solid var(--fog-08);
  border-radius: var(--radius);
}
.d-case .c-t { font-family: var(--f-serif); font-size: 1rem; color: var(--fog-100); }
.d-case .c-d { font-size: .8rem; color: var(--fog-38); margin-top: 4px; line-height: 1.5; }

.d-quote {
  font-family: var(--f-serif);
  font-style: italic;
  font-size: 1.12rem;
  line-height: 1.6;
  color: var(--brass-100);
  padding: 18px 20px;
  border: 1px solid rgba(201,162,39,0.2);
  border-radius: var(--radius);
  background: radial-gradient(120% 120% at 0% 0%, rgba(201,162,39,0.07), transparent 60%);
  position: relative;
}
.d-quote .by { display: block; margin-top: 10px; font-style: normal; font-family: var(--f-type); font-size: .66rem; letter-spacing: .16em; color: var(--fog-38); }

.d-fav-line { display: flex; align-items: center; gap: 10px; font-size: .82rem; color: var(--fog-38); }

.btn-fav-lg {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--f-sans); font-size: .9rem;
  padding: 11px 22px;
  border-radius: 999px;
  border: 1px solid var(--blood);
  background: transparent;
  color: var(--blood-glow);
  cursor: pointer;
  transition: all .3s var(--ease);
}
.btn-fav-lg svg { width: 17px; height: 17px; }
.btn-fav-lg:hover { background: rgba(142,29,29,0.14); }
.btn-fav-lg.on {
  background: var(--blood);
  color: #fff;
  border-color: var(--blood-glow);
  box-shadow: 0 0 18px rgba(199,58,44,.4);
}

@media (max-width: 520px) {
  .drawer-head { flex-direction: column; align-items: flex-start; }
  .arc-count { margin-left: 0; width: 100%; }
}
