/* ============================================
   小悟学伴 - 个人信息页样式
   ============================================ */

.profile-page {
    min-height: calc(100vh - 60px);
    background: #f8fafc;
    padding: 40px 24px;
}

.profile-container {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 28px;
    align-items: start;
}

/* === 侧边栏 === */
.profile-sidebar {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    position: sticky;
    top: 84px;
}

.profile-avatar-section {
    padding: 28px 20px 20px;
    text-align: center;
    background: linear-gradient(135deg, #f0f9ff, #ecfeff);
    border-bottom: 1px solid #e2e8f0;
}

.profile-avatar {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #0ea5e9, #06b6d4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 12px;
    color: #fff;
}

.profile-avatar-section h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #0c4a6e;
    margin-bottom: 4px;
}

.profile-avatar-section p {
    font-size: 0.85rem;
    color: #64748b;
}

.profile-menu {
    padding: 12px;
}

.profile-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    text-decoration: none;
    color: #475569;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 10px;
    transition: all 0.2s;
    border: none;
    background: none;
    cursor: pointer;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.profile-menu-item:hover {
    background: #f1f5f9;
    color: #0ea5e9;
}

.profile-menu-item.active {
    background: #f0f9ff;
    color: #0ea5e9;
    font-weight: 600;
}

/* === 主内容 === */
.profile-main {
    min-height: 400px;
}

.profile-section {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    padding: 32px;
}

.profile-section .section-header {
    margin-bottom: 28px;
    text-align: left;
}

.profile-section .section-header h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 6px;
}

.profile-section .section-header p {
    font-size: 0.9rem;
    color: #94a3b8;
}

/* 表单 */
.profile-form {
    max-width: 560px;
}

.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 0.8rem;
    color: #94a3b8;
}

.required {
    color: #ef4444;
}

.gender-options {
    display: flex;
    gap: 16px;
}

.gender-option {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.95rem;
    color: #475569;
    cursor: pointer;
    padding: 8px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    outline: none;
    background: #fff;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.gender-option:hover {
    border-color: #0ea5e9;
}

.gender-option:has(input:checked) {
    border-color: #0ea5e9;
    background: #f0f9ff;
    color: #0ea5e9;
}

.gender-option input {
    appearance: none;
    width: 14px;
    height: 14px;
    margin: 0;
    flex-shrink: 0;
    border: 1.5px solid #94a3b8;
    border-radius: 50%;
    cursor: pointer;
    transition: none;
}
.gender-option input:checked {
    border-color: #0ea5e9;
    background: #0ea5e9;
    box-shadow: inset 0 0 0 3px #fff;
}
.gender-option input:focus-visible {
    outline: 2px solid #0ea5e9;
    outline-offset: 2px;
}

/* === 勋章列表 === */
.badges-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.badge-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 20px;
    text-align: center;
    transition: all 0.2s;
}

.badge-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
    transform: translateY(-2px);
}

.badge-card.earned {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border-color: #fcd34d;
}

.badge-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.badge-card h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

.badge-card p {
    font-size: 0.8rem;
    color: #94a3b8;
}

.badge-type-tag {
    display: inline-block;
    margin-top: 8px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-type-virtual { background: #e0f2fe; color: #0369a1; }
.badge-type-physical { background: #fef3c7; color: #92400e; }

.badge-group-section {
    margin-bottom: 24px;
}

.badge-group-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f1f5f9;
}

.badge-count {
    margin-top: 8px;
}

.badge-count-num {
    display: inline-block;
    padding: 2px 12px;
    border-radius: 12px;
    background: #fef3c7;
    color: #92400e;
    font-size: 0.85rem;
    font-weight: 700;
}

.badge-count-zero {
    font-size: 0.75rem;
    color: #cbd5e1;
}

/* === 作品列表 === */
.submissions-list {
    display: grid;
    gap: 16px;
}

.submission-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    transition: all 0.2s;
}

.submission-item:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.submission-thumb {
    width: 80px;
    height: 60px;
    border-radius: 8px;
    background: linear-gradient(135deg, #e0f2fe, #cffafe);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    overflow: hidden;
}

.submission-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.submission-info {
    flex: 1;
    min-width: 0;
}

.submission-item {
    position: relative;
}
.submission-share-btn {
    position: absolute;
    bottom: 12px;
    right: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #f1f5f9;
    cursor: pointer;
    color: #94a3b8;
    transition: all 0.15s;
}
.submission-share-btn:hover {
    color: #3b82f6;
    background: #eff6ff;
}

.submission-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}

.submission-meta {
    font-size: 0.8rem;
    color: #94a3b8;
}

.submission-scores {
    text-align: right;
    flex-shrink: 0;
}

.submission-scores .score {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0ea5e9;
}

.submission-scores .score-label {
    font-size: 0.75rem;
    color: #94a3b8;
}

/* 响应式 */
@media (max-width: 768px) {
    .profile-container {
        grid-template-columns: 1fr;
    }
    .profile-sidebar { position: static; }
    .profile-menu { display: flex; overflow-x: auto; }
    .profile-menu-item { white-space: nowrap; flex-shrink: 0; }
    .badges-grid { grid-template-columns: 1fr 1fr; }
    .submission-item { flex-direction: column; align-items: flex-start; }
    .submission-scores { text-align: left; align-self: flex-end; }
}
