/* 第二轮身份系统：颜色表达部门，动效只表达抽取与解锁。 */
#draw { --identity-color: #6fe3ff; padding-top: 42px; }
#draw .draw-stage { width: min(330px, 82vw); height: 438px; isolation: isolate; margin-bottom: 12px; }
#draw .draw-stage::before, #draw .draw-stage::after {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  border: 1px solid rgba(111,227,255,.18); border-radius: 22px;
  background: linear-gradient(155deg, #102441, #050b16); transition: transform .32s, opacity .32s;
}
#draw .draw-stage::before { transform: translate(-10px, 7px) rotate(-4deg); opacity: .72; }
#draw .draw-stage::after { transform: translate(9px, 10px) rotate(4deg); opacity: .62; }
#draw .draw-stage.shuffle { animation: collection-shuffle .28s ease-in-out both; }
#draw .draw-stage.shuffle::before { transform: translate(-30px, 2px) rotate(-11deg); }
#draw .draw-stage.shuffle::after { transform: translate(29px, 6px) rotate(10deg); }
#draw .draw-stage.charge { animation: collection-charge .26s ease-in-out both; }
#draw .draw-stage.settle { animation: collection-settle .36s cubic-bezier(.2,.8,.3,1.2) both; }
#draw .card3d { transition-duration: .48s; outline-offset: 9px; border-radius: 22px; }
#draw .card3d:focus-visible { outline: 2px solid #c5f5ff; }
#draw .face { border-color: rgba(128,208,255,.35); padding: 48px 30px 35px; }
#draw .face.front {
  background: radial-gradient(ellipse at 50% 38%, rgba(28,104,165,.25), transparent 57%),
    repeating-linear-gradient(0deg, transparent 0 37px, rgba(92,180,247,.035) 38px 39px), #071321;
  box-shadow: inset 0 0 45px rgba(22,85,131,.2), 0 22px 60px rgba(0,0,0,.35);
}
#draw .face.front .q { font-size: 110px; font-weight: 400; color: #a2edff; text-shadow: 0 0 35px rgba(111,227,255,.25); }
#draw .face.front p { letter-spacing: 2px; font-size: 12px; color: #b0ccdf; }
#draw .face.back {
  background: radial-gradient(ellipse at 50% 0, rgba(49,111,150,.23), transparent 65%), #071321;
  box-shadow: inset 0 1px rgba(205,244,255,.13), 0 22px 60px rgba(0,0,0,.35);
}
#draw .face.back .c-ico { margin-bottom: 8px; filter: drop-shadow(0 0 15px var(--flash, rgba(111,227,255,.2))); }
#draw .face.back h3 { font-size: clamp(25px, 6.3vw, 32px); letter-spacing: .035em; }
#draw .face.back .role { border-radius: 7px; letter-spacing: 1px; font-size: 12px; }
#draw .face.back p { color: #b2c6d6; line-height: 1.85; }
.draw-signal { position: absolute; top: 18px; left: 22px; z-index: 3; pointer-events: none; font: 9px/1.5 var(--mono, monospace); color: #83a9bd; letter-spacing: .18em; }
.draw-orbit { position: absolute; width: 106%; height: 40px; left: -3%; bottom: -22px; pointer-events: none; border: 1px solid rgba(111,227,255,.13); border-radius: 50%; z-index: -2; }
#draw .draw-btn { min-height: 52px; margin-top: 38px; padding: 15px 28px; border-radius: 12px; font-size: 17px; letter-spacing: 1px; }
#draw .draw-btn:disabled { cursor: wait; transform: none; box-shadow: none; opacity: .72; }
#draw .draw-btn:focus-visible, #collectionEntry:focus-visible, #collectionReset:focus-visible, .collection-panel button:focus-visible { outline: 2px solid #c5f5ff; outline-offset: 4px; }
#draw .collection-feedback { min-height: 24px; max-width: 100%; margin: 14px auto 0; color: #b6eafa; font-size: 12px; line-height: 2; white-space: nowrap; }
#collectionEntry { display: block; width: max-content; max-width: 190px; min-height: 40px; margin: 9px auto 0; padding: 8px 14px; border: 1px solid rgba(125,190,223,.25); border-radius: 10px; background: rgba(9,28,43,.7); color: #adcfe0; font: 12px/1.5 var(--body, sans-serif); font-variant-numeric: tabular-nums; cursor: pointer; }
#collectionEntry:hover { border-color: #75c5df; color: #dcf6ff; }
#collectionEntry:disabled { opacity: .5; cursor: wait; }
#collectionEntry[data-complete="true"] { color: #b5fcdd; border-color: rgba(181,252,221,.4); }

.collection-book {
  width: 100%; margin: 0; padding: 0; text-align: left;
}
.collection-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.collection-eyebrow { display: block; font: 10px/1.5 var(--mono, monospace); color: #79bdd6; letter-spacing: .19em; }
.collection-intro { font-size: 13px; line-height: 1.8; margin: 7px 0 0; color: #bad1df; }
.collection-counter { display: flex; flex-direction: column; gap: 3px; align-items: flex-end; white-space: nowrap; }
.collection-counter strong { font: 27px/1.25 var(--mono, monospace); color: #bdedff; font-variant-numeric: tabular-nums; letter-spacing: -.06em; }
.collection-counter > span { font-size: 10px; color: #809daf; letter-spacing: .06em; }
.collection-meter { height: 2px; margin: 23px 0; background: rgba(160,214,244,.12); }
.collection-meter i { display: block; width: var(--collection-progress, 0%); height: 100%; background: linear-gradient(90deg, #3b8cea, #a9f6ff); transition: width .45s ease; }
.collection-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; list-style: none; margin: 0; padding: 0; }
.collection-slot {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end;
  min-height: 151px; padding: 17px 13px 13px; border: 1px solid rgba(121,177,214,.13); border-radius: 12px;
  background: rgba(7,18,30,.66); overflow: hidden; transition: border-color .4s, background .4s;
}
.collection-number { position: absolute; top: 13px; right: 12px; color: #5d7c90; font: 10px var(--mono, monospace); }
.collection-symbol { margin-bottom: auto; color: #4b667d; }
.collection-symbol svg { display: block; width: 27px; height: 27px; }
.collection-slot strong { font-size: 13px; line-height: 1.4; font-weight: 500; color: #7892a6; margin-top: 18px; white-space: nowrap; }
.collection-dept { font-size: 10px; color: #7691a4; margin-top: 4px; line-height: 1.5; }
.collection-owned { margin-top: 9px; font-size: 9px; color: #657e8e; letter-spacing: .08em; }
.collection-slot.is-owned { border-color: color-mix(in srgb, var(--role-color) 40%, transparent); background: linear-gradient(145deg, color-mix(in srgb, var(--role-color) 8%, #071422), #081321); }
.collection-slot.is-owned .collection-symbol { color: var(--role-color); }
.collection-slot.is-owned strong { color: #e9f3fa; }
.collection-slot.is-owned .collection-owned { color: var(--role-color); }
.collection-slot.is-owned .collection-owned::before { content: '✓ '; }
.collection-slot.just-unlocked { animation: collection-unlock .7s ease-out; }
.collection-book[data-complete="true"] .collection-meter i { background: #b5fcdd; }
.collection-foot { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 18px; }
#collectionStorage { max-width: 70%; color: #89a5ba; font-size: 11px; line-height: 1.7; margin: 0; }
#collectionReset { border: 0; border-bottom: 1px solid rgba(160,205,232,.23); padding: 12px 0; min-height: 44px; background: transparent; font-size: 11px; color: #adc7d7; cursor: pointer; white-space: nowrap; }
#collectionReset:disabled { opacity: .4; cursor: default; }

.collection-game-note { margin: 16px 0 0; padding-top: 16px; border-top: 1px solid rgba(124,177,216,.12); color: #7899af; font-size: 10px; line-height: 1.8; }
#collectionPanelStatus { margin: 12px 0 0; color: #b5fcdd; font-size: 12px; line-height: 1.8; }
#collectionPanelStatus:empty { margin: 0; }
.collection-panel { position: fixed; inset: 0; width: min(640px, calc(100vw - 36px)); max-width: 640px; max-height: 80vh; margin: auto; padding: 0; border: 1px solid rgba(138,213,251,.34); border-radius: 22px; color: #edf6fe; background: #081727; box-shadow: 0 40px 110px rgba(0,0,0,.65); text-align: left; overflow: hidden; }
.collection-panel[open] { display: flex; flex-direction: column; animation: collection-panel-in .2s ease-out; }
.collection-panel:not([open]), .collection-book[hidden], .collection-confirm[hidden] { display: none; }
.collection-panel::backdrop { background: rgba(0,6,15,.75); backdrop-filter: blur(10px); }
.collection-panel-head { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 22px 18px 26px; border-bottom: 1px solid rgba(130,188,225,.14); }
.collection-panel-head h3 { font-family: var(--disp); font-size: 23px; font-weight: 500; line-height: 1.4; margin: 0; }
#collectionClose { width: 40px; height: 40px; flex-shrink: 0; padding: 0; border: 1px solid rgba(135,192,225,.2); border-radius: 10px; background: #11293a; color: #d3eaff; font: 26px/1 sans-serif; cursor: pointer; }
.collection-panel-scroll { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #335669 transparent; padding: 24px 26px; }
.collection-confirm { padding: 10px 0 18px; }
.collection-confirm h3 { font-family: var(--disp); font-size: 24px; font-weight: 500; line-height: 1.4; margin: 12px 0; }
.collection-confirm p { font-size: 13px; color: #a6bfd0; line-height: 1.8; }
.collection-dialog-actions { display: flex; gap: 10px; margin-top: 24px; }
.collection-dialog-actions button { flex: 1; padding: 12px 15px; min-height: 46px; background: #122c40; color: #def3ff; border: 1px solid #34546b; border-radius: 10px; cursor: pointer; font-size: 13px; }
#collectionConfirmReset { background: #c0e8f8; color: #071a29; border-color: #c0e8f8; }
.collection-modal-open { overflow: hidden; }

@keyframes collection-shuffle { 0%,100% { transform: translateX(0) rotate(0); } 26% { transform: translateX(-9px) rotate(-2deg); } 62% { transform: translateX(8px) rotate(1.8deg); } }
@keyframes collection-charge { from { transform: scale(1); } to { transform: scale(.965); } }
@keyframes collection-settle { 0% { transform: scale(.97); box-shadow: 0 0 28px var(--flash); } 55% { transform: scale(1.025); box-shadow: 0 0 44px var(--flash); } 100% { transform: scale(1); box-shadow: none; } }
@keyframes collection-unlock { from { border-color: var(--role-color); box-shadow: inset 0 0 28px color-mix(in srgb, var(--role-color) 23%, transparent); } to { box-shadow: none; } }
@keyframes collection-panel-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 800px) {
  .collection-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
  .collection-slot { padding: 14px 9px 12px; }
  .collection-slot strong { font-size: 13px; }
  .collection-dept { font-size: 9px; }
}
@media (max-width: 540px) {
  #draw .draw-stage { height: 412px; }
  #draw .face { padding: 48px 27px 30px; }
  #draw .draw-btn { max-width: 100%; font-size: 15px; padding-inline: 23px; }
  .collection-panel { inset: auto 12px max(12px, env(safe-area-inset-bottom)); width: calc(100vw - 24px); max-height: 75dvh; margin: 0 auto; border-radius: 22px 22px 16px 16px; }
  .collection-panel-head { padding: 15px 16px 15px 20px; }
  .collection-panel-head h3 { font-size: 21px; }
  .collection-panel-scroll { padding: 20px 18px; }
  .collection-eyebrow { font-size: 8px; }
  .collection-counter strong { font-size: 22px; }
  .collection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .collection-slot { min-height: 139px; padding: 15px 12px 12px; }
  .collection-slot strong { font-size: 15px; }
  .collection-dept { font-size: 10px; }
  .collection-foot { gap: 10px; align-items: flex-start; }
  #collectionStorage { max-width: 58%; font-size: 10px; padding-top: 10px; }
  #collectionReset { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  #draw .draw-stage, #draw .draw-stage::before, #draw .draw-stage::after, #draw .card3d,
  #draw .collection-slot, #draw .collection-book, #draw .collection-meter i, #draw .collection-panel { animation: none !important; transition: none !important; }
}
