* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft YaHei", sans-serif;
}

body {
    background: #eef1f5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
    min-height: 100dvh;
    padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px))
        max(20px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}

/* 卡片内顶部：品牌 + 回官网（居中，不占整行左右分栏） */
.auth-pre {
    text-align: center;
    margin: 0 0 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f0f2f5;
}
.auth-pre__brand {
    display: block;
    font-size: 17px;
    font-weight: 800;
    color: #1f2937;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}
.auth-pre__home {
    display: inline-block;
    font-size: 13px;
    font-weight: 500;
    color: #0d7a6e;
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(13, 122, 110, 0.08);
    -webkit-tap-highlight-color: transparent;
}
.auth-pre__home:hover {
    background: rgba(13, 122, 110, 0.14);
    text-decoration: none;
}
.auth-pre__home:active {
    background: rgba(13, 122, 110, 0.2);
}

.container {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
    padding: 28px 30px 35px;
    margin: 0 auto;
}

@media (max-width: 480px) {
    body {
        padding-left: max(12px, env(safe-area-inset-left, 0px));
        padding-right: max(12px, env(safe-area-inset-right, 0px));
    }
    .container {
        padding: 22px 18px 28px;
        border-radius: 14px;
        max-width: none;
        box-shadow: 0 4px 24px rgba(15, 23, 42, 0.07);
        border: 1px solid #e8eaed;
    }
    .auth-pre {
        margin-bottom: 16px;
        padding-bottom: 12px;
    }
}

.title {
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 10px;
    color: #333;
}

.desc {
    text-align: center;
    color: #999;
    font-size: 13px;
    margin-bottom: 30px;
}

.tab-box {
    display: flex;
    margin-bottom: 25px;
    border-bottom: 1px solid #eee;
}

.tab {
    flex: 1;
    text-align: center;
    padding: 12px 0;
    cursor: pointer;
    font-size: 15px;
    color: #666;
    position: relative;
    transition: all 0.2s;
}

.tab.active {
    color: #409eff;
    font-weight: bold;
}

.tab.active::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: #409eff;
}

.form-item {
    margin-bottom: 18px;
}

.form-item label {
    display: block;
    font-size: 13px;
    color: #555;
    margin-bottom: 6px;
}

.form-item .input-line {
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-item select {
    height: 44px;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 0 8px;
    outline: none;
    min-width: 80px;
    background: white;
}

.form-item input {
    width: 100%;
    height: 44px;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 0 14px;
    font-size: 14px;
    outline: none;
    transition: border 0.2s;
}

.form-item input:focus {
    border-color: #409eff;
}

.code-btn {
    white-space: nowrap;
    padding: 0 12px;
    height: 44px;
    border: 1px solid #409eff;
    background: #fff;
    color: #409eff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    min-width: 110px;
}

.code-btn:disabled {
    background: #f5f7fa;
    color: #999;
    border-color: #ddd;
    cursor: not-allowed;
}

.domain-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.domain-row input {
    flex: 1;
}

.domain-row select {
    height: 44px;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 0 8px;
    outline: none;
    background: white;
}

input:disabled {
    background: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

.error {
    color: #f56c6c;
    font-size: 12px;
    margin-top: 4px;
    height: 16px;
}

.btn-submit {
    width: 100%;
    height: 46px;
    background: #409eff;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    cursor: pointer;
    margin-top: 10px;
    transition: background 0.2s;
}

.btn-submit:hover {
    background: #3388e8;
}

.btn-submit:disabled,
.btn-submit[disabled] {
    background: #a0cfff;
    cursor: not-allowed;
}

.btn-submit:disabled:hover,
.btn-submit[disabled]:hover {
    background: #a0cfff;
}

.is-hidden {
    display: none !important;
}

/* 门户等页面切换显隐（与 .is-hidden 并存） */
.hidden {
    display: none !important;
}

/* 注册前：绑定服务用户协议门禁 */
.terms-gate {
    text-align: left;
}
.terms-gate__title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #1f2937;
    line-height: 1.35;
    margin-bottom: 0.35rem;
}
.terms-gate__meta {
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 0.85rem;
}
.terms-gate__notice {
    font-size: 0.8rem;
    line-height: 1.55;
    color: #374151;
    margin-bottom: 1rem;
    padding: 10px 12px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
}
.terms-gate__body {
    max-height: min(45vh, 320px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px 12px 10px;
    margin-bottom: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fafafa;
    font-size: 0.78rem;
    line-height: 1.55;
    color: #374151;
}
.terms-gate__body h3 {
    font-size: 0.88rem;
    margin: 1rem 0 0.45rem;
    color: #111827;
}
.terms-gate__body h3:first-child {
    margin-top: 0;
}
.terms-gate__body ol {
    padding-left: 1.1rem;
    margin: 0.25rem 0 0.5rem;
}
.terms-gate__body li {
    margin-bottom: 0.35rem;
}
.terms-gate__body code {
    font-size: 0.85em;
    background: #fff;
    padding: 1px 5px;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
}
.terms-gate__confirm {
    font-size: 0.78rem;
    line-height: 1.55;
    color: #374151;
    margin-bottom: 12px;
    padding: 10px 12px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px dashed #d1d5db;
}
.terms-gate__online-note {
    font-size: 0.72rem;
    color: #6b7280;
    margin-top: 8px;
}
.terms-gate__check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.85rem;
    line-height: 1.45;
    color: #111827;
    margin-bottom: 10px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.terms-gate__check input {
    margin-top: 3px;
    flex-shrink: 0;
}
.terms-gate__continue {
    margin-top: 4px;
}

.register-form-wrap {
    text-align: left;
}

.panel {
    display: none;
}

.panel.active {
    display: block;
}

/* ========== 滑块验证 - 优化版 ========== */
.slider {
    position: relative;
    width: 100%;
    height: 44px;
    background: #e8e8e8;  /* 浅灰色背景 */
    border-radius: 22px;  /* 圆形边框 */
    margin-bottom: 10px;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
    touch-action: none;
}

/* 滑块背景条 - 移动部分 */
.slider::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 100%;
    background: #409eff;  /* 蓝色背景表示已滑动区域 */
    border-radius: 22px;
    transition: width 0.1s ease;
    z-index: 1;
}

.slider-block {
    position: absolute;
    left: 0;
    top: 0;
    width: 44px;
    height: 44px;
    background: #fff;
    border: 1px solid #409eff;
    border-radius: 50%;  /* 圆形滑块 */
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #409eff;
    font-size: 20px;
    transition: box-shadow 0.2s;
    z-index: 3;
    box-shadow: 0 2px 6px rgba(64,158,255,0.3);
    touch-action: none;
}

.slider-block:active {
    cursor: grabbing;
    box-shadow: 0 4px 10px rgba(64,158,255,0.5);
    transform: scale(1.02);
}

.slider-text {
    position: absolute;
    width: 100%;
    height: 100%;
    line-height: 44px;
    text-align: center;
    font-size: 14px;
    color: #666;
    z-index: 2;
    pointer-events: none;
    left: 0;
}

/* 手机端适配 */
@media (max-width: 768px) {
    .slider {
        height: 40px;
    }
    
    .slider-block {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .slider-text {
        line-height: 40px;
        font-size: 13px;
    }
}

/* 小屏手机 */
@media (max-width: 375px) {
    .slider {
        height: 38px;
    }
    
    .slider-block {
        width: 38px;
        height: 38px;
    }
    
    .slider-text {
        line-height: 38px;
        font-size: 12px;
    }
}