.k2-memory-card {
  position: relative;
  margin: 18px 0 22px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--bd, #243b43) 78%, transparent);
  border-radius: 18px;
  background: #102b2b;
  color: #fff;
  box-shadow: 0 16px 45px rgba(6, 25, 27, .18);
}
.k2-memory-card > summary {
  min-height: 54px;
  padding: 0 17px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  list-style: none;
  cursor: pointer;
  color: #dce9e4;
  background: #153837;
}
.k2-memory-card > summary::-webkit-details-marker { display: none; }
.k2-memory-card > summary span { font-size: 13px; font-weight: 800; }
.k2-memory-card > summary small { color: #a9bbb6; font-size: 11px; }
.k2-memory-card > summary::after { content: "+"; color: #dbe766; font-size: 20px; line-height: 1; }
.k2-memory-card[open] > summary::after { content: "−"; }
.k2-memory-image {
  position: relative;
  aspect-ratio: 16 / 7.7;
  min-height: 260px;
  overflow: hidden;
}
.k2-memory-image::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(0deg, rgba(5, 24, 25, .84), transparent 56%), linear-gradient(90deg, rgba(5, 24, 25, .12), transparent 50%);
}
.k2-memory-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter .35s ease, transform .5s ease;
}
.k2-memory-card.is-revealed .k2-memory-image img { filter: saturate(.82) contrast(1.04); transform: scale(1.012); }
.k2-memory-head {
  position: absolute;
  z-index: 2;
  left: 22px;
  right: 22px;
  bottom: 18px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
}
.k2-memory-head > div { min-width: 0; }
.k2-memory-head span {
  display: block;
  margin-bottom: 6px;
  color: #dbe766;
  font: 700 10px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .12em;
}
.k2-memory-head b { display: block; font: 800 clamp(20px, 3vw, 30px)/1.2 "Noto Serif SC", "Songti SC", serif; }
.k2-memory-head p { max-width: 360px; margin: 0; color: #e1ebe7; font-size: 13px; line-height: 1.6; text-align: right; }
.k2-memory-scene-tag {
  position: absolute;
  z-index: 2;
  left: 18px;
  top: 16px;
  padding: 7px 10px;
  border-left: 3px solid #dbe766;
  background: rgba(7, 31, 31, .74);
  color: #fff;
  font: 700 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .08em;
}
.k2-memory-answer { display: none; padding: 20px 22px 22px; background: #102b2b; }
.k2-memory-card.is-revealed .k2-memory-answer { display: block; animation: k2MemoryIn .34s ease both; }
.k2-memory-principle { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.k2-memory-principle span { color: #a9bbb6; font-size: 11px; }
.k2-memory-principle b { color: #dbe766; font-size: 18px; }
.k2-memory-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin: 0; padding: 0; list-style: none; counter-reset: k2step; }
.k2-memory-steps li { position: relative; min-height: 76px; padding: 13px 12px 12px 42px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.055); color: #f6f4e8; font-size: 12px; line-height: 1.55; counter-increment: k2step; }
.k2-memory-steps li::before { content: counter(k2step, decimal-leading-zero); position: absolute; left: 12px; top: 14px; color: #dbe766; font: 700 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.k2-memory-footer { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.k2-memory-footer p { margin: 0; padding: 12px 14px; font-size: 12px; line-height: 1.65; }
.k2-memory-trap { border-left: 3px solid #dc694f; background: rgba(220,105,79,.12); color: #f4d7d0; }
.k2-memory-mnemonic { border-left: 3px solid #dbe766; background: rgba(219,231,102,.09); color: #eef2bf; }
.k2-memory-marker {
  position: absolute;
  z-index: 3;
  left: var(--x);
  top: var(--y);
  display: none;
  transform: translate(-50%, -50%);
  padding: 7px 9px 7px 30px;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 99px;
  background: rgba(8, 44, 42, .9);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 7px 22px rgba(0,0,0,.26);
}
.k2-memory-marker::before { content: "✓"; position: absolute; left: 7px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: #dbe766; color: #102b2b; font-size: 10px; }
.k2-memory-card.is-revealed .k2-memory-marker { display: block; animation: k2MarkerIn .32s ease both; }
.k2-memory-card.is-revealed .k2-memory-marker:nth-of-type(2) { animation-delay: .08s; }
.k2-memory-card.is-revealed .k2-memory-marker:nth-of-type(3) { animation-delay: .16s; }
@keyframes k2MemoryIn { from { opacity: 0; transform: translateY(-8px); } }
@keyframes k2MarkerIn { from { opacity: 0; transform: translate(-50%, -38%); } }

@media (max-width: 720px) {
  .k2-memory-card { margin: 14px 0 18px; border-radius: 14px; }
  .k2-memory-image { aspect-ratio: 4 / 3; min-height: 230px; }
  .k2-memory-image img { object-position: center; }
  .k2-memory-head { left: 14px; right: 14px; bottom: 13px; display: block; }
  .k2-memory-head b { font-size: 21px; }
  .k2-memory-head p { margin-top: 5px; text-align: left; font-size: 11px; }
  .k2-memory-answer { padding: 17px 14px 18px; }
  .k2-memory-principle { display: block; }
  .k2-memory-principle b { display: block; margin-top: 4px; font-size: 16px; }
  .k2-memory-steps { grid-template-columns: 1fr 1fr; }
  .k2-memory-steps li { min-height: 68px; }
  .k2-memory-footer { grid-template-columns: 1fr; }
  .k2-memory-marker { padding: 6px; border-radius: 8px; font-size: 10px; }
  .k2-memory-marker::before { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .k2-memory-card *, .k2-memory-card *::before { animation: none !important; transition: none !important; }
}
