/* ==========================================================================
   课程公众号访问门禁（Access Gate）组件样式
   适配全套课程与移动端
   ========================================================================== */

/* 侧边栏徽章增强 */
.nav-link .gate-badge-free {
  display: inline-block;
  margin-left: auto;
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: 4px;
  background-color: #eaf2ef;
  color: #2f6f5e;
  font-weight: 600;
  white-space: nowrap;
}

.nav-link .gate-badge-lock {
  display: inline-block;
  margin-left: auto;
  font-size: 0.72rem;
  opacity: 0.65;
  transition: opacity 0.2s, color 0.2s;
}

.nav-link:hover .gate-badge-lock {
  opacity: 1;
}

.nav-link .gate-badge-unlocked {
  display: inline-block;
  margin-left: auto;
  font-size: 0.72rem;
  color: #2f6f5e;
  font-weight: bold;
}

/* 锁定状态下的内容遮罩与模糊 */
.lesson-locked-container {
  position: relative;
  min-height: 480px;
}

.lesson-locked-blur {
  user-select: none !important;
  -webkit-user-select: none !important;
  pointer-events: none !important;
  filter: blur(8px) grayscale(40%) !important;
  opacity: 0.35 !important;
  max-height: 520px;
  overflow: hidden !important;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.4) 40%, rgba(0, 0, 0, 0) 100%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.4) 40%, rgba(0, 0, 0, 0) 100%);
  transition: filter 0.3s ease, opacity 0.3s ease;
}

/* 解锁卡片浮层容器 */
.gate-card-wrapper {
  position: relative;
  margin: -360px auto 3rem auto;
  max-width: 680px;
  z-index: 20;
  padding: 0 1rem;
}

/* 精致解锁卡片 */
.gate-card {
  background: #ffffff;
  border: 1px solid #e3e4e2;
  border-radius: 16px;
  padding: 2.2rem 2.4rem;
  box-shadow: 0 16px 36px -10px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(47, 111, 94, 0.08);
  text-align: center;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.gate-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #2f6f5e 0%, #459a83 50%, #b3541e 100%);
}

/* 卡片顶部标签 */
.gate-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.8rem;
  background: #eaf2ef;
  color: #2f6f5e;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.gate-card-title {
  margin: 0 0 0.5rem 0;
  font-size: 1.45rem;
  font-weight: 700;
  color: #1a1d21;
  letter-spacing: -0.01em;
}

.gate-card-sub {
  margin: 0 0 1.6rem 0;
  font-size: 0.95rem;
  color: #7b838c;
  line-height: 1.5;
}

/* 二维码与步骤布局 */
.gate-card-body {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  background: #fbfbfa;
  border: 1px solid #f0f0ee;
  border-radius: 12px;
  padding: 1.4rem;
  margin-bottom: 1.6rem;
}

.gate-qr-box {
  flex-shrink: 0;
  text-align: center;
}

.gate-qr-img {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 10px;
  border: 2px solid #ffffff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  display: block;
  margin: 0 auto 0.45rem auto;
  background: #fff;
}

.gate-qr-tip {
  font-size: 0.75rem;
  color: #7b838c;
  margin: 0;
}

/* 步骤指引列表 */
.gate-steps {
  flex: 1;
  text-align: left;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.gate-steps li {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.88rem;
  color: #4a5158;
  line-height: 1.5;
}

.gate-step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #2f6f5e;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.gate-highlight {
  color: #b3541e;
  background: #fdf5f0;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid rgba(179, 84, 30, 0.2);
}

/* 口令输入区 */
.gate-form {
  display: flex;
  gap: 0.6rem;
  max-width: 440px;
  margin: 0 auto;
}

.gate-input {
  flex: 1;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  border: 1px solid #d0d2cf;
  border-radius: 8px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fff;
}

.gate-input:focus {
  border-color: #2f6f5e;
  box-shadow: 0 0 0 3px rgba(47, 111, 94, 0.15);
}

.gate-btn {
  padding: 0.75rem 1.4rem;
  background: #2f6f5e;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  white-space: nowrap;
}

.gate-btn:hover {
  background: #25584a;
}

.gate-btn:active {
  transform: scale(0.98);
}

/* 提示与状态信息 */
.gate-msg {
  min-height: 1.4rem;
  margin-top: 0.8rem;
  font-size: 0.85rem;
  transition: all 0.3s ease;
}

.gate-msg-error {
  color: #d32f2f;
}

.gate-msg-success {
  color: #2f6f5e;
  font-weight: bold;
}

/* 解锁后的轻量通知浮条 */
.gate-unlocked-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #eaf2ef;
  border: 1px solid #cce0d8;
  border-radius: 8px;
  padding: 0.6rem 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  color: #2f6f5e;
}

.gate-reset-btn {
  background: none;
  border: none;
  color: #7b838c;
  font-size: 0.75rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.gate-reset-btn:hover {
  color: #1a1d21;
}

/* 响应式适配移动端 */
@media (max-width: 640px) {
  .gate-card {
    padding: 1.6rem 1.2rem;
  }
  .gate-card-body {
    flex-direction: column;
    gap: 1.2rem;
    padding: 1rem;
  }
  .gate-qr-img {
    width: 120px;
    height: 120px;
  }
  .gate-form {
    flex-direction: column;
  }
  .gate-btn {
    width: 100%;
  }
  .gate-card-wrapper {
    margin-top: -300px;
  }
}
