/* ------------------------------------------------------------------
   JLPT 单词翻转卡 —— 激活码（离线许可证）界面样式
   ------------------------------------------------------------------
   跟随主题变量（--bg / --card / --accent / --ink …），
   四套主题（sakura / mint / ocean / ink）自动适配，不用额外写死颜色。
   ------------------------------------------------------------------ */

/* 未激活时锁住页面：内容不可点、不可滚动 */
html.license-locked,
html.license-locked body {
  overflow: hidden !important;
}

html.license-locked .app {
  /* 让底下的应用内容彻底看不见 */
  filter: blur(6px);
  opacity: 0.25;
  pointer-events: none;
  user-select: none;
}

/* ---------- 遮罩层 ---------- */
.license-overlay {
  position: fixed;
  inset: 0;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(20, 14, 16, 0.62);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  font-family: inherit;
}

.license-overlay[hidden] {
  display: none;
}

/* ---------- 弹窗本体 ---------- */
.license-box {
  width: 100%;
  max-width: 420px;
  padding: 28px 24px 22px;
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  text-align: center;
}

.license-title {
  margin: 0 0 8px;
  font-size: 20px;
  line-height: 1.4;
  font-weight: 700;
  color: var(--ink);
}

.license-desc {
  margin: 0 0 18px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

/* ---------- 输入区 ---------- */
.license-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.license-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  line-height: 1.5;
  color: var(--ink);
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.license-input::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

.license-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.license-input:disabled {
  opacity: 0.6;
}

.license-submit {
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.license-submit:disabled {
  opacity: 0.6;
  cursor: default;
}

/* ---------- 提示 ---------- */
.license-msg {
  margin: 14px 0 0;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.6;
  text-align: left;
}

.license-msg[hidden] {
  display: none;
}

.license-msg.is-error {
  color: #b42318;
  background: #fef3f2;
  border: 1px solid rgba(180, 35, 24, 0.22);
}

.license-msg.is-ok {
  color: var(--ok-ink);
  background: var(--ok-bg);
  border: 1px solid var(--ok-line);
}

.license-status {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.license-status[hidden] {
  display: none;
}

/* ---------- 输错时抖一下 ---------- */
.license-box.is-shake {
  animation: license-shake 0.36s ease;
}

@keyframes license-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(3px); }
}

/* 尊重用户的「减少动效」设置 */
@media (prefers-reduced-motion: reduce) {
  .license-box.is-shake {
    animation: none;
  }
}
