@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css');
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}
html, body {
    height: 100%;
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #ffffff;
    color: #0a0a0a;
    overflow: hidden;
}
.header-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 0 20px;
}
.header-bar .back-btn {
    position: absolute;
    left: 16px;
    color: #666666;
    text-decoration: none;
    font-size: 18px;
    transition: color 0.2s;
}
.header-bar .back-btn:hover {
    color: #0a0a0a;
}
.header-bar .title {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 0.5px;
}
.main-container {
    height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 56px 24px 24px;
    position: relative;
}
.bg-grid {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(0,0,0,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
}
.logo-section {
    text-align: center;
    margin-bottom: 32px;
    position: relative;
    z-index: 1;
}
.logo-section img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 16px;
    filter: brightness(1);
}
.logo-section h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
}
.logo-section p {
    font-size: 13px;
    color: #888888;
}
.tab-switch {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
    background: #f5f5f5;
    border-radius: 10px;
    padding: 4px;
    width: 100%;
    max-width: 360px;
}
.tab-switch button {
    flex: 1;
    padding: 10px 0;
    background: transparent;
    border: none;
    color: #888888;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
}
.tab-switch button.active {
    background: #0a0a0a;
    color: #ffffff;
}
.form-container {
    width: 100%;
    max-width: 360px;
    position: relative;
    z-index: 1;
}
.form-group {
    margin-bottom: 14px;
}
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #f8f8f8;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    transition: all 0.3s ease;
    min-width: 0;
}
.input-wrapper:focus-within {
    border-color: #0a0a0a;
    background: #f5f5f5;
}
.input-wrapper i {
    color: #888888;
    font-size: 16px;
    margin-left: 14px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}
.input-wrapper input {
    flex: 1;
    padding: 12px 12px;
    background: transparent;
    border: none;
    color: #0a0a0a;
    font-size: 15px;
    outline: none;
    min-width: 0;
}
.input-wrapper input::placeholder {
    color: #999999;
}
/* 验证码行 */
.captcha-row {
    display: flex;
    gap: 10px;
    width: 100%;
    min-width: 0;
    align-items: stretch;
}
.captcha-row .captcha-input {
    flex: 1;
    min-width: 0;
}
.captcha-row .captcha-input input {
    width: 100%;
    letter-spacing: 2px;
    font-weight: 600;
    text-transform: uppercase;
}
.captcha-img-wrap {
    position: relative;
    width: 120px;
    min-height: 46px;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
    border: 1px solid #e5e5e5;
    background: #f8f8f8;
    transition: border-color 0.2s, opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.captcha-img-wrap:hover {
    border-color: #0a0a0a;
}
.captcha-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 10px;
    transition: opacity 0.2s;
    min-height: 46px;
}
.captcha-img-wrap.loading img {
    opacity: 0.2;
}
.captcha-refresh-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.05);
    opacity: 0;
    transition: opacity 0.2s;
    border-radius: 10px;
    pointer-events: none;
}
.captcha-img-wrap:hover .captcha-refresh-overlay {
    opacity: 1;
}
.captcha-refresh-overlay i {
    color: #666;
    font-size: 14px;
}
.captcha-img-wrap.loading .captcha-refresh-overlay {
    opacity: 1;
    background: rgba(0,0,0,0.1);
}
.captcha-img-wrap.loading .captcha-refresh-overlay i {
    animation: spin 0.6s linear infinite;
}
.code-row {
    display: flex;
    gap: 10px;
    width: 100%;
    min-width: 0;
    align-items: stretch;
}
.code-row .input-wrapper {
    flex: 1;
    min-width: 0;
}
.code-row .input-wrapper input {
    min-width: 0;
    width: 100%;
}
.code-btn {
    padding: 0 14px;
    background: #0a0a0a;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    flex-shrink: 0;
    width: 120px; /* 与图片验证码宽度一致 */
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.code-btn:hover {
    background: #222222;
}
.code-btn:disabled {
    background: #e5e5e5;
    color: #999999;
    cursor: not-allowed;
}
.submit-btn {
    width: 100%;
    padding: 14px;
    background: #0a0a0a;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 8px;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.submit-btn:hover {
    background: #222222;
}
.submit-btn:disabled {
    background: #e5e5e5;
    color: #999;
    cursor: not-allowed;
}
.footer-hint {
    position: absolute;
    bottom: 24px;
    left: 0;
    right: 0;
    text-align: center;
    color: #999999;
    font-size: 12px;
    z-index: 1;
}
.toast {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: #0a0a0a;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 2000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    max-width: 90vw;
    text-align: center;
    word-break: break-word;
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
@media (max-width: 480px) {
    .logo-section img {
        width: 64px;
        height: 64px;
    }
    .logo-section h1 {
        font-size: 20px;
    }
    .code-btn {
        padding: 0 10px;
        font-size: 11px;
        width: 100px; /* 响应式与图片验证码一致 */
    }
    .code-row .input-wrapper input {
        padding: 12px 8px;
        font-size: 14px;
    }
    .captcha-img-wrap {
        width: 100px;
        min-height: 42px;
    }
    .captcha-img-wrap img {
        min-height: 42px;
    }
    .captcha-row .captcha-input input {
        font-size: 14px;
    }
}
@media (max-width: 360px) {
    .code-btn {
        padding: 0 8px;
        font-size: 10px;
        width: 90px; /* 响应式与图片验证码一致 */
        height: 42px;
    }
    .code-row {
        gap: 6px;
    }
    .captcha-img-wrap {
        width: 90px;
    }
    .captcha-row {
        gap: 6px;
    }
}
