/* 蜗牛叔叔 · 权限闸门 / 模态 样式 */

.sn-gate-overlay {
  position: fixed; inset: 0;
  background: rgba(20, 22, 30, 0.55);
  backdrop-filter: blur(3px);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.sn-gate-overlay.show { display: flex; }

.sn-gate-modal {
  background: #FDF9F3;
  border: 1.5px solid #2D3142;
  border-radius: 16px;
  box-shadow: 5px 5px 0 #2D3142;
  width: 100%;
  max-width: 380px;
  padding: 28px 24px 24px;
  font-family: -apple-system, "PingFang SC", sans-serif;
  color: #2D3142;
  position: relative;
  animation: sn-pop 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes sn-pop { from { transform: scale(0.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.sn-gate-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 30px; height: 30px;
  border: none; background: transparent;
  font-size: 22px; color: #7D8099; cursor: pointer;
  border-radius: 50%;
}
.sn-gate-close:hover { background: rgba(45,49,66,0.06); color: #2D3142; }

.sn-gate-title {
  font-family: "Noto Serif SC", serif;
  font-weight: 900;
  font-size: 20px;
  margin: 0 0 6px;
}
.sn-gate-title em {
  color: #FF8A6B;
  font-style: normal;
}
.sn-gate-sub {
  font-size: 13px;
  color: #7D8099;
  margin-bottom: 18px;
  line-height: 1.6;
}

.sn-gate-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid rgba(45,49,66,0.25);
  border-radius: 10px;
  background: #fff;
  font-size: 15px;
  font-family: inherit;
  color: #2D3142;
  margin-bottom: 12px;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.sn-gate-input:focus {
  outline: none;
  border-color: #FF8A6B;
}
.sn-gate-input.code {
  letter-spacing: 0.15em;
  font-family: "Fraunces", Menlo, monospace;
  text-transform: uppercase;
}

.sn-gate-row { display: flex; gap: 8px; align-items: stretch; margin-bottom: 12px; }
.sn-gate-row .sn-gate-input { flex: 1; margin-bottom: 0; }

.sn-gate-btn {
  width: 100%;
  padding: 14px;
  border: 1.5px solid #2D3142;
  border-radius: 10px;
  background: #2D3142;
  color: #FDF9F3;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 3px 3px 0 #2D3142;
  margin-top: 6px;
  transition: transform 0.1s, box-shadow 0.1s;
}
.sn-gate-btn:hover:not(:disabled) {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 #2D3142;
}
.sn-gate-btn:active:not(:disabled) {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 #2D3142;
}
.sn-gate-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: 1px 1px 0 #2D3142;
}
.sn-gate-btn.secondary {
  background: transparent;
  color: #2D3142;
}
.sn-gate-btn.send-code {
  width: auto;
  padding: 0 14px;
  font-size: 13px;
  margin-top: 0;
  white-space: nowrap;
}

.sn-gate-msg {
  font-size: 13px;
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  display: none;
}
.sn-gate-msg.error { background: #FFE5DC; color: #C44A2C; display: block; }
.sn-gate-msg.success { background: #DEEEE9; color: #37968A; display: block; }

.sn-gate-tip {
  font-size: 12px;
  color: #7D8099;
  margin-top: 14px;
  text-align: center;
  line-height: 1.7;
}
.sn-gate-tip a { color: #E56B4E; text-decoration: none; }

.sn-gate-divider {
  text-align: center;
  margin: 14px 0;
  font-size: 11px;
  color: #B0AEA7;
  letter-spacing: 0.15em;
}

/* ============ 内嵌锁标记(贴在书卡 / 板块上)============ */
.sn-locked {
  position: relative;
  cursor: pointer;
}
.sn-locked::before {
  content: "🔒";
  position: absolute;
  top: 6px; right: 6px;
  width: 24px; height: 24px;
  background: rgba(45, 49, 66, 0.85);
  color: #FFD166;
  font-size: 13px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  z-index: 5;
  pointer-events: none;
}
.sn-locked .sn-lock-mask {
  position: absolute; inset: 0;
  background: rgba(253, 249, 243, 0.5);
  backdrop-filter: blur(1px);
  border-radius: inherit;
  z-index: 4;
  pointer-events: none;
}

/* 已购书卡的"已购"角标 */
.sn-owned::after {
  content: "已激活";
  position: absolute;
  top: 6px; right: 6px;
  font-size: 9px;
  font-family: "Fraunces", serif;
  font-weight: 700;
  color: #fff;
  background: #4ABDAC;
  padding: 2px 7px;
  border-radius: 8px;
  letter-spacing: 0.04em;
  z-index: 5;
}

/* level/kit 页移动 navbar 上的 chip 容器:把宽度放开,右边对齐搜索栏 */
.navbar .nav-action {
  width: auto !important;
  height: 36px !important;
  margin-right: 2px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* ============ 头像 / 登录按钮(顶栏 · 全局设计语言)============ */
.sn-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  height: 36px;
  background: var(--cream);
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  box-shadow: 2px 2px 0 var(--ink);
  font-family: "Fraunces", serif;
  font-style: italic;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  box-sizing: border-box;
  transition: transform 0.1s, box-shadow 0.1s;
}
.sn-user-chip:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
.sn-user-chip:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }

/* 未登录态:cherry 强调色 */
.sn-user-chip.sn-chip-guest {
  background: var(--cherry);
  color: #fff;
}
.sn-user-chip.sn-chip-guest .sn-user-chip-avatar {
  background: var(--cream);
  color: var(--cherry-dark);
}

.sn-user-chip-avatar {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--cherry);
  border: 1px solid var(--ink);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: "Noto Serif SC", serif;
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ============ "我的"个人中心 ============ */
.sn-account-modal {
  max-width: 420px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sn-account-modal .sn-gate-title { flex-shrink: 0; }
.sn-account-modal .sn-account-header,
.sn-account-modal .sn-account-actions,
.sn-account-modal .sn-gate-btn-ghost,
.sn-account-modal > .sn-account-divider { flex-shrink: 0; }
.sn-account-modal .sn-account-list-wrap {
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
  margin: 0 -4px;
  padding: 0 4px;
}
.sn-account-row-meta {
  font-size: 11px;
  color: var(--ink-muted);
  margin-top: 3px;
  font-family: "LXGW WenKai TC", serif;
}
.sn-account-header { display: flex; align-items: center; gap: 12px; padding: 4px 0 4px; }
.sn-account-header .sn-user-chip-avatar { width: 40px; height: 40px; font-size: 16px; }
.sn-account-phone {
  font-family: "Noto Serif SC", serif;
  font-weight: 700; font-size: 15px; color: var(--ink);
}
.sn-account-summary { font-size: 12px; color: var(--ink-muted); margin-top: 2px; }
.sn-account-divider { height: 1px; background: rgba(45,49,66,0.12); margin: 14px 0; }
.sn-account-list { display: flex; flex-direction: column; gap: 8px; }
.sn-account-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 14px;
  background: #fff;
  border: 1.5px solid var(--ink);
  border-radius: 10px;
  box-shadow: 2px 2px 0 var(--ink);
}
.sn-account-row-name {
  font-family: "Noto Serif SC", serif;
  font-weight: 700; font-size: 13px;
}
.sn-account-row-go {
  font-family: "Fraunces", serif; font-style: italic;
  font-size: 12px; font-weight: 700;
  color: var(--cherry-dark);
  background: transparent; border: none; cursor: pointer; padding: 0;
}
.sn-account-empty {
  text-align: center; padding: 24px 16px;
  color: var(--ink-muted); font-size: 13px;
  background: var(--cream-2); border-radius: 10px;
}
.sn-account-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sn-account-actions .sn-gate-btn { margin-top: 0; }
.sn-gate-btn-ghost {
  width: 100%; padding: 10px;
  background: transparent; border: none;
  color: var(--ink-muted); font-size: 13px;
  font-family: "Fraunces", serif; font-style: italic;
  cursor: pointer; text-align: center;
}
.sn-gate-btn-ghost:hover { color: var(--cherry-dark); }

/* ============ Level 试读专区 banner ============ */
.level-trial-banner {
  /* 与 .level-search 左右对齐(margin: 0 22px) + 顶部更宽松 */
  margin: 22px 22px 18px;
  padding: 14px;
  background: linear-gradient(135deg, #FFECB8, #FFE5DC);
  border: 1.5px solid var(--ink);
  border-radius: 14px;
  box-shadow: 3px 3px 0 var(--ink);
  box-sizing: border-box;
}
.trial-label {
  font-family: "Fraunces", serif; font-style: italic; font-weight: 700;
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--cherry-dark); margin-bottom: 8px;
}
.trial-card {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border: 1.5px solid var(--ink);
  border-radius: 10px; padding: 10px;
  text-decoration: none; color: var(--ink);
  cursor: pointer;
}
.trial-card:active { transform: translate(2px, 2px); }
.trial-cover {
  width: 60px; height: 60px; border-radius: 4px;
  overflow: hidden; flex-shrink: 0;
  border: 1px solid rgba(45,49,66,0.2);
}
.trial-cover img { width: 100%; height: 100%; object-fit: cover; }
.trial-cover .emo {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; background: var(--cream-2);
}
.trial-info { flex: 1; min-width: 0; }
.trial-title-en {
  font-family: "Fraunces", serif; font-weight: 700;
  font-size: 15px; line-height: 1.2;
}
.trial-title-cn {
  font-size: 12px; color: var(--ink-muted); margin-top: 2px;
  font-family: "LXGW WenKai TC", serif;
}
.trial-meta {
  font-size: 10px; color: var(--ink-muted); margin-top: 4px;
  letter-spacing: 0.04em;
}
.trial-cta {
  font-family: "Fraunces", serif; font-style: italic; font-weight: 700;
  font-size: 11px; color: var(--ink);
  background: var(--sunny); border: 1px solid var(--ink);
  padding: 5px 10px; border-radius: 8px;
  flex-shrink: 0;
}
