/* ========== Auth Modal (注册/登录弹窗) - 公共样式 ========== */
/* 各页面通过 <link rel="stylesheet" href="utils/auth.css"> 引入 */

/* 验证码输入框组 */
.verification-group {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.verification-group .auth-input {
    flex: 1;
}
.btn-send-code {
    flex-shrink: 0;
    padding: 0 16px;
    height: 44px;
    border-radius: 8px;
    border: 1px solid #1E6BDB;
    background: #1E6BDB;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}
.btn-send-code:hover:not(:disabled) {
    background: #1558B8;
    border-color: #1558B8;
}
.btn-send-code:disabled {
    background: #ccc;
    border-color: #ccc;
    color: #fff;
    cursor: not-allowed;
}

/* 登录拦截遮罩（整页拦截用） */
.auth-page-mask {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(6px);
    z-index: 400;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 20px;
}
.auth-page-mask.show { display: flex; }
.auth-page-mask .mask-icon {
    font-size: 64px;
    opacity: 0.6;
}
.auth-page-mask .mask-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}
.auth-page-mask .mask-desc {
    font-size: 15px;
    color: var(--text-light);
    margin-bottom: 10px;
}
.auth-page-mask .mask-btn {
    padding: 12px 36px;
    border-radius: 8px;
    border: none;
    background: var(--primary);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.auth-page-mask .mask-btn:hover { background: var(--primary-dark); }

/* Auth Modal 弹窗 */
.auth-modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 500;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.auth-modal-overlay.show { display: flex; }
.auth-modal {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: authModalSlideIn 0.3s ease;
}
@keyframes authModalSlideIn {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.auth-modal-header {
    background: linear-gradient(135deg, #1E6BDB 0%, #4A90E2 100%);
    padding: 18px 24px 16px;
    text-align: center;
    color: #fff;
    position: relative;
    flex-shrink: 0;
}
.auth-modal-logo {
    width: 48px;
    height: 48px;
    margin: 0 auto 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
}
.auth-modal-title {
    font-size: 18px;
    font-weight: 700;
}
.auth-modal-subtitle {
    font-size: 12px;
    opacity: 0.85;
    margin-top: 4px;
}
.auth-modal-close {
    position: absolute;
    top: 16px; right: 16px;
    width: 32px; height: 32px;
    border: none;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.auth-modal-close:hover { background: rgba(255,255,255,0.35); }
.auth-modal-body {
    padding: 28px 32px 32px;
    overflow-y: auto;
    flex: 1;
}
.auth-tabs {
    display: flex;
    margin-bottom: 24px;
    border-bottom: 2px solid #f0f0f0;
}
.auth-tab {
    flex: 1;
    padding: 10px 0;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: #999;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}
.auth-tab:hover { color: #333; }
.auth-tab.active {
    color: #1E6BDB;
    border-bottom-color: #1E6BDB;
}
.auth-form-group {
    margin-bottom: 18px;
}
.auth-form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    margin-bottom: 6px;
}
.auth-form-row {
    display: flex;
    gap: 10px;
}
.auth-input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1px solid #E8E8E8;
    border-radius: 8px;
    font-size: 15px;
    color: #333;
    transition: all 0.2s;
    outline: none;
}
.auth-input::placeholder { color: #bbb; }
.auth-input:hover { border-color: #1E6BDB; }
.auth-input:focus { border-color: #1E6BDB; box-shadow: 0 0 0 3px #E8F2FF; }
.auth-select {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1px solid #E8E8E8;
    border-radius: 8px;
    font-size: 15px;
    color: #333;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M2.5 4.5L6 8l3.5-3.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}
.auth-select:hover { border-color: #1E6BDB; }
.auth-select:focus { border-color: #1E6BDB; box-shadow: 0 0 0 3px #E8F2FF; }
.auth-select:disabled { background: #f8f8f8; color: #bbb; cursor: not-allowed; }
.auth-code-btn {
    flex-shrink: 0;
    padding: 0 16px;
    height: 44px;
    border-radius: 8px;
    border: 1px solid #1E6BDB;
    background: #fff;
    color: #1E6BDB;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}
.auth-code-btn:hover { background: #E8F2FF; }
.auth-code-btn:disabled { background: #f5f5f5; border-color: #ddd; color: #bbb; cursor: not-allowed; }
.auth-submit-btn {
    width: 100%;
    height: 46px;
    border-radius: 8px;
    border: none;
    background: #1E6BDB;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 6px;
}
.auth-submit-btn:hover { background: #1558B8; }
.auth-submit-btn:disabled { background: #ccc; cursor: not-allowed; }
.auth-error {
    color: #F5222D;
    font-size: 13px;
    margin-bottom: 14px;
    padding: 8px 12px;
    background: #FFF0F0;
    border-radius: 6px;
    display: none;
}
.auth-error.show {
    display: block;
    color: #00B48A;
    background: #E8FBF5;
}
.auth-error.show.error {
    color: #F5222D;
    background: #FFF0F0;
}
.auth-hint {
    font-size: 12px;
    color: #999;
    margin-top: 8px;
    text-align: center;
}
.auth-form-panel { display: none; }
.auth-form-panel.active { display: block; }

/* 头像选择网格 */
.avatar-select-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    margin-bottom: 8px;
}
.avatar-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 18px;
}
.avatar-option {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    position: relative;
}
.avatar-option:hover {
    border-color: #E8F2FF;
    transform: scale(1.05);
}
.avatar-option.selected {
    border-color: #1E6BDB;
    box-shadow: 0 0 0 3px #E8F2FF;
}
.avatar-option.selected::after {
    content: '✓';
    position: absolute;
    bottom: 2px;
    right: 4px;
    font-size: 14px;
    color: #fff;
    background: #1E6BDB;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.avatar-option img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* header-right 登录态样式 */
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.header-right .btn {
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}
.header-right .btn-primary { background: #1E6BDB; color: #fff; }
.header-right .btn-primary:hover { background: #1558B8; }
.header-right .btn-outline { background: transparent; color: #1E6BDB; border: 1px solid #1E6BDB; }
.header-right .btn-outline:hover { background: #E8F2FF; }

/* 移动端适配 */
@media (max-width: 768px) {
    .auth-modal { max-width: 100%; border-radius: 12px 12px 0 0; margin-top: auto; }
    .auth-modal-overlay { align-items: flex-end; padding: 0; }
    .auth-modal-header { padding: 20px 24px 18px; border-radius: 12px 12px 0 0; }
    .auth-modal-body { padding: 20px 24px 28px; }
    .header-right { display: none; }
}
@media (max-width: 480px) {
    .avatar-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; }
}
