* { box-sizing: border-box; margin: 0; padding: 0; }

[hidden] { display: none !important; }

:root {
  --bg: #e8eef0;
  --card: #ffffff;
  --surface: #f3f7f8;
  --surface-hover: #e4ecee;
  --option-hover: #e5f2f1;
  --active: #d4ebe8;
  --primary: #0d7377;
  --green: #2f9e6e;
  --red: #d64545;
  --text: #1a2a2e;
  --muted: #5c6f74;
  --border: #d2dde0;
  --answer-bg: #fff8eb;
  --answer-border: #f0d9a8;
  --answer-text: #9a6b1f;
  --input-disabled: #eef2f3;
  --correct-bg: #e6f6ef;
  --correct-text: #1d6b48;
  --wrong-bg: #fceaea;
  --wrong-text: #a83232;
  --tag-primary-bg: rgba(13, 115, 119, .12);
  --tag-green-bg: rgba(47, 158, 110, .12);
  --tag-red-bg: rgba(214, 69, 69, .12);
  --kill-fill: rgba(214, 69, 69, .16);
  --bg-wash-a: rgba(13, 115, 119, .14);
  --bg-wash-b: rgba(45, 90, 110, .08);
  --font-display: "Fraunces", "Noto Serif SC", Georgia, serif;
  --font-body: "Noto Sans SC", "Segoe UI", "Microsoft YaHei", sans-serif;
  --motion-fast: 160ms;
  --motion-ease: cubic-bezier(.22, 1, .36, 1);
  --lift-0: 0 6px 28px rgba(26, 42, 46, .06);
  --lift-1: 0 4px 14px rgba(26, 42, 46, .09);
  --lift-2: 0 10px 28px rgba(26, 42, 46, .13);
}

[data-theme="dark"] {
  --bg: #101618;
  --card: #1a2225;
  --surface: #222b2e;
  --surface-hover: #2a3438;
  --option-hover: #24383a;
  --active: #1e3a3b;
  --primary: #3dbeb3;
  --green: #3ecf8e;
  --red: #f07171;
  --text: #e6eeef;
  --muted: #93a3a7;
  --border: #334045;
  --answer-bg: #2a2418;
  --answer-border: #6b5b2e;
  --answer-text: #f0c674;
  --input-disabled: #2a3438;
  --correct-bg: #143528;
  --correct-text: #5ee0a0;
  --wrong-bg: #3a1f1f;
  --wrong-text: #f88;
  --tag-primary-bg: rgba(61, 190, 179, .18);
  --tag-green-bg: rgba(62, 207, 142, .16);
  --tag-red-bg: rgba(240, 113, 113, .16);
  --kill-fill: rgba(240, 113, 113, .22);
  --bg-wash-a: rgba(61, 190, 179, .12);
  --bg-wash-b: rgba(80, 120, 140, .08);
  --lift-0: 0 6px 28px rgba(0, 0, 0, .28);
  --lift-1: 0 4px 16px rgba(0, 0, 0, .32);
  --lift-2: 0 12px 32px rgba(0, 0, 0, .4);
}

body {
  font-family: var(--font-body);
  background:
    radial-gradient(ellipse 90% 55% at 8% -8%, var(--bg-wash-a), transparent 55%),
    radial-gradient(ellipse 70% 45% at 100% 0%, var(--bg-wash-b), transparent 50%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  color-scheme: light;
}

[data-theme="dark"] body,
[data-theme="dark"] {
  color-scheme: dark;
}

.app {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  height: 100vh;
  height: 100dvh;
}

/* ==================== 侧栏 ==================== */
.sidebar {
  width: 460px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  background: var(--surface);
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  min-height: 0;
}

.sidebar-header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface);
  padding-bottom: 4px;
}

.bank-list {
  list-style: none;
  margin-top: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-bottom: 8px;
}

/* ---- 双栏侧栏：左栏文件夹导航 + 右栏题库列表 ---- */
.sidebar-cols {
  display: flex;
  gap: 12px;
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 16px;
}

.folder-nav {
  width: 148px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
  -webkit-overflow-scrolling: touch;
}

.folder-nav-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 8px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  min-height: 34px;
  user-select: none;
  font-size: 13px;
  line-height: 1.3;
}
.folder-nav-item:not(.preset):not(.folder-nav-create) {
  cursor: grab;
}
.folder-nav-item.active {
  background: var(--active);
  border-color: var(--primary);
  font-weight: 600;
}
.folder-nav-item.drop-hover {
  background: var(--active);
  border-color: var(--primary);
  border-style: dashed;
}
.folder-nav-icon {
  flex-shrink: 0;
  font-size: 14px;
}
.folder-nav-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.folder-nav-count {
  flex-shrink: 0;
  font-size: 11px;
  opacity: 0.65;
  background: var(--border);
  border-radius: 8px;
  padding: 1px 6px;
}
.folder-nav-ops {
  display: none;
  flex-shrink: 0;
  gap: 2px;
}
.folder-nav-item:hover .folder-nav-ops {
  display: inline-flex;
}
.folder-nav-item:hover .folder-nav-count {
  display: none;
}
.folder-nav-op {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  padding: 1px 2px;
  line-height: 1;
  opacity: 0.75;
}
.folder-nav-op:hover {
  opacity: 1;
}
.folder-nav-create {
  border: 1px dashed var(--border);
  color: var(--muted, inherit);
  background: transparent;
  width: 100%;
  font-size: 13px;
  text-align: left;
}
.folder-nav-create:hover {
  border-color: var(--primary);
}
.folder-nav-plus {
  font-weight: 700;
  margin-right: 2px;
}
.folder-nav-placeholder {
  border-radius: 8px;
  border: 1px dashed var(--primary);
  background: var(--active);
  flex-shrink: 0;
}

/* 右栏上下文标题 */
.bank-ctx-title {
  list-style: none;
  font-size: 13px;
  font-weight: 700;
  opacity: 0.85;
  padding: 2px 4px 6px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.bank-empty-hint {
  list-style: none;
  font-size: 12px;
  opacity: 0.6;
  padding: 14px 6px;
  text-align: center;
}
.sidebar-header h2 {
  font-size: 16px;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.notif-bell {
  position: relative;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 2px 4px;
  color: inherit;
}

.notif-badge {
  position: absolute;
  top: -4px;
  right: -6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.share-user-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow: auto;
  margin: 8px 0 4px;
}

.share-user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  cursor: pointer;
}

.share-user-row:hover {
  border-color: var(--primary);
}

.notif-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
}

.notif-item {
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  padding: 10px 12px;
  cursor: pointer;
  color: inherit;
  font: inherit;
  width: 100%;
}

.notif-item.is-unread {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
  background: color-mix(in srgb, var(--active) 55%, var(--card));
}

.notif-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.notif-tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
}

.notif-tag-release {
  border-color: color-mix(in srgb, var(--primary) 50%, var(--border));
  color: var(--primary);
  background: var(--tag-primary-bg);
}

.notif-tag-share {
  border-color: color-mix(in srgb, var(--green) 40%, var(--border));
  color: var(--green);
  background: var(--tag-green-bg);
}

.notif-msg {
  font-size: 14px;
  line-height: 1.45;
}

.notif-meta {
  margin-top: 0;
  font-size: 12px;
  color: var(--muted);
}

.release-box .release-summary {
  margin: 4px 0 12px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

.release-bullets {
  margin: 0 0 12px;
  padding-left: 1.2em;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

.release-date {
  margin: 0;
}

.bank-item {
  padding: 12px 14px;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid transparent;
  border-left: 3px solid transparent;
  transition:
    background var(--motion-fast) var(--motion-ease),
    border-color var(--motion-fast) var(--motion-ease),
    box-shadow var(--motion-fast) var(--motion-ease);
}
/* bank-list 是固定高度的 flex 纵向容器：子项禁止收缩，超高出滚动条而不是被压扁裁切 */
.bank-list > .bank-item {
  flex-shrink: 0;
}
.bank-item:hover { background: var(--surface-hover); }
.bank-item.active {
  background: var(--active);
  border-color: var(--primary);
  border-left-color: var(--primary);
}
.bank-name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.bank-meta { font-size: 12px; color: var(--muted); margin-top: 5px; line-height: 1.4; }
.bank-progress { font-size: 12px; color: var(--red); margin-top: 5px; line-height: 1.4; }

/* ==================== 主区域 ==================== */
/* 贴边三栏（DeepSeek 式）：两侧栏贴视口边缘，中间内容独立限宽居中 */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0 28px;
  min-width: 0;
  min-height: 0;
  align-items: center;
}
/* 贴边三栏（DeepSeek 式）：两侧栏贴视口边缘，中间内容独立限宽居中。
   card-area 保持全宽——天体/连击漂浮在 study-stage 开阔区；
   真正的内容块（题卡宿主/空态/阅读区）在此各自限宽居中。 */
.main > header,
.main > .card-area,
.main > footer {
  width: 100%;
}
.main > header,
.main > footer {
  max-width: 720px;
}
.card-area > .study-host,
.card-area > .empty {
  width: 100%;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 0 12px;
}
header h1 { font-size: 22px; text-align: center; }
.study-stage {
  display: block;
  flex: 1 1 auto;
  min-height: 88px;
  position: relative;
  pointer-events: none;
}
.celestial-btn {
  position: absolute;
  top: 8%;
  /* 锚定内容列左肩（50% - 360列半宽 - 72图标 - 24间距）：列居中，天体跟随 */
  left: max(16px, calc(50% - 456px));
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  line-height: 0;
}
.celestial-icon {
  position: static;
  display: block;
  width: min(14vw, 72px);
  height: auto;
  opacity: 0.95;
  user-select: none;
  image-rendering: auto;
  pointer-events: none;
}
.celestial-moon {
  width: min(11vw, 56px);
}
.celestial-btn:hover .celestial-icon {
  opacity: 1;
  transform: scale(1.06) translateY(-1px);
  transition: transform var(--motion-fast) var(--motion-ease), opacity var(--motion-fast) ease;
}
.celestial-btn:active .celestial-icon {
  transform: scale(0.96);
}
.combo-badge {
  position: absolute;
  top: 8%;
  /* 与左上天体对称：锚定内容列右肩 */
  right: max(16px, calc(50% - 456px));
  width: min(14vw, 72px);
  min-height: min(14vw, 72px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-radius: 50%;
  border: 1.5px solid rgba(45, 159, 122, 0.28);
  background: rgba(45, 159, 122, 0.06);
  color: var(--primary, #2d9f7a);
  pointer-events: none;
  user-select: none;
  line-height: 1;
  box-sizing: border-box;
}
.combo-badge.is-idle {
  opacity: 0.55;
  border-color: rgba(120, 140, 150, 0.28);
  background: rgba(120, 140, 150, 0.06);
  color: var(--muted, #8a9690);
}
.combo-badge-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.05rem, 3.2vw, 1.45rem);
  letter-spacing: 0.02em;
}
.combo-badge-hint {
  font-family: var(--font-body);
  font-size: 10px;
  letter-spacing: 0.12em;
  opacity: 0.85;
}
.combo-badge.is-live {
  opacity: 1;
  border-color: rgba(45, 159, 122, 0.55);
  background: rgba(45, 159, 122, 0.12);
  color: var(--primary, #2d9f7a);
  box-shadow: 0 0 0 0 rgba(45, 159, 122, 0);
}
.combo-badge.combo-pop {
  animation: combo-badge-pop 0.85s var(--motion-ease) both;
}
.combo-badge.combo-pop-mid {
  animation: combo-badge-pop-mid 1s var(--motion-ease) both;
}
.combo-badge.combo-pop-big {
  animation: combo-badge-pop-big 1.15s var(--motion-ease) both;
  border-color: rgba(45, 159, 122, 0.85);
  background: rgba(45, 159, 122, 0.18);
}
@keyframes combo-badge-pop {
  0% { transform: scale(0.88); }
  22% { transform: scale(1.12); }
  100% { transform: scale(1); }
}
@keyframes combo-badge-pop-mid {
  0% { transform: scale(0.82); box-shadow: 0 0 0 0 rgba(45, 159, 122, 0.35); }
  25% { transform: scale(1.18); box-shadow: 0 0 0 10px rgba(45, 159, 122, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(45, 159, 122, 0); }
}
@keyframes combo-badge-pop-big {
  0% { transform: scale(0.75); box-shadow: 0 0 0 0 rgba(45, 159, 122, 0.45); }
  22% { transform: scale(1.26); box-shadow: 0 0 0 14px rgba(45, 159, 122, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(45, 159, 122, 0); }
}
[data-theme="dark"] .combo-badge.is-idle {
  border-color: rgba(160, 180, 190, 0.22);
  background: rgba(160, 180, 190, 0.05);
}
[data-theme="dark"] .combo-badge.is-live,
[data-theme="dark"] .combo-badge.combo-pop-big {
  color: #5ee0a0;
}
[data-theme="dark"] .celestial-icon {
  filter: brightness(1.55) saturate(0.85);
  opacity: 0.9;
}
[data-theme="light"] .celestial-icon,
:root .celestial-icon {
  filter: none;
  opacity: 0.95;
}
.lykie-peeker-btn {
  position: absolute;
  left: 50%;
  bottom: calc(100% - var(--lykie-peek-overlap, 17px));
  transform: translateX(-50%);
  width: min(20vw, 140px);
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  z-index: 3;
  line-height: 0;
  pointer-events: auto;
  transition: filter var(--motion-fast) ease, transform var(--motion-fast) var(--motion-ease);
}
.lykie-peeker-btn:hover {
  filter: brightness(1.06);
  transform: translateX(-50%) translateY(-3px) scale(1.03);
}
.lykie-peeker-btn:active {
  filter: brightness(0.98);
  transform: translateX(-50%) translateY(0) scale(0.97);
}
.lykie-peeker-stage {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  line-height: 0;
  /* 不裁切：hidden 会迫使每帧重栅格化，摆头会肉眼卡 */
  overflow: visible;
}
.lykie-peeker-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  /* 头/手统一平滑采样，摆动时观感一致 */
  image-rendering: auto;
  image-rendering: smooth;
}
/* 独立手图层：按住边缘不动 */
.lykie-peeker-hands {
  z-index: 2;
}
/* 头图层：合成层动画（轴心略偏左，适配不对称立绘） */
.lykie-peeker-head {
  z-index: 1;
  --lykie-head-x: -2px;
  --lykie-head-y: 4px;
  transform-origin: calc(50% - 2px) 82%;
  animation: lykie-idle-head 4.8s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
  will-change: transform;
  backface-visibility: hidden;
  transform: translate3d(var(--lykie-head-x), var(--lykie-head-y), 0);
}
.lykie-peeker-btn:hover .lykie-peeker-head,
.lykie-peeker-btn:active .lykie-peeker-head {
  animation-play-state: paused;
}
@keyframes lykie-idle-head {
  0%,
  100% {
    transform: translate3d(calc(var(--lykie-head-x) - 2.5px), var(--lykie-head-y), 0) rotate(-1.2deg) scale(1);
  }
  50% {
    transform: translate3d(calc(var(--lykie-head-x) + 3.5px), calc(var(--lykie-head-y) - 1px), 0) rotate(1.4deg) scale(1.016);
  }
}
.card-stack {
  width: 100%;
  position: relative;
  flex: 0 0 auto;
  z-index: 2;
}
.study-host {
  width: 100%;
  position: relative;
  flex: 0 0 auto;
  z-index: 2;
  --lykie-peek-overlap: 17px;
}
.brand-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.15rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: center;
  color: var(--text);
  line-height: 1.2;
}
.brand-sub {
  display: inline-block;
  margin-left: 0.35em;
  font-family: var(--font-body);
  font-size: 0.48em;
  font-weight: 500;
  letter-spacing: 0.12em;
  vertical-align: middle;
  color: var(--muted);
  transform: translateY(-0.15em);
}
.stats { text-align: center; color: var(--muted); font-size: 14px; }
.actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  align-items: center;
  width: 100%;
}
.sfx-toggle {
  min-width: 2.4em;
  padding-left: 0.55em;
  padding-right: 0.55em;
  font-size: 1.05rem;
  line-height: 1;
}
.account-name {
  color: var(--muted);
  font-size: 14px;
  padding: 8px 4px;
}
a.btn {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 16px;
  cursor: pointer;
  transition:
    opacity var(--motion-fast) ease,
    transform var(--motion-fast) var(--motion-ease),
    filter var(--motion-fast) ease,
    background var(--motion-fast) ease,
    border-color var(--motion-fast) ease,
    box-shadow var(--motion-fast) var(--motion-ease);
  font-family: inherit;
  will-change: transform;
}
.btn:active { transform: scale(.96); }
.btn:hover { opacity: .92; }

.btn.ghost {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
  padding: 8px 16px;
  font-size: 14px;
}
.btn.ghost.danger { color: var(--muted); border-color: var(--border); }
.btn.danger {
  color: #fff;
  background: #c45c5c;
  border-color: #c45c5c;
}
.btn.primary.danger {
  color: #fff;
  background: #c45c5c;
  border-color: #c45c5c;
}
.btn.primary.danger:hover {
  filter: brightness(0.95);
}

.btn.primary {
  background: var(--primary);
  color: #fff;
  width: 100%;
  box-shadow: var(--lift-1);
}
.btn.primary:hover { opacity: 1; filter: brightness(1.06); }

.card-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
  padding: 12px 0 8px;
  min-height: 0;
}

.empty { text-align: center; color: var(--muted); font-size: 18px; }
.empty .hint { font-size: 14px; margin-top: 8px; color: var(--muted); }

/* 结算页：顶对齐可滚动，收起天体/连击占位；顶栏不要实心底色盖住页面 wash */
body.settle-view .study-stage {
  display: none !important;
}
body.settle-view .card-area {
  justify-content: flex-start;
  align-items: stretch;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
body.settle-view .empty {
  width: 100%;
  flex: 0 0 auto;
  padding: 4px 0 12px;
}
body.settle-view header,
body.settle-view footer {
  flex-shrink: 0;
  position: relative;
  z-index: 4;
  background: transparent;
}

/* 弹层打开时锁底层，防点击/滑动穿透 */
body.modal-scroll-lock {
  overflow: hidden;
  overscroll-behavior: none;
}
body.modal-scroll-lock .app {
  pointer-events: none;
  touch-action: none;
  overflow: hidden;
}
body.modal-scroll-lock .modal:not([hidden]) {
  pointer-events: auto;
}

/* —— 斩完 MVP 结算墙 —— */
.settle {
  width: min(100%, 560px);
  margin: 0 auto;
  text-align: left;
  padding: 8px 4px 24px;
}
.settle-title {
  text-align: center;
  font-size: 22px;
  font-weight: 650;
  color: var(--text);
  margin: 0 0 6px;
}
.settle-sub {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 16px;
}
.settle-toolbar {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}
.settle-run-label {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.settle-run-select {
  font: inherit;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
}
.settle-wall {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.settle-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  text-align: left;
  padding: 14px 14px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--lift-1, none);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.settle-card:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
  transform: translateY(-1px);
}
.settle-card:disabled,
.settle-card.is-empty {
  opacity: 0.55;
  cursor: default;
}
.settle-card-label {
  font-size: 12px;
  color: var(--muted);
}
.settle-card-value {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--primary);
}
.settle-card-tie,
.settle-card-hist,
.settle-card-hint,
.settle-card-preview {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}
.settle-card-preview {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 2px;
}
.settle-mini-q {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 70%, var(--card));
  -webkit-line-clamp: unset;
  overflow: hidden;
}
.settle-mini-q-label {
  font-size: 11px;
  color: var(--primary);
  font-weight: 600;
}
.settle-mini-q-stem {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text);
}
.settle-compare {
  margin-top: 18px;
  font-size: 13px;
  color: var(--muted);
}
.settle-compare summary {
  cursor: pointer;
  user-select: none;
}
.settle-compare-table {
  width: 100%;
  margin-top: 10px;
  border-collapse: collapse;
  font-size: 12px;
}
.settle-compare-table th,
.settle-compare-table td {
  border-bottom: 1px solid var(--border);
  padding: 6px 4px;
  text-align: left;
}
.settle-hint { text-align: center; margin-top: 16px; }
.settle-loading { text-align: center; color: var(--muted); }
.settle-detail-box {
  max-width: 560px;
  max-height: min(90vh, 820px);
  overflow: auto;
}
.settle-detail-body { margin-top: 8px; }
.settle-detail-lead { font-size: 15px; margin-bottom: 12px; }
.settle-detail-h {
  font-size: 13px;
  margin: 16px 0 8px;
  color: var(--muted);
  font-weight: 600;
}
.settle-muted { font-size: 12px; color: var(--muted); }
.settle-chart-note { margin: -2px 0 10px; }

/* 连击折线 */
.streak-chart-wrap { margin: 4px 0 8px; }
.streak-chart {
  width: 100%;
  height: auto;
  display: block;
  background: color-mix(in srgb, var(--card) 88%, var(--primary) 4%);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.streak-grid {
  stroke: color-mix(in srgb, var(--border) 80%, transparent);
  stroke-width: 1;
}
.streak-ylab {
  fill: var(--muted);
  font-size: 10px;
  text-anchor: end;
}
.streak-line {
  stroke: var(--primary);
  stroke-width: 2.25;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.streak-dot.ok {
  fill: var(--primary);
  stroke: none;
}
.streak-dot.break {
  fill: #c45c5c;
  stroke: color-mix(in srgb, #c45c5c 40%, #fff);
  stroke-width: 1.5;
}
.streak-mark.kill {
  fill: #c47a2a;
  stroke: color-mix(in srgb, #c47a2a 35%, #fff);
  stroke-width: 1.25;
}
.streak-chart-legend {
  display: flex;
  gap: 14px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}
.streak-chart-legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
}
.streak-chart-legend .lg-ok { background: var(--primary); }
.streak-chart-legend .lg-break { background: #c45c5c; }
.streak-chart-legend .lg-kill {
  background: #c47a2a;
  border-radius: 1px;
  transform: rotate(45deg);
}

/* 题目卡片轮播 */
.q-carousel { margin: 4px 0 8px; }
.q-carousel-track {
  position: relative;
  min-height: 120px;
  overflow: hidden;
}
.q-carousel-slide {
  display: none;
}
.q-carousel-slide.is-active { display: block; }
.q-carousel-slide.is-active.from-right {
  animation: qCardInRight 0.3s ease;
}
.q-carousel-slide.is-active.from-left {
  animation: qCardInLeft 0.3s ease;
}
@keyframes qCardInRight {
  from {
    opacity: 0;
    transform: translateX(36px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
@keyframes qCardInLeft {
  from {
    opacity: 0;
    transform: translateX(-36px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .q-carousel-slide.is-active.from-right,
  .q-carousel-slide.is-active.from-left {
    animation: none;
  }
}
.q-carousel-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  padding: 14px 16px 12px;
  box-shadow: var(--lift-1, none);
}
.q-carousel-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.q-carousel-num {
  font-size: 12px;
  color: var(--muted);
}
.q-carousel-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 14%, transparent);
  border-radius: 999px;
  padding: 2px 8px;
}
.q-carousel-stem {
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  max-height: 9.5em;
  overflow: auto;
}
.q-carousel-meta {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}
.q-carousel-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 10px;
}
.q-carousel-prev,
.q-carousel-next {
  min-width: 40px;
  font-size: 20px;
  line-height: 1;
  padding: 4px 10px;
}
.q-carousel-count {
  font-size: 13px;
  color: var(--muted);
  min-width: 3.5em;
  text-align: center;
}
.q-carousel-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.q-carousel-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: color-mix(in srgb, var(--muted) 45%, transparent);
  cursor: pointer;
}
.q-carousel-dot.is-active {
  background: var(--primary);
  transform: scale(1.15);
}

@media (max-width: 560px) {
  .settle {
    padding: 0 2px 16px;
  }
  .settle-title {
    font-size: 18px;
    margin: 0 0 4px;
  }
  .settle-sub {
    font-size: 12px;
    margin: 0 0 10px;
    line-height: 1.4;
    padding: 0 4px;
  }
  .settle-toolbar {
    margin-bottom: 10px;
  }
  .settle-wall {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .settle-card {
    aspect-ratio: 1;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 6px;
    padding: 12px 10px;
    min-height: 0;
  }
  .settle-card-label {
    font-size: 11px;
  }
  .settle-card-value {
    font-size: 22px;
  }
  .settle-card-tie {
    font-size: 11px;
  }
  /* 手机端只留标签+数值，点进详情再看题 */
  .settle-card-preview,
  .settle-mini-q,
  .settle-card-hist {
    display: none;
  }
  .settle-card-hint {
    font-size: 11px;
    text-align: center;
  }
  .settle-detail-box {
    width: min(94vw, 560px);
    max-height: min(85dvh, 820px);
    margin: 0 auto;
    padding: 16px 14px;
  }
}

.card {
  background: var(--card);
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--lift-0);
  padding: 28px 24px;
  width: 100%;
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  max-height: min(58vh, 560px);
  overflow-y: auto;
  position: relative;
  z-index: 2;
  transition:
    box-shadow var(--motion-fast) var(--motion-ease),
    transform var(--motion-fast) var(--motion-ease),
    border-color var(--motion-fast) ease;
}
.card.card-enter {
  animation: card-enter var(--motion-fast) var(--motion-ease) both;
}
@keyframes card-enter {
  from {
    opacity: 0.55;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* —— 结算动效：对 / 错 / 连击 / 斩 —— */
.card.fx-correct {
  animation: fx-card-correct 0.36s var(--motion-ease) both;
}
.card.fx-miss {
  animation: fx-card-miss 0.4s var(--motion-ease) both;
}
.card.fx-combo {
  box-shadow: 0 0 0 2px rgba(45, 159, 122, 0.35), var(--shadow, 0 8px 28px rgba(20, 40, 30, 0.08));
}
.card.fx-combo-10 {
  animation: fx-card-combo-glow 0.65s var(--motion-ease) both;
}
.card.fx-kill {
  animation: fx-card-kill 0.4s var(--motion-ease) both;
  pointer-events: none;
}
@keyframes fx-card-correct {
  0% { transform: scale(1); }
  40% { transform: scale(1.02); }
  100% { transform: scale(1); }
}
@keyframes fx-card-miss {
  0%, 100% { transform: translateX(0); box-shadow: none; }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}
.card.fx-miss {
  outline: 1px solid rgba(214, 69, 69, 0.45);
  outline-offset: 0;
}
@keyframes fx-card-combo-glow {
  0% { box-shadow: 0 0 0 0 rgba(45, 159, 122, 0.0); }
  35% { box-shadow: 0 0 0 6px rgba(45, 159, 122, 0.22); }
  100% { box-shadow: 0 0 0 0 rgba(45, 159, 122, 0); }
}
@keyframes fx-card-kill {
  0% { opacity: 1; transform: translateY(0) scale(1); filter: none; }
  100% { opacity: 0.15; transform: translateY(14px) scale(0.96); filter: saturate(0.7); }
}

.card-stack {
  position: relative;
}
.combo-float {
  position: absolute;
  right: 14px;
  top: 12px;
  left: auto;
  transform: translate(0, 6px) scale(0.88);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.25rem, 3.2vw, 1.65rem);
  letter-spacing: 0.04em;
  color: var(--primary, #2d9f7a);
  opacity: 0;
  pointer-events: none;
  z-index: 6;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}
.combo-float.combo-float-mid {
  font-size: clamp(1.45rem, 3.6vw, 1.9rem);
  color: #1f8a68;
}
.combo-float.combo-float-big {
  font-size: clamp(1.7rem, 4.2vw, 2.25rem);
  color: #1a7a5c;
}
.combo-float.combo-float-go {
  animation: fx-combo-float 0.85s var(--motion-ease) both;
}
.combo-float.combo-float-mid.combo-float-go {
  animation: fx-combo-float-mid 1s var(--motion-ease) both;
}
.combo-float.combo-float-big.combo-float-go {
  animation: fx-combo-float-big 1.15s var(--motion-ease) both;
}
@keyframes fx-combo-float {
  0% { opacity: 0; transform: translate(4px, 8px) scale(0.82); }
  18% { opacity: 1; transform: translate(0, 0) scale(1.06); }
  70% { opacity: 1; transform: translate(0, -4px) scale(1); }
  100% { opacity: 0; transform: translate(0, -10px) scale(0.98); }
}
@keyframes fx-combo-float-mid {
  0% { opacity: 0; transform: translate(6px, 10px) scale(0.75); }
  20% { opacity: 1; transform: translate(0, -2px) scale(1.14); }
  72% { opacity: 1; transform: translate(0, -6px) scale(1.04); }
  100% { opacity: 0; transform: translate(0, -14px) scale(1); }
}
@keyframes fx-combo-float-big {
  0% { opacity: 0; transform: translate(8px, 12px) scale(0.7); }
  18% { opacity: 1; transform: translate(0, -4px) scale(1.22); }
  55% { opacity: 1; transform: translate(0, -8px) scale(1.08); }
  100% { opacity: 0; transform: translate(0, -18px) scale(1.02); }
}

.kill-fill.fx-kill-pulse,
.progress.fx-kill-pulse {
  animation: fx-kill-bar 0.48s var(--motion-ease) both;
}
@keyframes fx-kill-bar {
  0% { filter: brightness(1); }
  40% { filter: brightness(1.25); }
  100% { filter: brightness(1); }
}

.lykie-peeker-head.fx-peeker-nod {
  animation: fx-peeker-nod 0.4s var(--motion-ease) both !important;
}
.lykie-peeker-head.fx-peeker-cheer {
  animation: fx-peeker-cheer 0.5s var(--motion-ease) both !important;
}
@keyframes fx-peeker-nod {
  0%, 100% { transform: translate3d(var(--lykie-head-x), var(--lykie-head-y), 0) rotate(0deg) scale(1); }
  40% { transform: translate3d(var(--lykie-head-x), calc(var(--lykie-head-y) + 5px), 0) rotate(0deg) scale(1.05); }
}
@keyframes fx-peeker-cheer {
  0%, 100% { transform: translate3d(var(--lykie-head-x), var(--lykie-head-y), 0) rotate(0deg) scale(1); }
  30% { transform: translate3d(var(--lykie-head-x), calc(var(--lykie-head-y) - 7px), 0) rotate(-3deg) scale(1.08); }
  65% { transform: translate3d(var(--lykie-head-x), calc(var(--lykie-head-y) + 2px), 0) rotate(2deg) scale(1.03); }
}
.lykie-peeker-btn:has(.fx-peeker-nod),
.lykie-peeker-btn:has(.fx-peeker-cheer) {
  z-index: 8;
  filter: brightness(1.08);
}


.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  gap: 8px;
}
.card-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.btn.ask-lykie {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--primary);
  padding: 4px 12px;
  font-size: 13px;
  border-radius: 8px;
}
.btn.ask-lykie:hover {
  border-color: var(--primary);
  background: var(--tag-primary-bg);
}
.card-type {
  display: inline-block;
  font-size: 12px;
  color: var(--primary);
  background: var(--tag-primary-bg);
  padding: 4px 10px;
  border-radius: 999px;
}
.btn.edit {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 4px 14px;
  font-size: 13px;
  border-radius: 8px;
}
.btn.edit:hover { color: var(--primary); border-color: var(--primary); }

.card-stem {
  font-size: 20px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.card-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}

.options { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.opt {
  text-align: left;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  padding: 13px 16px;
  font-size: 16px;
  cursor: pointer;
  font-family: inherit;
  transition:
    background var(--motion-fast) ease,
    border-color var(--motion-fast) ease,
    transform var(--motion-fast) var(--motion-ease),
    box-shadow var(--motion-fast) var(--motion-ease);
  line-height: 1.5;
}
.opt:hover:not(:disabled) { border-color: var(--primary); background: var(--option-hover); }
.opt.selected {
  border-color: var(--primary);
  background: var(--option-hover);
  box-shadow: var(--lift-1);
}
.opt.multi.selected {
  box-shadow: var(--lift-1), inset 3px 0 0 var(--primary);
}
.opt.correct { border-color: var(--green); background: var(--correct-bg); color: var(--correct-text); }
.opt.wrong { border-color: var(--red); background: var(--wrong-bg); color: var(--wrong-text); }
.opt:disabled { cursor: default; }
.opt:active:not(:disabled) { transform: scale(0.985); }

.edit-options-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}
.edit-opt-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.edit-opt-row .edit-opt-input { flex: 1; }
.edit-opt-remove {
  flex: 0 0 auto;
  padding: 6px 10px;
}
.edit-add-opt { width: 100%; margin-top: 4px; }
.edit-answer-checks {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow: auto;
  padding: 4px 0;
}
.edit-ans-check {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}

.fill-area { margin-top: 18px; }
.fill-area input {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
}
.fill-area input:focus { border-color: var(--primary); }
.fill-area input:disabled { background: var(--input-disabled); }

.answer {
  margin-top: 20px;
  padding: 14px 16px;
  background: var(--answer-bg);
  border: 1px solid var(--answer-border);
  border-radius: 10px;
  font-size: 16px;
  line-height: 1.6;
  word-break: break-word;
}
.answer .label { font-weight: 600; margin-right: 8px; color: var(--answer-text); }
.answer-analysis {
  margin-top: 8px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  word-break: break-word;
}

footer { padding: 12px 0 24px; }
.controls { display: flex; flex-direction: column; gap: 10px; }
.main-btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
  /* 预留下一题按钮高度，避免揭晓时页脚变高把题卡顶上去 */
  min-height: 48px;
}
#saControls.main-btns {
  align-items: center;
}
#saControls.main-btns .btn {
  width: min(100%, 420px);
}
.judge-btns[hidden] {
  display: none !important;
}
.judge-btns {
  display: flex;
  gap: 12px;
}
.judge-btns[hidden] {
  display: none !important;
}
.judge-btns .mark { flex: 1; }

.btn.mark { color: #fff; font-size: 17px; padding: 14px 0; box-shadow: var(--lift-1); }
.btn.mark.forgot { background: var(--red); }
.btn.mark.remember { background: var(--green); }

.btn.kill {
  position: relative;
  overflow: hidden;
  background: var(--card);
  color: var(--red);
  border: 1.5px solid var(--red);
  width: 100%;
  padding: 13px 0;
  font-size: 17px;
  letter-spacing: 2px;
  transition:
    transform var(--motion-fast) var(--motion-ease),
    box-shadow var(--motion-fast) var(--motion-ease),
    background var(--motion-fast) ease;
}
.btn.kill:hover { background: var(--card); }
.btn.kill:disabled,
.btn.kill.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.kill-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: var(--kill-fill);
  width: 0%;
  transition: width .3s ease;
}
.kill-label { position: relative; z-index: 1; }

.kill-slot {
  position: relative;
  width: 100%;
}
.kill-slot[hidden] {
  display: none !important;
}
.btn.kill.is-cheering .kill-label {
  opacity: 0.22;
  transition: opacity 0.25s ease;
}

.kill-cheer {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  text-align: center;
  pointer-events: none;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--red);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
  opacity: 0;
  transform: translateY(4px) scale(0.96);
}
.kill-cheer[hidden] {
  display: none !important;
}
.kill-cheer.is-in {
  display: flex !important;
  animation: kill-cheer-in 0.35s var(--motion-ease) both;
}
.kill-cheer.is-out {
  display: flex !important;
  animation: kill-cheer-out 0.4s var(--motion-ease) both;
}
.kill-cheer.tier-25 { font-size: clamp(0.95rem, 2.6vw, 1.15rem); }
.kill-cheer.tier-50 { font-size: clamp(1rem, 2.8vw, 1.2rem); }
.kill-cheer.tier-75 { font-size: clamp(0.92rem, 2.5vw, 1.12rem); }
.kill-cheer.tier-100 { font-size: clamp(0.9rem, 2.4vw, 1.1rem); }
@keyframes kill-cheer-in {
  from { opacity: 0; transform: translateY(6px) scale(0.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes kill-cheer-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-4px) scale(1.02); }
}

.kill-bolts {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
}
.kill-bolts-svg {
  width: 100%;
  height: 100%;
  display: block;
}
.kill-bolt {
  fill: var(--red);
  opacity: 0;
  transform-origin: center;
}
.kill-spark {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 28%;
  left: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(214, 69, 69, 0.0) 20%,
    rgba(214, 69, 69, 0.35) 50%,
    rgba(214, 69, 69, 0.0) 80%,
    transparent 100%
  );
  opacity: 0;
}

.btn.kill.kill-zap-25 .kill-fill,
.btn.kill.kill-zap-50 .kill-fill,
.btn.kill.kill-zap-75 .kill-fill,
.btn.kill.kill-zap-100 .kill-fill {
  animation: fx-kill-bar 0.55s var(--motion-ease) both;
}
.kill-bolts.zap-25 {
  animation: kill-bolt-wrap 0.55s var(--motion-ease) both;
}
.kill-bolts.zap-25 .kill-bolt-a {
  animation: kill-bolt-flash 0.55s var(--motion-ease) both;
}
.kill-bolts.zap-25 .kill-spark {
  animation: kill-spark-run 0.55s var(--motion-ease) both;
}
.kill-bolts.zap-50 {
  animation: kill-bolt-wrap 0.7s var(--motion-ease) both;
}
.kill-bolts.zap-50 .kill-bolt-a,
.kill-bolts.zap-50 .kill-bolt-b {
  animation: kill-bolt-flash 0.7s var(--motion-ease) both;
}
.kill-bolts.zap-50 .kill-bolt-b {
  animation-delay: 0.08s;
}
.kill-bolts.zap-50 .kill-spark {
  animation: kill-spark-run 0.7s var(--motion-ease) both;
}
.kill-bolts.zap-75 {
  animation: kill-bolt-wrap 0.85s var(--motion-ease) both;
}
.kill-bolts.zap-75 .kill-bolt {
  animation: kill-bolt-flash 0.85s var(--motion-ease) both;
}
.kill-bolts.zap-75 .kill-bolt-b { animation-delay: 0.06s; }
.kill-bolts.zap-75 .kill-bolt-c { animation-delay: 0.12s; }
.kill-bolts.zap-75 .kill-spark {
  animation: kill-spark-run 0.85s var(--motion-ease) both;
}
.kill-bolts.zap-100 {
  animation: kill-bolt-wrap 1s var(--motion-ease) both;
}
.kill-bolts.zap-100 .kill-bolt {
  animation: kill-bolt-flash-strong 1s var(--motion-ease) both;
}
.kill-bolts.zap-100 .kill-bolt-b { animation-delay: 0.05s; }
.kill-bolts.zap-100 .kill-bolt-c { animation-delay: 0.1s; }
.kill-bolts.zap-100 .kill-spark {
  animation: kill-spark-run-strong 1s var(--motion-ease) both;
}
.btn.kill.kill-zap-100 {
  box-shadow: 0 0 0 1px rgba(214, 69, 69, 0.35), 0 0 18px rgba(214, 69, 69, 0.22);
}

@keyframes kill-bolt-wrap {
  0%, 100% { opacity: 1; }
}
@keyframes kill-bolt-flash {
  0% { opacity: 0; transform: scale(0.85) translateY(-2px); }
  18% { opacity: 0.9; transform: scale(1.05) translateY(0); }
  40% { opacity: 0.35; }
  55% { opacity: 0.75; }
  100% { opacity: 0; transform: scale(1) translateY(1px); }
}
@keyframes kill-bolt-flash-strong {
  0% { opacity: 0; transform: scale(0.8); filter: brightness(1); }
  12% { opacity: 1; transform: scale(1.08); filter: brightness(1.25); }
  28% { opacity: 0.4; }
  42% { opacity: 0.95; }
  70% { opacity: 0.55; }
  100% { opacity: 0; transform: scale(1); filter: brightness(1); }
}
@keyframes kill-spark-run {
  0% { opacity: 0; transform: translateX(-30%); }
  25% { opacity: 0.85; }
  100% { opacity: 0; transform: translateX(220%); }
}
@keyframes kill-spark-run-strong {
  0% { opacity: 0; transform: translateX(-40%); }
  20% { opacity: 1; }
  55% { opacity: 0.7; }
  100% { opacity: 0; transform: translateX(260%); }
}

.progress { text-align: center; color: var(--muted); font-size: 13px; margin-top: 14px; }

/* —— 斩满 100%：条上移到视口竖直中心 → 透视远去（不变暗） —— */
.kill-clear-fx {
  position: fixed;
  inset: 0;
  z-index: 90;
  perspective: 1200px;
  perspective-origin: 50% 50%;
  background: none;
  pointer-events: none;
}
.kill-clear-fx[hidden] {
  display: none !important;
}
.kill-clear-stage {
  position: absolute;
  left: 0;
  top: 0;
  width: 280px;
  margin: 0;
  transform-style: preserve-3d;
  will-change: top;
}
.kill-clear-bar {
  position: relative;
  width: 100%;
  transform-style: preserve-3d;
  will-change: transform, opacity, filter;
}
.kill-clear-btn {
  width: 100%;
  pointer-events: none;
  cursor: default;
}
.kill-clear-btn.is-disabled,
.kill-clear-btn:disabled {
  opacity: 1;
}
.kill-clear-cheer {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  text-align: center;
  pointer-events: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(0.92rem, 2.5vw, 1.12rem);
  letter-spacing: 0.04em;
  color: var(--red);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
  opacity: 1;
  transform: none;
}
.kill-clear-btn .kill-label {
  opacity: 0.2;
}

/* 只收起题卡；侧栏 / 顶栏保留 */
body.kill-clearing .study-host {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.25s var(--motion-ease);
}
body.kill-clearing #progress,
body.kill-clearing #killControls {
  opacity: 0 !important;
  pointer-events: none !important;
}
#killSlot.is-clearing-hide {
  opacity: 0;
  pointer-events: none;
}

.kill-clear-bar.is-hold {
  transform: translate3d(0, 0, 0) scale(1);
  opacity: 1;
}
.kill-clear-bar.is-recede {
  animation: kill-clear-recede 1.12s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes kill-clear-recede {
  0% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate3d(0, 0, -420px) scale(0.42);
  }
}

/* 结算：条快消失时才开播；从偏大贴近缩到正常（不用 blur，减卡顿） */
body.settle-arriving .card-area {
  perspective: 1000px;
  perspective-origin: 50% 42%;
  overflow: hidden;
}
.settle.settle-arrive {
  transform-style: preserve-3d;
  transform-origin: 50% 40%;
  animation: settle-arrive 0.85s cubic-bezier(0.22, 1, 0.36, 1) both;
  will-change: transform, opacity;
}
@keyframes settle-arrive {
  from {
    opacity: 0;
    transform: translate3d(0, 3vh, 280px) scale(1.55);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .kill-clear-bar.is-recede,
  .settle.settle-arrive {
    animation: none !important;
  }
}

/* ==================== 编辑弹窗 ==================== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  overscroll-behavior: none;
  touch-action: none;
}
#editModal { z-index: 200; }
#settleDetailModal { z-index: 220; }
.modal-box {
  background: var(--card);
  border-radius: 16px;
  padding: 24px;
  width: 92%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  pointer-events: auto;
}
.modal-box h3 { margin-bottom: 18px; }

.form-field { margin-bottom: 14px; }
.form-field label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus { border-color: var(--primary); }
.form-field textarea { resize: vertical; }
#editOptionsArea input { margin-bottom: 8px; }

.modal-actions { display: flex; gap: 10px; margin-top: 8px; }
.modal-actions .btn { flex: 1; }

/* ==================== 题库项操作按钮 ==================== */
.bank-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.mini-btn {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: color .15s, border-color .15s;
}
.mini-btn:hover { color: var(--primary); border-color: var(--primary); }
.mini-btn.danger { color: var(--red); }
.mini-btn.danger:hover { color: var(--red); border-color: var(--red); }

/* ==================== 题库详情弹窗 ==================== */
.bank-modal-box {
  max-width: 680px;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow: hidden;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-shrink: 0;
}
.modal-header h3 { font-size: 16px; }
.modal-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.question-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.q-empty { text-align: center; color: var(--muted); padding: 30px 0; }

.question-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}
.q-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.q-type {
  font-size: 12px;
  color: var(--primary);
  background: var(--tag-primary-bg);
  padding: 2px 8px;
  border-radius: 999px;
}
.q-tag {
  font-size: 12px;
  color: var(--green);
  background: var(--tag-green-bg);
  padding: 2px 8px;
  border-radius: 999px;
}
.q-tag.killed {
  color: var(--red);
  background: var(--tag-red-bg);
}
.q-edit { margin-left: auto; }
.q-del { color: var(--red); border-color: rgba(239, 68, 68, .3); }
.q-del:hover { color: var(--red); border-color: var(--red); }
.q-stem {
  font-size: 15px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.q-options {
  font-size: 14px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.6;
}
.q-answer {
  font-size: 14px;
  color: var(--answer-text);
  margin-top: 6px;
}
.q-analysis {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.6;
  word-break: break-word;
}

/* ==================== 粘贴导入弹窗 ==================== */
.sidebar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.sidebar-actions .btn.ghost {
  padding: 6px 10px;
  font-size: 13px;
}

.paste-modal-box {
  max-width: 640px;
}
.paste-actions {
  margin-top: 4px;
}
.paste-actions .btn {
  width: 100%;
}
.paste-preview {
  margin-top: 12px;
  max-height: 40vh;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface);
}
.paste-preview-head {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}
.paste-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 8px;
  background: var(--card);
}
.paste-item-head {
  font-size: 12px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.paste-stem {
  font-size: 13px;
  line-height: 1.5;
  word-break: break-word;
}
.paste-answer {
  font-size: 12px;
  color: var(--answer-text);
  margin-top: 4px;
}

/* ==================== 主题切换过渡 ==================== */
body,
.sidebar,
.card,
.modal-box,
.question-item,
.bank-item,
.opt,
.mini-btn,
.fill-area input,
.form-field input,
.form-field select,
.form-field textarea,
.answer {
  transition: background-color .3s ease, color .3s ease, border-color .3s ease;
}

/* ==================== Lykie 面板 ==================== */
.lykie-panel {
  width: 320px;
  flex-shrink: 0;
  border-left: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
}
.lykie-panel.collapsed {
  display: none;
}
.lykie-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 16px 14px 10px;
  border-bottom: 1px solid var(--border);
}
.lykie-header h2 {
  font-size: 16px;
}
.lykie-status {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.4;
}
.lykie-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lykie-bubble {
  max-width: 92%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.lykie-bubble.user {
  align-self: flex-end;
  background: var(--active);
  color: var(--text);
}
.lykie-bubble.assistant {
  align-self: flex-start;
  background: var(--card);
  border: 1px solid var(--border);
}
.lykie-bubble-text {
  display: block;
}
/* // 反馈：直达作者的意见，她不会看到 */
.lykie-bubble.user.note {
  background: transparent;
  border: 1px dashed var(--muted);
  color: var(--muted);
}
.lykie-note-tag {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  opacity: .75;
}
.lykie-bubble.system {
  align-self: center;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  max-width: 100%;
}
.lykie-bubble.system.profile-note {
  white-space: pre-wrap;
  line-height: 1.45;
}
.lykie-bubble.system.profile-fill {
  text-align: left;
  color: #c2410c;
  align-self: stretch;
  background: rgba(194, 65, 12, .08);
  border-radius: 8px;
  padding: 8px 10px;
}
.lykie-bubble.system.profile-used {
  color: #3f6f5a;
}
.lykie-bubble.system.profile-invented,
.lykie-bubble.system.profile-warn {
  color: #b45309;
}
.lykie-bubble.system.profile-missing {
  color: #b45309;
}
.lykie-bubble.pending {
  opacity: .7;
}
.lykie-bubble.assistant.silence {
  opacity: .72;
  font-style: italic;
  color: var(--muted);
  border-style: dashed;
}
.lykie-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 12px 8px;
  flex-shrink: 0;
}
.lykie-chips[hidden] {
  display: none !important;
}
.lykie-chip {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
  line-height: 1.3;
  max-width: 100%;
  text-align: left;
}
.lykie-chip:hover {
  border-color: var(--primary, #4f8ef7);
  color: var(--primary, #4f8ef7);
}
.lykie-panel.story-mode .lykie-status {
  color: #d97706;
}
.lykie-toolbar {
  display: flex;
  gap: 8px;
  padding: 0 12px 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.btn.lykie-tool {
  padding: 4px 10px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
}
.btn.lykie-tool:hover {
  color: var(--primary);
  border-color: var(--primary);
}
.lykie-stage-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}
.lykie-stage-label {
  flex-shrink: 0;
}
.lykie-stage-select {
  font: inherit;
  font-size: 12px;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 8px;
  max-width: 11em;
}
.lykie-composer {
  position: relative;
  flex-shrink: 0;
  margin: 10px 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  padding: 12px 12px 36px;
  min-height: 140px;
}
.lykie-pending-card {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  padding: 8px 10px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--text) 4%, transparent);
  font-size: 12px;
  color: var(--muted);
}
.lykie-pending-card[hidden] {
  display: none;
}
.lykie-pending-preview {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}
.lykie-pending-clear {
  flex-shrink: 0;
  font: inherit;
  font-size: 12px;
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  text-decoration: line-through;
  padding: 0;
}
.lykie-pending-clear:hover {
  color: var(--text);
}
.lykie-think-debug {
  align-self: flex-start;
  max-width: 92%;
  margin: -2px 0 8px 4px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
  border: 1px dashed var(--border);
  white-space: pre-wrap;
  word-break: break-word;
}
.lykie-composer:focus-within {
  border-color: var(--primary);
}
.lykie-composer textarea {
  display: block;
  width: 100%;
  min-height: 100px;
  max-height: 220px;
  height: 100px;
  resize: none;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  font-family: inherit;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}
.lykie-composer textarea::placeholder {
  color: var(--muted);
  -webkit-text-fill-color: var(--muted);
  opacity: 1;
}
button.lykie-send {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  max-width: 22px;
  max-height: 22px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
}
button.lykie-send:hover { opacity: .88; }
button.lykie-send:disabled {
  opacity: .4;
  cursor: default;
}
button.lykie-send:active { transform: scale(.94); }

@media (max-width: 960px) {
  .lykie-panel {
    position: fixed;
    right: 0;
    top: 0;
    z-index: 40;
    box-shadow: -8px 0 24px rgba(0, 0, 0, .12);
  }
}

/* ==================== 题库侧栏：桌面可收起 / 手机抽屉 ==================== */
.bank-drawer-btn {
  display: inline-flex;
}
.bank-drawer-close {
  display: inline-flex;
}
.bank-drawer-backdrop {
  display: none;
}

/* 桌面：收起侧栏后主区铺满。内容列与天体/连击都锚定 stage 中线（50% 跟随），
   收起时相对位置自动保持，无需逐项补偿。 */
@media (min-width: 721px) {
  body.bank-sidebar-collapsed .sidebar {
    display: none;
  }
}

@media (max-width: 720px) {
  .app {
    flex-direction: column;
    max-width: none;
    min-height: 100dvh;
  }

  /* 窄屏双栏降级：左栏变横向滚动 chips 条 */
  .sidebar-cols {
    flex-direction: column;
    gap: 10px;
  }
  .folder-nav {
    width: auto;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 6px;
    padding: 2px 0 6px;
    flex-shrink: 0;
  }
  .folder-nav-item {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 5px 10px;
    min-height: 30px;
  }
  .folder-nav-placeholder {
    width: 60px;
    height: 30px;
  }
  .folder-nav-create {
    width: auto;
    flex-shrink: 0;
    white-space: nowrap;
  }

  .bank-drawer-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgba(18, 28, 30, .4);
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
  }
  body.bank-drawer-open .bank-drawer-backdrop {
    display: block;
  }

  .sidebar {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    width: 100%;
    height: auto;
    max-height: min(72vh, 560px);
    z-index: 50;
    transform: translateY(-105%);
    transition: transform .22s ease;
    border-right: none;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 14px 36px rgba(26, 42, 46, .16);
    padding: 14px 14px 18px;
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
  }
  body.bank-drawer-open .sidebar {
    transform: translateY(0);
    display: flex;
    flex-direction: column;
  }
  body.bank-drawer-open .sidebar .bank-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
  }

  /* 手机不用 desktop collapsed 类 */
  body.bank-sidebar-collapsed .sidebar {
    display: flex;
  }

  .main {
    width: 100%;
    padding: 0 14px;
    min-height: 100dvh;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
  }
  header {
    flex-shrink: 0;
    padding: 14px 0 10px;
    gap: 6px;
  }
  .brand-title {
    font-size: 1.55rem;
  }
  .brand-sub {
    font-size: 0.45em;
    letter-spacing: 0.1em;
  }
  .stats {
    font-size: 13px;
  }
  .actions {
    gap: 6px;
    justify-content: center;
  }
  .actions .btn.ghost,
  .actions a.btn.ghost {
    padding: 6px 10px;
    font-size: 13px;
    border-radius: 8px;
  }
  .actions .btn.ghost.danger {
    opacity: .72;
    font-size: 12px;
    padding: 5px 8px;
  }
  .account-name {
    font-size: 12px;
    padding: 4px 2px;
    max-width: 7em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .card-area {
    flex: 1;
    min-height: 0;
    padding: 0 0 8px;
  }
  .study-stage {
    min-height: 72px;
  }
  .celestial-btn {
    top: 6%;
    left: 4%;
  }
  .combo-badge {
    top: 6%;
    right: 4%;
    width: min(18vw, 56px);
    min-height: min(18vw, 56px);
  }
  .combo-badge-num {
    font-size: clamp(0.95rem, 4vw, 1.2rem);
  }
  .combo-badge-hint {
    font-size: 9px;
  }
  .celestial-icon {
    width: min(18vw, 56px);
  }
  .celestial-moon {
    width: min(14vw, 44px);
  }
  .lykie-peeker-btn {
    width: min(32vw, 124px);
  }
  .card {
    max-height: min(52dvh, 480px);
    padding: 16px 14px;
    border-radius: 14px;
  }
  .empty {
    flex: 0 0 auto;
    padding: 24px 8px;
  }
  .card-stem {
    font-size: 17px;
    line-height: 1.65;
    margin-top: 0;
  }
  .options,
  .fill-area {
    margin-top: 14px;
  }
  .options {
    gap: 12px;
  }
  .opt {
    padding: 14px 14px;
    font-size: 15px;
    min-height: 48px;
  }
  .fill-area input {
    font-size: 16px;
    padding: 12px 12px;
  }
  .answer {
    margin-top: 12px;
  }

  footer {
    flex-shrink: 0;
    padding: 8px 0 calc(12px + env(safe-area-inset-bottom, 0px));
  }
  .btn.primary,
  .btn.mark {
    min-height: 48px;
    font-size: 16px;
  }
  .progress {
    font-size: 12px;
  }

  .lykie-panel {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    z-index: 55;
    border-left: none;
    box-shadow: none;
  }
  .lykie-composer {
    min-height: 88px;
    padding: 10px 10px 40px;
    margin: 8px 10px calc(10px + env(safe-area-inset-bottom, 0px));
  }
  .lykie-composer textarea {
    min-height: 56px;
    height: 56px;
    max-height: 140px;
    font-size: 16px;
  }
  button.lykie-send {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    max-width: 36px;
    max-height: 36px;
    border-radius: 10px;
    font-size: 16px;
    line-height: 36px;
  }

  .modal-box {
    width: min(94vw, 480px);
    max-height: min(90dvh, 640px);
    overflow-y: auto;
  }
}

.peek-debug {
  display: none !important;
}

/* ==================== 登录 ==================== */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px;
  background:
    radial-gradient(ellipse 100% 70% at 50% -20%, var(--bg-wash-a), transparent 55%),
    radial-gradient(ellipse 60% 50% at 90% 110%, var(--bg-wash-b), transparent 45%),
    linear-gradient(165deg, #dfe9eb 0%, var(--bg) 45%, #e4ebe8 100%);
  background-attachment: scroll;
}
[data-theme="dark"] .login-body {
  background:
    radial-gradient(ellipse 100% 70% at 50% -20%, var(--bg-wash-a), transparent 55%),
    radial-gradient(ellipse 60% 50% at 90% 110%, var(--bg-wash-b), transparent 45%),
    linear-gradient(165deg, #0c1214 0%, var(--bg) 50%, #121a1c 100%);
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 36px 30px 32px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 12px 40px rgba(26, 42, 46, .08);
}
[data-theme="dark"] .login-card {
  box-shadow: 0 12px 40px rgba(0, 0, 0, .35);
}
.login-card .brand-title {
  font-size: clamp(2.4rem, 6vw, 3rem);
  margin-bottom: 2px;
}
.login-tagline {
  text-align: center;
  font-size: 15px;
  color: var(--primary);
  font-weight: 500;
  margin-bottom: 6px;
  letter-spacing: 0.04em;
}
.login-lead, .login-hint {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
  margin-bottom: 8px;
}
.login-error {
  color: var(--wrong-text);
  background: var(--wrong-bg);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
}
.login-label {
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
}
.login-card input {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 16px;
  font-family: inherit;
  background: var(--card);
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.login-card input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--tag-primary-bg);
}
.login-submit {
  margin-top: 16px;
}
.login-hint code {
  font-size: 12px;
  word-break: break-all;
}

@media (max-width: 720px) {
  .login-body {
    padding: 16px;
    align-items: flex-start;
    padding-top: max(24px, env(safe-area-inset-top, 0px));
  }
  .login-card {
    padding: 28px 20px 24px;
    border-radius: 16px;
  }
  .login-card .brand-title {
    font-size: clamp(2.1rem, 10vw, 2.6rem);
  }
  .login-card input {
    font-size: 16px;
  }
  .login-submit {
    min-height: 48px;
  }
}

/* ==================== 微交互：桌面悬停抬起（触摸不粘滞） ==================== */
@media (hover: hover) and (pointer: fine) {
  .btn.ghost:hover {
    opacity: 1;
    transform: translateY(-1px) scale(1.02);
    background: color-mix(in srgb, var(--primary) 8%, transparent);
  }
  .btn.ghost.danger:hover {
    background: color-mix(in srgb, var(--muted) 10%, transparent);
  }
  .btn.primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: var(--lift-2);
    filter: brightness(1.06);
  }
  .btn.mark:hover {
    opacity: 1;
    transform: translateY(-2px) scale(1.02);
    box-shadow: var(--lift-2);
    filter: brightness(1.05);
  }
  .btn.kill:hover {
    transform: translateY(-2px);
    box-shadow: var(--lift-1);
  }
  .btn.ask-lykie:hover,
  .btn.edit:hover,
  .btn.lykie-tool:hover {
    transform: translateY(-1px);
  }
  .opt:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--lift-1);
  }
  .bank-item:hover {
    /* 不用 translate：相邻项间隙里会来回抢 hover 导致抽搐 */
    border-left-color: color-mix(in srgb, var(--primary) 55%, transparent);
    box-shadow: var(--lift-1);
  }
  .card:hover {
    box-shadow: var(--lift-1);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .card.card-enter {
    animation: none;
  }
  .card.fx-correct,
  .card.fx-miss,
  .card.fx-combo-10,
  .card.fx-kill,
  .combo-badge.combo-pop,
  .combo-badge.combo-pop-mid,
  .combo-badge.combo-pop-big,
  .kill-fill.fx-kill-pulse,
  .progress.fx-kill-pulse,
  .lykie-peeker-head.fx-peeker-nod,
  .lykie-peeker-head.fx-peeker-cheer,
  .kill-cheer.is-in,
  .kill-cheer.is-out,
  .kill-bolts.zap-25,
  .kill-bolts.zap-50,
  .kill-bolts.zap-75,
  .kill-bolts.zap-100,
  .kill-bolts .kill-bolt,
  .kill-bolts .kill-spark,
  .btn.kill.kill-zap-25 .kill-fill,
  .btn.kill.kill-zap-50 .kill-fill,
  .btn.kill.kill-zap-75 .kill-fill,
  .btn.kill.kill-zap-100 .kill-fill {
    animation: none !important;
  }
  .lykie-peeker {
    animation: none !important;
  }
  .lykie-peeker-head {
    animation: none !important;
  }
  .btn:hover,
  .btn:active,
  .opt:hover:not(:disabled),
  .opt:active:not(:disabled),
  .bank-item:hover,
  .lykie-peeker-btn:hover,
  .lykie-peeker-btn:active,
  .celestial-btn:hover .celestial-icon,
  .celestial-btn:active .celestial-icon {
    transform: none;
  }
}

/* —— 模考 / 错题本 —— */
.bank-section-label {
  list-style: none;
  padding: 14px 10px 6px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.06em;
}
/* bank-folder 系列已废弃：文件夹改为左栏 folder-nav，旧折叠块样式移除 */
.bank-item.drag-over-before::before,
.bank-item.drag-over-after::after {
  content: '';
  position: absolute;
  left: 8px;
  right: 8px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
  pointer-events: none;
  z-index: 2;
}
.bank-item.drag-over-before::before {
  top: -1px;
}
.bank-item.drag-over-after::after {
  bottom: -1px;
}

.bank-drag-placeholder {
  border: 2px dashed var(--primary);
  border-radius: 10px;
  background: color-mix(in srgb, var(--card) 50%, var(--primary) 5%);
  min-height: 60px;
}

/* 拖拽球体徽章：题库拖起时跟随鼠标的小球（方案A），深浅主题自动反色 */
.bank-drag-chip {
  position: fixed;
  z-index: 1100;
  pointer-events: none;
  background: var(--text);
  color: var(--surface);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
  white-space: nowrap;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: none;
}

/* bank-item-nested 已废弃：嵌套层级由左栏导航承担 */

/* ---- 试卷影子条目（阅读卷入口投影，数据在 readings.json） ---- */
.paper-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 6px;
  padding: 0 5px;
  margin-right: 6px;
  line-height: 1.5;
  vertical-align: 1px;
}

/* ---- 归档抽屉已废弃（归档=左栏预设项），归档题库弱化样式保留 ---- */
.bank-item-archived {
  opacity: 0.62;
  filter: saturate(0.55);
}
.bank-item-archived .bank-name {
  font-weight: 500;
}

/* ---- 时间灰字 ---- */
.bank-ago {
  color: var(--muted);
  font-size: 12px;
}

/* ---- ⋯ 二级菜单 ---- */
.bank-more-menu {
  position: fixed;
  z-index: 1200;
  min-width: 128px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
  display: flex;
  flex-direction: column;
}
.bank-more-item {
  border: none;
  background: transparent;
  text-align: left;
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
}
.bank-more-item:hover {
  background: color-mix(in srgb, var(--primary) 10%, transparent);
}
.bank-more-item.danger {
  color: var(--red);
}
body.is-bank-dragging {
  user-select: none;
}
.bank-item.bank-mock {
  border-left: 3px solid color-mix(in srgb, var(--primary) 55%, transparent);
}
.bank-item.bank-mock .bank-progress { color: var(--primary); }
.mock-timer-wrap {
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}
.mock-timer-wrap #mockTimer {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--primary);
  margin-left: 4px;
}
.collection-checks {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 40vh;
  overflow: auto;
  margin: 12px 0;
}
.collection-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  background: var(--card);
}
.collection-check small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}
.mock-settle-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0 18px;
}
.mock-settle-tile {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: var(--card);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mock-settle-tile .lab { font-size: 12px; color: var(--muted); }
.mock-settle-tile .val {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  font-family: var(--font-display);
}
.mock-wrong-list { display: flex; flex-direction: column; gap: 8px; }
.mock-wrong-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--card);
}
.mock-wrong-top { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.mock-wrong-stem { font-size: 14px; line-height: 1.5; }
.mock-settle-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}
.mock-lobby {
  text-align: left;
  max-width: 440px;
  margin: 0 auto;
  padding: 8px 4px 20px;
}
.mock-lobby-title {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  margin: 0 0 6px;
  text-align: center;
  color: var(--text);
}
.mock-lobby-sub {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 18px;
}
.mock-lobby-rules {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mock-lobby-rules li {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--card) 92%, var(--primary) 4%);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
}
.mock-lobby-rules strong {
  display: block;
  margin-bottom: 2px;
  font-size: 13px;
  color: var(--primary);
}
.mock-lobby-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mock-lobby-actions .btn {
  width: 100%;
}
.mock-leave-box {
  max-width: 400px;
}
.mock-leave-lead {
  font-size: 15px;
  margin: 0 0 12px;
  color: var(--text);
}
.mock-leave-tips {
  margin: 0 0 18px;
  padding-left: 1.15em;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}
.mock-leave-tips li { margin: 4px 0; }
.mock-leave-tips strong { color: var(--text); }
.mock-leave-actions {
  flex-wrap: wrap;
}
.mock-leave-actions .btn {
  flex: 1 1 auto;
  min-width: 96px;
}
.wrong-book-box { max-width: 520px; }
.wrong-book-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; max-height: 50vh; overflow: auto; }
.wrong-set-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
}
.wrong-set-main { flex: 1; min-width: 0; }
.wrong-set-name { font-size: 14px; font-weight: 600; }
.wrong-set-meta { font-size: 12px; color: var(--muted); }
body.mode-mock .ask-lykie,
body.mode-wrong .ask-lykie,
body.mode-mock #editBtn,
body.mode-wrong #editBtn { display: none !important; }
