/* =====================================================
   OAII 用户中心 - 前端样式
   assets/uc-front.css
===================================================== */

/* ---------- 全局 ---------- */
.bmuc-wrap * { box-sizing: border-box; }
.bmuc-wrap {
    font-family: "PingFang SC", "Microsoft YaHei", Helvetica, Arial, sans-serif;
    color: #2c2c2a;
    line-height: 1.5;
    max-width: 1100px;
    margin: 0 auto;
}

/* ---------- 登录提示 ---------- */
.bmuc-login-prompt {
    display: flex;
    justify-content: center;
    padding: 60px 20px;
}
.bmuc-login-card {
    text-align: center;
    background: #fff;
    border-radius: 16px;
    padding: 48px 40px;
    max-width: 400px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.bmuc-login-icon { font-size: 48px; margin-bottom: 16px; }
.bmuc-login-card h3 { margin: 0 0 8px; font-size: 20px; font-weight: 500; }
.bmuc-login-card p { margin: 0 0 24px; font-size: 14px; color: #888; }
.bmuc-login-card .bmuc-btn-primary { margin-right: 10px; }

/* ---------- 用户信息卡片 ---------- */
.bmuc-profile-card {
    display: flex;
    align-items: center;
    gap: 28px;
    background: #fff;
    border-radius: 16px;
    padding: 28px 32px;
    margin-bottom: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
    flex-wrap: wrap;
}

/* 头像 */
.bmuc-profile-avatar {
    position: relative;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}
.bmuc-profile-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #f0f0ee;
}
.bmuc-avatar-edit {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #185fa5;
    color: #fff;
    border: 2px solid #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}
.bmuc-avatar-edit:hover { background: #0c447c; }

/* 信息 */
.bmuc-profile-info { flex: 1; min-width: 220px; }
.bmuc-profile-name { margin: 0 0 4px; font-size: 22px; font-weight: 500; }
.bmuc-profile-email { margin: 0 0 2px; font-size: 14px; color: #666; }
.bmuc-profile-phone { margin: 0 0 8px; font-size: 14px; color: #666; }

/* 等级 */
.bmuc-profile-level { margin-top: 8px; }
.bmuc-level-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
}
.bmuc-level-badge .bmuc-level-icon { font-size: 14px; }
.bmuc-level-badge.level-1 { background: #FFF3E6; color: #F47920; }
.bmuc-level-badge.level-2 { background: #e3f2fd; color: #1565c0; }
.bmuc-level-badge.level-3 { background: #fff3e0; color: #e65100; }
.bmuc-level-badge.level-4 { background: #f3e5f5; color: #7b1fa2; }
.bmuc-level-badge.level-5 { background: #fff8e1; color: #f57f17; }
.bmuc-level-bar {
    width: 200px;
    height: 6px;
    background: #f0f0ee;
    border-radius: 3px;
    overflow: hidden;
    margin: 4px 0;
}
.bmuc-level-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #185fa5, #378add);
    border-radius: 3px;
    transition: width .4s ease;
}
.bmuc-level-points { font-size: 12px; color: #888; }

/* 统计 */
.bmuc-profile-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}
.bmuc-stat-mini { text-align: center; }
.bmuc-stat-mini .bmuc-stat-num {
    display: block;
    font-size: 24px;
    font-weight: 500;
    color: #185fa5;
}
.bmuc-stat-mini .bmuc-stat-label {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

/* ---------- Tabs ---------- */
.bmuc-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    border-bottom: 2px solid #f0f0ee;
    padding-bottom: 0;
}
.bmuc-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border: none;
    background: none;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all .15s;
}
.bmuc-tab:hover { color: #185fa5; }
.bmuc-tab.active {
    color: #185fa5;
    border-bottom-color: #185fa5;
    font-weight: 500;
}
.bmuc-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #f0f0ee;
    color: #666;
    font-size: 11px;
    font-weight: 500;
}
.bmuc-tab.active .bmuc-tab-badge { background: #d0e4f7; color: #185fa5; }

/* ---------- Tab 内容 ---------- */
.bmuc-tab-content { display: none; }
.bmuc-tab-content.active { display: block; animation: bmuc-fade-in .3s ease; }
@keyframes bmuc-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------- 表单 ---------- */
.bmuc-form-section {
    background: #fff;
    border-radius: 12px;
    padding: 24px 28px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.bmuc-form-title {
    margin: 0 0 18px;
    font-size: 16px;
    font-weight: 500;
    color: #2c2c2a;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0ee;
}
.bmuc-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 24px;
}
@media (max-width: 600px) { .bmuc-form-grid { grid-template-columns: 1fr; } }
.bmuc-form-field { display: flex; flex-direction: column; gap: 5px; }
.bmuc-form-field label { font-size: 13px; font-weight: 500; color: #444; }
.bmuc-form-field input {
    padding: 9px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: #fafafa;
    transition: border-color .15s;
}
.bmuc-form-field input:focus {
    outline: none;
    border-color: #378add;
    background: #fff;
}
.bmuc-input-disabled { background: #f5f5f5 !important; color: #aaa; cursor: not-allowed; }
.bmuc-field-hint { font-size: 11px; color: #aaa; }
.bmuc-form-actions {
    margin-top: 18px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ---------- 按钮 ---------- */
.bmuc-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 22px;
    background: #185fa5;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s;
}
.bmuc-btn-primary:hover { background: #0c447c; }
.bmuc-btn-primary:disabled { background: #bbb; cursor: not-allowed; }

.bmuc-btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 22px;
    background: #c0392b;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s;
}
.bmuc-btn-danger:hover { background: #962d22; }

.bmuc-btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    background: #fff;
    color: #185fa5;
    border: 1px solid #185fa5;
    border-radius: 6px;
    font-size: 14px;
    text-decoration: none;
    transition: all .15s;
}
.bmuc-btn-ghost:hover { background: #f0f6fc; }

.bmuc-btn-sm-primary {
    display: inline-block;
    padding: 6px 16px;
    background: #185fa5;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 13px;
    text-decoration: none;
    transition: background .15s;
}
.bmuc-btn-sm-primary:hover { background: #0c447c; }

/* ---------- Toast 通知 ---------- */
.bmuc-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    animation: bmuc-toast-in .3s ease;
    max-width: 360px;
}
.bmuc-toast-success { background: #27500a; color: #fff; }
.bmuc-toast-error   { background: #c0392b; color: #fff; }
@keyframes bmuc-toast-in {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ---------- 列表 ---------- */
.bmuc-list { display: flex; flex-direction: column; gap: 12px; }
.bmuc-list-item {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #fff;
    border-radius: 10px;
    padding: 14px 18px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.04);
    transition: box-shadow .15s;
}
.bmuc-list-item:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.08); }

.bmuc-list-thumb {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f0f0ee;
    display: flex;
    align-items: center;
    justify-content: center;
}
.bmuc-list-thumb img { width: 100%; height: 100%; object-fit: cover; }
.bmuc-list-thumb-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: #d0e4f7; color: #185fa5; font-size: 20px; font-weight: 500;
}
.bmuc-list-thumb-file {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: #FFF3E6; color: #F47920; font-size: 11px; font-weight: 600;
    letter-spacing: 0.5px;
}

/* 活动日期缩略图 */
.bmuc-event-date { flex-direction: column; background: #fff3e0; }
.bmuc-date-day { font-size: 20px; font-weight: 600; color: #e65100; line-height: 1; }
.bmuc-date-month { font-size: 11px; color: #e65100; text-transform: uppercase; }

.bmuc-list-body { flex: 1; min-width: 0; }
.bmuc-list-type {
    display: inline-block;
    font-size: 11px;
    color: #888;
    background: #f7f7f5;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 4px;
}
.bmuc-list-title {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 500;
}
.bmuc-list-title a { color: #2c2c2a; text-decoration: none; }
.bmuc-list-title a:hover { color: #185fa5; }
.bmuc-list-meta { margin: 0; font-size: 12px; color: #999; }

.bmuc-list-actions { flex-shrink: 0; display: flex; gap: 8px; }
.bmuc-fav-remove {
    background: none;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 6px 8px;
    cursor: pointer;
    color: #999;
    transition: all .15s;
}
.bmuc-fav-remove:hover { border-color: #c0392b; color: #c0392b; background: #fcebeb; }

.bmuc-event-status {
    font-size: 13px;
    font-weight: 500;
    color: #27500a;
    background: #eaf3de;
    padding: 4px 12px;
    border-radius: 6px;
}
.bmuc-bm-status { font-size: 12px; padding: 3px 10px; border-radius: 4px; font-weight: 500; }
.bmuc-bm-status.published { color: #27500a; background: #eaf3de; }
.bmuc-bm-status.pending   { color: #e65100; background: #fff3e0; }

/* ---------- 空状态 ---------- */
.bmuc-empty-state {
    text-align: center;
    padding: 60px 20px;
}
.bmuc-empty-icon { font-size: 56px; margin-bottom: 16px; opacity: 0.6; }
.bmuc-empty-state h3 { margin: 0 0 8px; font-size: 18px; font-weight: 500; color: #666; }
.bmuc-empty-state p { margin: 0 0 20px; font-size: 14px; color: #aaa; }

/* =====================================================
   收藏按钮（文章/下载页面内联使用）
===================================================== */
.bmuc-fav-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    transition: all .15s;
}
.bmuc-fav-btn:hover { border-color: #c0392b; color: #c0392b; }
.bmuc-fav-btn.is-favorited {
    border-color: #c0392b;
    color: #c0392b;
    background: #fcebeb;
}
.bmuc-fav-btn.is-favorited .bmuc-fav-icon { fill: #c0392b; }
.bmuc-fav-icon { transition: fill .15s; }

/* =====================================================
   下载按钮
===================================================== */
.bmuc-dl-wrap { margin: 16px 0; }
.bmuc-dl-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: #005fcd;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s;
}
.bmuc-dl-btn:hover { background: #2a6fd6; }
.bmuc-dl-meta { font-size: 12px; opacity: 0.85; font-weight: 400; }
.bmuc-dl-notice { padding: 10px 16px; background: #fff3e0; color: #e65100; border-radius: 6px; font-size: 13px; }

/* =====================================================
   活动报名按钮
===================================================== */
.bmuc-event-register-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 28px;
    background: #185fa5;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s;
}
.bmuc-event-register-btn:hover { background: #0c447c; }
.bmuc-event-register-btn:disabled { cursor: default; }
.bmuc-event-register-btn.is-registered {
    background: #eaf3de;
    color: #27500a;
}
.bmuc-event-register-btn.is-registered:hover { background: #eaf3de; }

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
    .bmuc-profile-card { flex-direction: column; text-align: center; }
    .bmuc-profile-stats { justify-content: center; }
    .bmuc-level-bar { margin: 4px auto; }
    .bmuc-list-item { flex-wrap: wrap; }
    .bmuc-list-actions { width: 100%; justify-content: flex-end; }
}

/* =====================================================
   积分规则说明
===================================================== */
.bmuc-rules-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px 28px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid #f0f0ee;
}

.bmuc-rules-title {
    font-size: 16px;
    font-weight: 500;
    color: #2c2c2a;
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0ee;
}

.bmuc-rules-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 24px;
    margin-bottom: 16px;
}

@media (max-width: 600px) {
    .bmuc-rules-grid { grid-template-columns: 1fr; }
}

.bmuc-rule-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #fafafa;
    border-radius: 8px;
    transition: background 0.15s;
}

.bmuc-rule-item:hover { background: #f0f6fc; }

.bmuc-rule-icon {
    font-size: 18px;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.bmuc-rule-action {
    flex: 1;
    font-size: 14px;
    color: #444;
}

.bmuc-rule-points {
    font-size: 14px;
    font-weight: 600;
    color: #F47920;
    background: #FFF3E6;
    padding: 2px 10px;
    border-radius: 12px;
    white-space: nowrap;
}

.bmuc-rules-note {
    padding: 12px 16px;
    background: #fffde7;
    border-radius: 8px;
    border-left: 4px solid #fbc02d;
}

.bmuc-rules-note p {
    margin: 0;
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

/* =====================================================
   访问控制：密码保护 & 权限限制
===================================================== */

/* 密码保护表单 */
.bmuc-dl-password-form {
    padding: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.bmuc-dl-password-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bmuc-dl-password-input-wrap svg {
    flex-shrink: 0;
}

.bmuc-dl-password-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color .15s;
}

.bmuc-dl-password-input:focus {
    border-color: #005fcd;
}

.bmuc-dl-password-submit {
    flex-shrink: 0;
    padding: 8px 16px;
    background: #005fcd;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
    font-family: inherit;
}

.bmuc-dl-password-submit:hover {
    background: #0a2766;
}

.bmuc-dl-password-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.bmuc-dl-password-msg {
    margin-top: 8px;
    font-size: 13px;
    min-height: 18px;
}

/* 权限限制提示 */
.bmuc-dl-restricted .bmuc-dl-locked {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    color: #92400e;
    font-size: 14px;
}

.bmuc-dl-restricted .bmuc-dl-locked svg {
    flex-shrink: 0;
    color: #d97706;
}

.bmuc-dl-restricted .bmuc-dl-locked a {
    color: #005fcd;
    font-weight: 600;
    text-decoration: underline;
}

/* =====================================================
   热门下载排行
===================================================== */
.bmuc-popular-downloads {
    font-family: "PingFang SC", "Microsoft YaHei", Helvetica, Arial, sans-serif;
}

.bmuc-popular-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px;
    color: #1e293b;
}

.bmuc-popular-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bmuc-popular-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: box-shadow .15s, border-color .15s;
}

.bmuc-popular-item:hover {
    border-color: #005fcd;
    box-shadow: 0 2px 8px rgba(16, 58, 151, 0.1);
}

.bmuc-popular-rank {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.bmuc-popular-rank-top1 { background: #fbbf24; color: #fff; }
.bmuc-popular-rank-top2 { background: #94a3b8; color: #fff; }
.bmuc-popular-rank-top3 { background: #d97706; color: #fff; }

.bmuc-popular-info {
    flex: 1;
    min-width: 0;
}

.bmuc-popular-name {
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    text-decoration: none;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.4;
}

.bmuc-popular-name:hover {
    color: #005fcd;
}

.bmuc-popular-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    font-size: 12px;
    color: #94a3b8;
    flex-wrap: wrap;
}

.bmuc-popular-ver {
    color: #005fcd;
    font-weight: 500;
}

.bmuc-popular-proj {
    padding: 1px 6px;
    background: #f1f5f9;
    border-radius: 3px;
    font-size: 11px;
}

.bmuc-popular-count {
    display: flex;
    align-items: center;
    gap: 3px;
    color: #F47920;
    font-weight: 500;
}

/* Grid 布局 */
.bmuc-popular-grid .bmuc-popular-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}

.bmuc-popular-grid .bmuc-popular-item {
    flex-direction: column;
    gap: 8px;
}

.bmuc-popular-grid .bmuc-popular-name {
    white-space: normal;
}

.bmuc-popular-empty {
    text-align: center;
    padding: 24px;
    color: #94a3b8;
    font-size: 14px;
}
