html {
    font-size: 16px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}


body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: radial-gradient(circle at top right, #eff6ff 0%, #f8fafc 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 1rem 4rem;
}

.login-container {
    width: 100%;
    max-width: 460px;
}

@media (min-width: 768px) {
    .login-container {
        max-width: 500px;
    }
}

/* ========== 顶部区域 ========== */
.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header .logo-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background-color: #fff;
    border-radius: 1rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    margin-bottom: 0.75rem;
}

.login-header .logo-box img {
    border-radius: 1rem;
}

@media (min-width: 768px) {
    .login-header .logo-box {
        width: 72px;
        height: 72px;
        margin-bottom: 1rem;
    }
}

/* Tailwind: text-xl md:text-2xl */
.login-header h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -0.025em;
}

@media (min-width: 768px) {
    .login-header h1 {
        font-size: 1.5rem;
    }
}

/* Tailwind: text-sm md:text-base */
.login-header .subtitle {
    color: #64748b;
    margin-top: 0.25rem;
    font-weight: 500;
    font-size: 0.875rem;
}

@media (min-width: 768px) {
    .login-header .subtitle {
        font-size: 1rem;
    }
}

/* ========== 卡片 ========== */
.login-card {
    background-color: #fff;
    border-radius: 1.5rem;
    box-shadow: 0 20px 25px -5px rgba(148, 163, 184, 0.2), 0 10px 10px -5px rgba(148, 163, 184, 0.1);
    border: 1px solid #f1f5f9;
    padding: 1.5rem;
}

@media (min-width: 768px) {
    .login-card {
        padding: 2.5rem;
    }
}

/* ========== 选项卡 ========== */
.tab-bar {
    display: flex;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .tab-bar {
        margin-bottom: 2rem;
    }
}

/* Tailwind: text-sm md:text-base */
.tab-btn {
    flex: 1;
    padding-bottom: 0.75rem;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 600;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #94a3b8;
    border-bottom: 2px solid transparent;
}

@media (min-width: 768px) {
    .tab-btn {
        font-size: 1rem;
    }
}

.tab-btn.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

.tab-content {
    display: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.tab-content.active {
    display: block;
}

/* ========== 二维码区域 ========== */
.qr-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 0;
}

@media (min-width: 768px) {
    .qr-section {
        padding: 1.5rem 0;
    }
}

/* ========== 二维码 ========== */
.qr-code-wrapper {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 1rem;
    overflow: hidden;
}

.qr-code-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.qr-expired-mask {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-expired-inner {
    text-align: center;
    color: #94a3b8;
}

.qr-expired-inner i {
    display: block;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #94a3b8;
}

.qr-expired-inner span {
    display: block;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.qr-refresh-btn {
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 0.4rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: background 0.2s;
}

.qr-refresh-btn:hover {
    background: #1d4ed8;
}

/* 扫码成功遮罩 */
.qr-scanned-mask {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.qr-scanned-inner {
    text-align: center;
}

.qr-scanned-inner i {
    display: block;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: #16a34a;
}

.qr-scanned-inner span {
    display: block;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #16a34a;
}

.qr-scanned-sub {
    display: block;
    font-size: 0.75rem !important;
    font-weight: 400 !important;
    color: #94a3b8 !important;
    margin-top: 0.25rem;
}

.qr-countdown {
    text-align: center;
    color: #94a3b8;
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
}

.qr-mobile-btn {
    margin-top: 1rem;
    text-align: center;
}

.wechat-login-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #07C160;
    color: #fff;
    padding: 0.6rem 1.5rem;
    border-radius: 0.75rem;
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
}

.wechat-login-btn:hover {
    background: #06AD56;
    color: #fff;
    text-decoration: none;
}

/* Tailwind: text-sm md:text-base */
.qr-section .qr-tip {
    color: #475569;
    font-size: 0.875rem;
    font-weight: 500;
}

@media (min-width: 768px) {
    .qr-section .qr-tip {
        font-size: 1rem;
    }
}

/* Tailwind: text-xs */
.qr-section .qr-subtip {
    color: #94a3b8;
    font-size: 0.75rem;
    margin-top: 0.5rem;
}

/* ========== 表单 ========== */
.form-group-custom {
    margin-bottom: 0.375rem;
}

/* Tailwind: text-sm */
.form-group-custom label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
    margin-left: 0.25rem;
    margin-bottom: 0.375rem;
    display: block;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 0.625rem 1rem;
    background-color: rgba(248, 250, 252, 0.5);
    transition: border-color 0.15s, box-shadow 0.15s;
}

@media (min-width: 768px) {
    .input-wrapper {
        padding: 0.75rem 1rem;
    }
}

.input-wrapper:focus-within {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Tailwind: text-lg md:text-xl */
.input-wrapper i {
    color: #94a3b8;
    font-size: 1.125rem;
    margin-right: 0.75rem;
}

@media (min-width: 768px) {
    .input-wrapper i {
        font-size: 1.25rem;
    }
}

/* Tailwind: text-sm md:text-base */
.input-wrapper input {
    width: 100%;
    background: transparent;
    outline: none;
    border: none;
    color: #334155;
    font-size: 0.875rem;
    font-family: inherit;
}

@media (min-width: 768px) {
    .input-wrapper input {
        font-size: 1rem;
    }
}

.input-wrapper input::placeholder {
    color: #94a3b8;
}

/* ========== 登录按钮 ========== */
/* Tailwind: text-sm md:text-base */
.btn-login {
    width: 100%;
    background-color: #2563eb;
    color: #fff;
    font-weight: 700;
    border: none;
    padding: 0.75rem 0;
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.2);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: background-color 0.15s, transform 0.1s;
    margin-top: 0.5rem;
    font-family: inherit;
}

@media (min-width: 768px) {
    .btn-login {
        padding: 0.875rem 0;
        font-size: 1rem;
        margin-top: 1rem;
    }
}

.btn-login:hover {
    background-color: #1d4ed8;
}

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

.btn-login:disabled {
    opacity: 0.8;
    cursor: not-allowed;
    transform: none;
}

/* ========== 底部链接 ========== */
/* Tailwind: text-sm */
.login-footer-links {
    margin-top: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.875rem;
}

@media (min-width: 768px) {
    .login-footer-links {
        margin-top: 1.5rem;
    }
}

.login-footer-links .keep-label {
    display: flex;
    align-items: center;
    color: #64748b;
    cursor: pointer;
    font-weight: 400;
}

.login-footer-links .keep-label input[type="checkbox"] {
    margin-right: 0.5rem;
    accent-color: #2563eb;
}

.login-footer-links .forgot-link {
    color: #2563eb;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.15s;
}

.login-footer-links .forgot-link:hover {
    color: #1d4ed8;
}

/* ========== 提示消息 ========== */
.alert-msg {
    display: none;
    padding: 0.625rem 1rem;
    border-radius: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    text-align: center;
}

.alert-msg.alert-danger {
    display: block;
    background-color: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.alert-msg.alert-success {
    display: block;
    background-color: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

/* ========== 账号绑定页 ========== */
.bind-title {
    text-align: center;
    font-size: 1.125rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 0.75rem;
}

.bind-userinfo {
    text-align: center;
    margin-bottom: 1rem;
}

.bind-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e2e8f0;
}

.bind-nickname {
    font-size: 0.875rem;
    color: #475569;
    margin-top: 0.5rem;
}

.bind-desc {
    text-align: center;
    color: #64748b;
    font-size: 0.8125rem;
    margin-bottom: 1.25rem;
}

/* ========== 版本信息 ========== */
.login-version {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    text-align: center;
    padding: 0.75rem 1rem;
    z-index: 0;
}

.login-version .copyright {
    color: #cbd5e1;
    font-size: 0.825rem;
    margin-top: 0.25rem;
}

.login-version .copyright a {
    color: #cbd5e1;
}

/* ========== 加载动画 ========== */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.fa-spin-animate {
    animation: spin 1s linear infinite;
}

/* ========== 机构选择弹窗 ========== */
.modal-overlay {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-dialog-custom {
    background-color: #fff;
    border-radius: 1rem;
    width: 90%;
    max-width: 440px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.modal-header-custom {
    padding: 1.75rem;
    text-align: center;
    flex-shrink: 0;
}

.modal-header-custom h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.modal-body-custom {
    padding: 0 1.25rem 1.25rem;
    overflow-y: auto;
}

/* 机构卡片列表 */
.org-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.org-card {
    display: flex;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.15s;
    background: #fff;
}

.org-card:hover {
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

.org-card-img {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    overflow: hidden;
}

.org-card-img img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 0.25rem;
}

.org-card-body {
    flex: 1;
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.org-card-body h5 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 0.25rem 0;
}

.org-card-city {
    font-size: 0.8125rem;
    color: #94a3b8;
    margin: 0 0 0.5rem 0;
}

.org-card-roles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.role-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #2563eb;
    background: #eff6ff;
    border-radius: 0.25rem;
}

/* =================== 忘记密码弹窗 =================== */
.modal-dialog-wide {
    max-width: 460px;
}

.modal-close {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    font-family: inherit;
}

.modal-close:hover {
    color: #475569;
}

.modal-header-custom {
    position: relative;
}

.pwd-tab-content {
    display: none;
}

.pwd-tab-content.active {
    display: block;
}

/* 发送验证码按钮 */
.input-with-btn {
    display: flex !important;
    align-items: center;
    gap: 0;
    padding: 0 !important;
}

.input-with-btn > i {
    margin-left: 0.75rem;
    flex-shrink: 0;
}

.flex-1-input {
    flex: 1;
    border: none !important;
    outline: none;
    padding: 0.625rem 0.75rem;
    background: transparent;
    font-family: inherit;
    font-size: 1rem;
}

.btn-send-code {
    flex-shrink: 0;
    padding: 0.5rem 0.875rem;
    margin: 0.25rem;
    background: #eff6ff;
    color: #2563eb;
    border: none;
    border-radius: 0.625rem;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
    font-family: inherit;
}

.btn-send-code:hover {
    background: #dbeafe;
}

.btn-send-code:disabled {
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
}

/* ========== 扫码成功页 ========== */
.qrs-container {
    width: 100%;
    max-width: 420px;
    text-align: center;
    padding: 0 .5rem;
}

.qrs-header {
    margin-bottom: 2rem;
}

.qrs-header .logo-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background-color: #fff;
    border-radius: 1rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    margin-bottom: .75rem;
}

.qrs-header .logo-box img {
    border-radius: 1rem;
}

.qrs-header h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -.025em;
}

.qrs-card {
    background: #fff;
    border-radius: 1.25rem;
    box-shadow: 0 20px 25px -5px rgba(148,163,184,.2), 0 10px 10px -5px rgba(148,163,184,.1);
    border: 1px solid #f1f5f9;
    padding: 2rem;
}

.qrs-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: #f0fdf4;
    border-radius: 50%;
    margin-bottom: 1rem;
}

.qrs-icon i {
    font-size: 2.25rem;
    color: #16a34a;
}

.qrs-card h2 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 .375rem;
}

.qrs-card .qrs-desc {
    color: #64748b;
    font-size: .8125rem;
    margin: 0 0 1.25rem;
    line-height: 1.6;
}

.qrs-card .qrs-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    color: #2563eb;
    font-size: .8125rem;
    font-weight: 500;
}

.qrs-card .qrs-loader i {
    font-size: .9375rem;
}

.qrs-footer {
    color: #94a3b8;
    font-size: .6875rem;
    margin-top: 1.5rem;
}

@media (min-width: 480px) {
    .qrs-card {
        border-radius: 1.5rem;
        padding: 2.5rem;
    }

    .qrs-icon {
        width: 72px;
        height: 72px;
        margin-bottom: 1.25rem;
    }

    .qrs-icon i {
        font-size: 2.5rem;
    }

    .qrs-card h2 {
        font-size: 1.25rem;
        margin-bottom: .5rem;
    }

    .qrs-card .qrs-desc {
        font-size: .875rem;
        margin-bottom: 1.5rem;
    }

    .qrs-card .qrs-loader {
        font-size: .875rem;
    }

    .qrs-card .qrs-loader i {
        font-size: 1rem;
    }

    .qrs-footer {
        font-size: .75rem;
        margin-top: 2rem;
    }
}

/* ========== 投资人/机构选择弹窗 ========== */
.investor-choice-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.investor-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 2px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1.5rem 1rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    background: #fff;
}

.investor-card:hover {
    border-color: #2563eb;
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.12);
    transform: translateY(-2px);
}

.investor-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    margin-bottom: 0.75rem;
}

.investor-card[data-choice="investor"] .investor-card-icon {
    background: #eff6ff;
    color: #2563eb;
}

.investor-card[data-choice="organization"] .investor-card-icon {
    background: #f0fdf4;
    color: #16a34a;
}

.investor-card-icon i {
    font-size: 1.5rem;
}

.investor-card h5 {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 0.25rem;
}

.investor-card p {
    font-size: 0.8125rem;
    color: #94a3b8;
    margin: 0;
}

.investor-card-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

@media (min-width: 480px) {
    .investor-choice-cards {
        flex-direction: row;
        gap: 1rem;
        padding: 1rem;
    }

    .investor-card {
        flex: 1;
        padding: 2rem 1rem;
    }
}
