/* ===== 访问控制弹窗样式 (access-gate) ===== */

.access-gate {
  position: relative;
  background: #fff;
  border-radius: 12px;
  width: min(720px, 92vw);
  max-height: 92vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.24);
  animation: agPop 0.25s ease-out;
}
@keyframes agPop {
  from { opacity: 0; transform: scale(0.95) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.access-gate-header {
  padding: 20px 24px 16px;
  background: linear-gradient(180deg, #1e7e34 0%, #166028 100%);
  color: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.access-gate-header h2 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 600;
  color: #fff;
}
.access-gate-subtitle {
  margin: 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
}

.access-gate-tabs {
  display: flex;
  background: #f5f7f5;
  border-bottom: 1px solid #e0e0e0;
}
.ag-tab {
  flex: 1;
  background: none;
  border: none;
  padding: 12px 8px;
  font-size: 14px;
  cursor: pointer;
  color: #555;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  font-family: inherit;
}
.ag-tab:hover {
  background: #e9efe9;
  color: #1e7e34;
}
.ag-tab.active {
  color: #1e7e34;
  background: #fff;
  border-bottom-color: #1e7e34;
  font-weight: 600;
}

.access-gate-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 16px;
}
.ag-panel {
  display: none;
}
.ag-panel.active {
  display: block;
  animation: agFadeIn 0.2s;
}
@keyframes agFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 规则说明 tab */
.ag-notice h3 {
  margin: 0 0 12px;
  color: #1e7e34;
  font-size: 16px;
}
.ag-notice > p {
  margin: 0 0 16px;
  color: #444;
  line-height: 1.6;
}
.ag-rule-card {
  background: #f7faf7;
  border-left: 4px solid #1e7e34;
  padding: 12px 14px;
  border-radius: 6px;
  margin-bottom: 12px;
}
.ag-rule-card h4 {
  margin: 0 0 8px;
  font-size: 14px;
  color: #1e7e34;
}
.ag-rule-card ul {
  margin: 0;
  padding-left: 22px;
  line-height: 1.85;
  color: #444;
  font-size: 13.5px;
}
.ag-rule-card ul li {
  margin-bottom: 2px;
}
.ag-rule-card strong {
  color: #c0392b;
}
.ag-warning {
  background: #fff7e6;
  border: 1px solid #ffd591;
  border-radius: 6px;
  padding: 10px 14px;
  margin-top: 14px;
}
.ag-warning p {
  margin: 4px 0;
  color: #874d00;
  font-size: 13px;
  line-height: 1.7;
}
.ag-warning strong {
  color: #b35900;
}

/* 邀请码 / 管理员 表单 */
.ag-form h3 {
  margin: 0 0 8px;
  color: #1e7e34;
  font-size: 16px;
}
.ag-form > p {
  margin: 0 0 16px;
  color: #666;
  font-size: 13.5px;
}
.ag-input-group {
  display: flex;
  gap: 10px;
  align-items: center;
}
.ag-input-group input[type="text"] {
  flex: 1;
  font-size: 18px;
  letter-spacing: 2px;
  font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
  text-align: center;
  padding: 10px 12px;
  border: 2px solid #d0d0d0;
  border-radius: 6px;
  outline: none;
  text-transform: none;
  transition: border-color 0.15s;
}
.ag-input-group input[type="text"]:focus {
  border-color: #1e7e34;
}
.ag-field {
  margin-bottom: 12px;
}
.ag-field label {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  color: #555;
  font-weight: 500;
}
.ag-field input {
  width: 100%;
  padding: 8px 10px;
  border: 1.5px solid #d0d0d0;
  border-radius: 5px;
  font-size: 14px;
  outline: none;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.ag-field input:focus {
  border-color: #1e7e34;
}
.ag-msg {
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: 5px;
  font-size: 13.5px;
  min-height: 1em;
  text-align: center;
}
.ag-msg.success {
  background: #e6f7ec;
  color: #1e7e34;
  border: 1px solid #b3e0c1;
}
.ag-msg.error {
  background: #fff1f0;
  color: #c0392b;
  border: 1px solid #ffccc7;
}
/* 按钮 */
.btn-primary, .btn-secondary {
  font-family: inherit;
  cursor: pointer;
  border: none;
  border-radius: 6px;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-primary {
  background: #1e7e34;
  color: #fff;
}
.btn-primary:hover {
  background: #166028;
}
.btn-primary:active {
  transform: translateY(1px);
}
.btn-secondary {
  background: #fff;
  color: #555;
  border: 1px solid #d0d0d0;
}
.btn-secondary:hover {
  background: #f5f5f5;
  color: #1e7e34;
  border-color: #1e7e34;
}

.ag-actions {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px dashed #e0e0e0;
  display: flex;
  justify-content: center;
  gap: 10px;
}

/* 用户状态栏 */
.access-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  padding: 4px 10px;
  border-radius: 12px;
  background: #f0f0f0;
  color: #666;
}
.access-status.active {
  background: #e6f7ec;
  color: #1e7e34;
}
.access-status .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #999;
}
.access-status.active .dot {
  background: #1e7e34;
  box-shadow: 0 0 0 2px rgba(30, 126, 52, 0.2);
}
.access-status button {
  background: none;
  border: none;
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
  padding: 0;
  margin-left: 4px;
}

/* 响应式 */
@media (max-width: 600px) {
  .access-gate-tabs .ag-tab {
    font-size: 12px;
    padding: 10px 4px;
  }
  .ag-input-group {
    flex-direction: column;
  }
  .ag-input-group input {
    width: 100%;
  }
}

/* ===== 爱发电赞助引导卡 ===== */
.ag-sponsor {
  margin-top: 20px;
  padding: 16px 18px;
  background: linear-gradient(135deg, #fff8f0 0%, #fff1e0 100%);
  border: 1px solid #ffd9b3;
  border-radius: 10px;
  position: relative;
}
.ag-sponsor::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, #ff9a3c 0%, #ff6b35 100%);
  border-radius: 10px 0 0 10px;
}
.ag-sponsor h3 {
  margin: 0 0 10px;
  color: #b35900;
  font-size: 15.5px;
  font-weight: 600;
}
.ag-sponsor-disclaimer {
  font-size: 13px;
  color: #5c3b00;
  line-height: 1.75;
  margin-bottom: 14px;
}
.ag-sponsor-disclaimer p {
  margin: 6px 0;
}
.ag-sponsor-disclaimer strong {
  color: #c0392b;
}
.btn-afdian {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 18px;
  background: linear-gradient(135deg, #ff9a3c 0%, #ff6b35 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
  transition: all 0.2s;
}
.btn-afdian:hover {
  background: linear-gradient(135deg, #ff8a2c 0%, #ff5b25 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(255, 107, 53, 0.4);
}
.btn-afdian:active {
  transform: translateY(0);
}
.btn-afdian .afdian-icon {
  font-size: 18px;
}
.btn-afdian .afdian-ext {
  margin-left: auto;
  font-size: 16px;
  opacity: 0.85;
}

/* 获取与使用步骤 */
.ag-howto {
  margin-top: 16px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  border: 1px solid #ffd9b3;
}
.ag-howto p {
  margin: 0 0 8px;
  color: #b35900;
  font-size: 13.5px;
  font-weight: 600;
}
.ag-howto ol {
  margin: 0;
  padding-left: 22px;
  font-size: 12.5px;
  color: #5c3b00;
  line-height: 1.85;
}
.ag-howto ol li {
  margin-bottom: 2px;
}
.ag-howto code {
  background: rgba(255, 154, 60, 0.12);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
  font-size: 12px;
  color: #b35900;
}
.ag-howto strong {
  color: #c0392b;
}
