/* index.php 专属样式 */

/* ============ 全局兜底（防 common.css 未加载或被改坏） ============ */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f0f2f5;
    padding: 20px;
}

.card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    padding: 36px 30px 30px;
    box-sizing: border-box;
}

.header {
    text-align: center;
    margin-bottom: 30px;
}

.avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e8e8e8;
    background: #fafafa;
    margin-bottom: 12px;
}

.title {
    font-size: 22px;
    font-weight: 600;
    color: #1a1a1a;
}

.subtitle {
    font-size: 14px;
    color: #999;
    margin-top: 4px;
}

.tabs {
    display: flex;
    border-bottom: 1px solid #eee;
    margin-bottom: 24px;
}

.tab {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    font-size: 16px;
    font-weight: 500;
    color: #888;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.tab.active {
    color: #333;
    border-bottom-color: #333;
}

/* ============ 表单 ============ */
.form-group input {
    padding: 11px 14px;
    font-size: 15px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
    font-weight: 500;
}

/* ============ 验证码行 ============ */
.captcha-row {
    display: flex;
    gap: 10px;
    align-items: center;
    width: 100%;
    max-width: 100%;
}

.captcha-row input {
    flex: 1 1 0%;
    min-width: 0;
    width: auto;
    max-width: 100%;
}

.captcha-img {
    height: 42px;
    width: 120px;
    max-width: 40%;
    border-radius: 8px;
    border: 1px solid #ddd;
    cursor: pointer;
    object-fit: cover;
    flex-shrink: 0;
    box-sizing: border-box;
}

/* ============ 按钮 ============ */
.btn {
    width: 100%;
    padding: 12px 0;
    font-size: 16px;
    font-weight: 500;
    color: #fff;
    background: #333;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 6px;
    box-sizing: border-box;
}

.btn:hover {
    background: #1a1a1a;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.message {
    font-size: 13px;
    margin-top: 12px;
    text-align: center;
    min-height: 20px;
    color: #d32f2f;
}

.message.success {
    color: #2e7d32;
}

/* ============ 已登录视图 ============ */
.logged-in {
    text-align: center;
    padding: 10px 0;
}

.logged-in .avatar {
    width: 80px;
    height: 80px;
    margin-bottom: 16px;
}

.logged-in h2 {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 6px;
}

.logged-in p {
    color: #888;
    font-size: 14px;
    margin-bottom: 20px;
}

.btn-outline {
    display: inline-block;
    padding: 10px 32px;
    font-size: 15px;
    color: #333;
    background: transparent;
    border: 1px solid #ccc;
    border-radius: 8px;
    text-decoration: none;
    box-sizing: border-box;
}

.hidden {
    display: none !important;
}

/* ============ 响应式：窄屏适配 ============ */
@media (max-width: 480px) {
    .card {
        padding: 28px 20px 22px;
    }
    .avatar {
        width: 64px;
        height: 64px;
    }
}

/* 超窄屏（<360px） */
@media (max-width: 360px) {
    .card {
        padding: 24px 16px 20px;
    }
    .captcha-img {
        width: 90px;
        height: 38px;
    }
    .form-group input {
        padding: 10px 12px;
        font-size: 14px;
    }
    .btn {
        font-size: 15px;
        padding: 11px 0;
    }
    .tab {
        font-size: 15px;
    }
}

/* 极窄屏（<320px，老安卓） */
@media (max-width: 320px) {
    .card {
        padding: 20px 12px 16px;
    }
    .captcha-img {
        width: 80px;
    }
    .title {
        font-size: 20px;
    }
}