/**
 * 拾光主题 · 订阅系统样式
 */

/* ============================================================
   弹窗
   ============================================================ */

.sg-sub-modal{
  position: fixed;
  inset: 0;
  z-index: 400;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.sg-sub-modal.open{
  display: flex;
}

.sg-sub-mask{
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .4);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  animation: sg-sub-fade .25s var(--sg-ease);
  z-index: 1;
}

@keyframes sg-sub-fade{
  from { opacity: 0; }
  to   { opacity: 1; }
}

.sg-sub-panel{
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 420px;
  padding: 32px 28px 24px;
  background: rgba(255, 255, 255, .96);
  -webkit-backdrop-filter: blur(40px);
  backdrop-filter: blur(40px);
  border: 1px solid rgba(255, 255, 255, .95);
  border-radius: 26px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .25);
  animation: sg-sub-slide .35s var(--sg-ease);
  overflow: hidden;
}

@keyframes sg-sub-slide{
  from { opacity: 0; transform: translateY(20px) scale(.94); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.sg-sub-close{
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .05);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sg-text-2);
  transition: all var(--sg-dur-fast) var(--sg-ease);
}

.sg-sub-close:hover{
  background: rgba(0, 0, 0, .1);
  color: var(--sg-text);
}

.sg-sub-close:active{
  transform: scale(.94);
}

.sg-sub-close svg{
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.4;
  stroke-linecap: round;
}

.sg-sub-icon{
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(10, 132, 255, .14), rgba(94, 92, 230, .14));
  border: 1px solid rgba(10, 132, 255, .16);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  color: var(--sg-accent);
}

.sg-sub-icon svg{
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sg-sub-title{
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.025em;
  color: var(--sg-text);
  line-height: 1.2;
  margin-bottom: 8px;
}

.sg-sub-desc{
  font-size: 13.5px;
  color: var(--sg-text-2);
  line-height: 1.55;
  margin-bottom: 22px;
}

.sg-sub-input{
  width: 100%;
  height: 50px;
  padding: 0 16px 0 44px;
  font-size: 15px;
  font-family: inherit;
  color: var(--sg-text);
  background: rgba(255, 255, 255, .8);
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 14px;
  outline: none;
  transition: all var(--sg-dur-base) var(--sg-ease);
  margin-bottom: 12px;
}

.sg-sub-input:focus{
  background: #fff;
  border-color: rgba(10, 132, 255, .4);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, .1);
}

.sg-sub-input::placeholder{
  color: var(--sg-text-3);
}

.sg-sub-input-wrap{
  position: relative;
}

.sg-sub-input-wrap svg{
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  stroke: var(--sg-text-3);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}

.sg-sub-submit{
  width: 100%;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: var(--sg-brand);
  border: none;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: var(--sg-shadow-brand);
  transition: all var(--sg-dur-base) var(--sg-ease);
  margin-bottom: 14px;
}

.sg-sub-submit:hover{
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(59, 91, 253, .42);
}

.sg-sub-submit:active{
  transform: translateY(0) scale(.98);
}

.sg-sub-submit:disabled{
  opacity: .6;
  cursor: not-allowed;
  transform: none;
}

.sg-sub-submit svg{
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sg-sub-foot{
  font-size: 11.5px;
  color: var(--sg-text-3);
  text-align: center;
  line-height: 1.5;
}

.sg-sub-foot a{
  color: var(--sg-accent);
  text-decoration: none;
}

.sg-sub-foot a:hover{
  text-decoration: underline;
}

/* 成功态 */
.sg-sub-success{
  display: none;
  text-align: center;
  padding: 8px 0;
}

.sg-sub-success.show{
  display: block;
  animation: sg-sub-fade .35s var(--sg-ease);
}

.sg-sub-success-icon{
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(48, 209, 88, .16), rgba(48, 209, 88, .08));
  border: 1px solid rgba(48, 209, 88, .25);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: #30d158;
}

.sg-sub-success-icon svg{
  width: 28px;
  height: 28px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sg-sub-success .sg-sub-title{
  margin-bottom: 6px;
}

.sg-sub-success .sg-sub-desc{
  margin-bottom: 0;
}

/* 错误态 */
.sg-sub-error{
  font-size: 12.5px;
  color: var(--sg-danger);
  margin-top: 10px;
  text-align: center;
  display: none;
}

.sg-sub-error.show{
  display: block;
}

/* ============================================================
   Toast（复用主站风格）
   ============================================================ */

.sg-toast{
  position: fixed;
  top: 74px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  padding: 13px 22px;
  background: rgba(28, 28, 32, .92);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, .08);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: 100px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .28), 0 4px 12px rgba(0, 0, 0, .16);
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s var(--sg-ease), transform .35s var(--sg-ease);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  max-width: calc(100% - 40px);
}

.sg-toast.show{
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.sg-toast-icon{
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #30d158, #34c759);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sg-toast-icon svg{
  width: 11px;
  height: 11px;
  stroke: #fff;
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ============================================================
   响应式
   ============================================================ */

@media (max-width: 480px){
  .sg-sub-modal{
    padding: 16px;
  }

  .sg-sub-panel{
    padding: 28px 22px 20px;
    border-radius: 22px;
  }

  .sg-sub-title{
    font-size: 20px;
  }

  .sg-sub-icon{
    width: 46px;
    height: 46px;
    border-radius: 14px;
    margin-bottom: 14px;
  }

  .sg-sub-icon svg{
    width: 22px;
    height: 22px;
  }
}

/* ============================================================
   输入框 · 图标与文字间距修正
   ============================================================ */

.sg-sub-input{
  padding: 0 16px 0 48px !important;
}

.sg-sub-input-wrap{
  position: relative;
  display: block;
}

.sg-sub-input-wrap svg{
  position: absolute !important;
  left: 16px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 18px !important;
  height: 18px !important;
  max-width: 18px !important;
  max-height: 18px !important;
  stroke: var(--sg-text-3) !important;
  fill: none !important;
  stroke-width: 2 !important;
  stroke-linecap: round !important;
  pointer-events: none;
  z-index: 1;
}

/* 输入框在图标之上（避免点击时图标挡住输入） */
.sg-sub-input{
  position: relative;
  z-index: 2;
}