/* =========================================
   全局重置与基础设置
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    transition: none !important; /* 👈 加上这一句，彻底干掉所有过渡动画 */
}

body {
    background-color: #f5f6f8;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px 0; /* 将原 40px 改小一点，减少上下溢出 */
    box-sizing: border-box; /* 防止 padding 撑大整体高度 */
    overflow-y: hidden; /* 如果依然有微小滚动条，直接隐藏垂直滚动条 */
}

a {
    text-decoration: none !important;
}

/* =========================================
   核心容器与布局
   ========================================= */
#app {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.main-card {
    background-color: #ffffff;
    width: 900px;
    min-height: 520px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
}

.main-card.is-form-page {
    width: 600px;
}

.top-bar {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    z-index: 10;
}

.top-bar a {
    font-size: 14px;
    color: #888;
    transition: color 0.2s;
}

.top-bar a:hover {
    color: #4e7ef2;
}

.hidden {
    display: none !important;
}

.view-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* =========================================
   页面视图样式 (双栏与单栏)
   ========================================= */
.login-layout {
    display: flex;
    height: 100%;
    flex: 1;
}

.login-left {
    flex: 1;
    padding: 80px 80px 40px 80px;
    display: flex;
    flex-direction: column;
}

.login-right {
    width: 380px;
    background-color: #fafbfc;
    border-left: 1px solid #f0f2f5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.form-page {
    padding: 80px 80px 40px 80px;
    display: flex;
    flex-direction: column;
    flex: 1;
    height: 100%;
}

.form-page form {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}

.page-title {
    font-size: 24px;
    color: #333;
    margin-bottom: 40px;
    font-weight: 500;
    width: 100%;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

.login-left .page-title {
    margin-left: 0;
}

/* =========================================
   表单输入框通用
   ========================================= */
.input-group {
    position: relative;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    width: 100%;
}

.input-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 15px;
}

.input-group.short {
    width: 120px;
    margin-bottom: 0;
}

.input-group.full {
    flex: 1;
    margin-bottom: 0;
}

.country-code {
    width: 100%;
    height: 48px;
    border: 1px solid #dcdfe6;
    border-radius: 24px;
    padding: 0 15px;
    font-size: 14px;
    color: #666;
    outline: none;
    appearance: none;
    background: #fff url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="%23888" stroke-width="2"><path d="M6 9l6 6 6-6"/></svg>') no-repeat right 15px center;
    cursor: pointer;
}

.input-group input {
    width: 100%;
    height: 48px;
    padding: 0 40px;
    border: 1px solid #dcdfe6;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.input-group input:focus {
    border-color: #4e7ef2;
}

.input-group input::placeholder {
    color: #b0b5c0;
}

.input-group .icon {
    position: absolute;
    left: 15px;
    color: #b0b5c0;
    display: flex;
    align-items: center;
}

.input-group .icon svg {
    width: 18px;
    height: 18px;
}

.toggle-pwd {
    position: absolute;
    right: 15px;
    cursor: pointer;
    color: #b0b5c0;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.toggle-pwd svg {
    width: 18px;
    height: 18px;
}

.toggle-pwd:hover {
    color: #4e7ef2;
}

.forgot-link {
    position: absolute;
    right: 15px;
    font-size: 13px;
    color: #888;
}

.input-group:has(.forgot-link) .toggle-pwd {
    right: 90px;
}

.get-code-btn {
    position: absolute;
    right: 15px;
    font-size: 14px;
    color: #4e7ef2;
    cursor: pointer;
}

.helper-text {
    font-size: 12px;
    color: #999;
    margin-top: -15px;
    margin-bottom: 20px;
    padding-left: 15px;
    width: 100%;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

/* 错误提示 */
.input-group.error input {
    border-color: #f56c6c;
}

.input-group.error .icon svg {
    stroke: #f56c6c;
}

.error-msg {
    position: absolute;
    bottom: -20px;
    left: 15px;
    font-size: 12px;
    color: #f56c6c;
    display: none;
}

.input-group.error .error-msg {
    display: block;
}

/* =========================================
   按钮与选项行
   ========================================= */
.btn-primary {
    width: 100%;
    height: 48px;
    background-color: #6a8bf6;
    color: white;
    border: none;
    border-radius: 24px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 10px;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: #5a7df0;
}

.options-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    font-size: 13px;
    color: #666;
    width: 100%;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
}

.checkbox-label input {
    margin-right: 5px;
}

.info-icon {
    margin-left: 4px;
    color: #b0b5c0;
    font-size: 14px;
    position: relative;
    cursor: help;
}

.tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #4a4a4a;
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.5;
    white-space: nowrap;
    z-index: 100;
    transition: opacity 0.2s;
}

.tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #4a4a4a transparent transparent transparent;
}

.info-icon:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

.links a {
    color: #4e7ef2;
}

.links .divider {
    color: #dcdfe6;
    margin: 0 8px;
}

.other-methods {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px dashed #eee;
    width: 100%;
}

.other-methods a {
    font-size: 13px;
    color: #888;
}

/* =========================================
   底部协议与版权
   ========================================= */
.agreement {
    text-align: center;
    padding-top: 20px;
    font-size: 12px;
    color: #999;
    width: 100%;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

.agreement.mt-auto {
    margin-top: auto;
}

.agreement a {
    color: #4e7ef2;
}

.qr-container {
    background-color: #fff;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #eee;
}

.qr-placeholder {
    width: 160px;
    height: 160px;
    background-color: #f0f2f5;
    border: 2px dashed #dcdfe6;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #999;
    font-size: 14px;
    border-radius: 4px;
}

.qr-text {
    margin-top: 20px;
    font-size: 14px;
    color: #666;
}

.footer {
    text-align: center;
    font-size: 12px;
    color: #999;
    width: 100%;
    line-height: 1.8; /* 稍微调小一点行高 */
    margin-top: 15px; /* 将原 50px 改为 15px，让底部更紧凑 */
    padding: 10px 0;  /* 减小内边距 */
}

.police-icon {
    margin-right: 4px;
    color: #d4a248;
}

.ICP {
    color: #3698d9;
    font-size: 15px;
    margin-right: 25px;
}

.public {
    color: #3698d9;
    font-size: 15px;
    margin-left: 10px;
}

.open-modal-btn {
    color: rgb(0, 119, 255);
    font-size: 15px;
    margin-left: 10px;
    margin-right: 10px;
    border: none;
    background: transparent;
    cursor: pointer;
}

/* =========================================
   模态弹窗 (Modal)
   ========================================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-box {
    background: #fff;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-box {
    transform: translateY(0);
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 18px;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.close-btn:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex-grow: 1;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    text-align: right;
}

.action-btn {
    padding: 8px 16px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.action-btn:hover {
    background-color: #218838;
}

body.no-scroll {
    overflow: hidden;
}