/**
 * WP Points & Levels - 前端样式
 */

/* 等级徽章 */
.wpl-level-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 12px;
    line-height: 1.6;
    font-weight: bold;
    white-space: nowrap;
}

/* 进度条 */
.wpl-progress-bar-wrap {
    width: 100%;
    height: 8px;
    background: #e8e8e8;
    border-radius: 4px;
    overflow: hidden;
}
.wpl-progress-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s ease;
}
.wpl-progress-text {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

/* 正负积分颜色 */
.wpl-pos { color: #2ea44f; }
.wpl-neg { color: #d73a49; }

/* 文章末尾作者信息 */
.wpl-post-author-info {
    margin-top: 20px;
    padding: 12px 16px;
    background: #f7f7f7;
    border-left: 3px solid #ffd700;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.wpl-post-author-info .wpl-author-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}
.wpl-post-author-info .wpl-author-avatar {
    border-radius: 50%;
    border: 2px solid #ffd700;
}
.wpl-post-author-info .wpl-author-name {
    font-weight: bold;
    font-size: 15px;
}
.wpl-post-author-info .wpl-author-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}
.wpl-post-author-info .wpl-author-level {
    font-weight: bold;
    margin-right: 12px;
}
.wpl-post-author-info a.wpl-author-profile-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}
.wpl-post-author-info a.wpl-author-profile-link:hover .wpl-author-name {
    text-decoration: underline;
}

/* ---------- 作者个人信息页（[wpl_author_profile]） ---------- */
.wpl-author-profile {
    max-width: 560px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 28px 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.wpl-ap-head {
    text-align: center;
    padding-bottom: 18px;
    border-bottom: 1px solid #f0f0f1;
}
.wpl-ap-avatar img {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    border: 3px solid #ffd700;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
.wpl-ap-name {
    font-size: 22px;
    font-weight: 700;
    color: #1d2327;
    margin-top: 10px;
    line-height: 1.3;
}
.wpl-ap-login {
    font-size: 13px;
    color: #999;
    margin: 3px 0 8px;
}
.wpl-ap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 10px;
    margin: 18px 0;
}
.wpl-ap-item {
    background: #f8f9fc;
    border: 1px solid #edf0f5;
    border-radius: 10px;
    padding: 12px 8px;
    text-align: center;
}
.wpl-ap-item-label {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.wpl-ap-item-value {
    font-size: 22px;
    font-weight: 700;
    color: #1d2327;
    font-variant-numeric: tabular-nums;
    margin-top: 3px;
}
.wpl-ap-item.wpl-ap-points .wpl-ap-item-value { color: #2271b1; }
.wpl-ap-item.wpl-ap-coins  .wpl-ap-item-value { color: #d4a017; }
.wpl-ap-email {
    text-align: center;
    font-size: 13px;
    color: #2271b1;
    word-break: break-all;
    padding: 2px 0 4px;
}
.wpl-ap-email::before {
    content: "✉";
    margin-right: 6px;
}
.wpl-ap-bio {
    border-top: 1px solid #f0f0f1;
    margin-top: 14px;
    padding-top: 14px;
}
.wpl-ap-bio h4 {
    margin: 0 0 10px;
    font-size: 15px;
    color: #1d2327;
}
.wpl-ap-bio p {
    margin: 0;
    font-size: 14px;
    color: #555;
    line-height: 1.9;
    white-space: pre-wrap;
    word-break: break-word;
}
/* 作者最新文章 */
.wpl-ap-posts {
    border-top: 1px solid #f0f0f1;
    margin-top: 14px;
    padding-top: 14px;
}
.wpl-ap-posts h4 {
    margin: 0 0 10px;
    font-size: 15px;
    color: #1d2327;
}
.wpl-ap-post-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.wpl-ap-post-list li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 8px 2px;
    border-bottom: 1px dashed #eee;
}
.wpl-ap-post-list li:last-child {
    border-bottom: 0;
}
.wpl-ap-post-list a {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    color: #1d2327;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.wpl-ap-post-list a:hover {
    color: #2271b1;
    text-decoration: underline;
}
.wpl-ap-post-date {
    flex-shrink: 0;
    font-size: 12px;
    color: #999;
    font-variant-numeric: tabular-nums;
}

/* 作者详情页移动端 */
@media screen and (max-width: 600px) {
    .wpl-author-profile {
        border-radius: 10px;
        padding: 22px 16px;
    }
    .wpl-ap-avatar img {
        width: 84px;
        height: 84px;
    }
    .wpl-ap-name { font-size: 19px; }
    .wpl-ap-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        margin: 14px 0;
    }
    .wpl-ap-item { padding: 10px 6px; }
    .wpl-ap-item-value { font-size: 19px; }
}

/* 用户卡片 */
.wpl-user-card {
    max-width: 320px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.wpl-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
}
.wpl-card-header img { border-radius: 50%; }
.wpl-card-name { font-weight: bold; font-size: 16px; }
.wpl-card-level { margin-top: 4px; }
.wpl-card-points {
    margin: 12px 0;
    text-align: center;
}
/* 双账本：积分 + 金币并排 */
.wpl-card-balances {
    display: flex;
    justify-content: center;
    gap: 28px;
    margin: 12px 0;
}
.wpl-card-balances .wpl-card-points,
.wpl-card-balances .wpl-card-coins {
    margin: 0;
    text-align: center;
}
.wpl-coins-num {
    font-size: 28px;
    font-weight: bold;
    color: #e8a0a0;
}
.wpl-card-balances .wpl-coins-num,
.wpl-card-coins .wpl-coins-num {
    color: #d4a017;
}
.wpl-coins-label {
    font-size: 12px;
    color: #999;
    margin-left: 4px;
}
.wpl-points-num {
    font-size: 28px;
    font-weight: bold;
    color: #ffb300;
}
.wpl-points-label {
    font-size: 12px;
    color: #999;
    margin-left: 4px;
}
/* 账本徽章（前端日志表） */
.wpl-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 9px;
    font-size: 11px;
    line-height: 1.7;
    font-weight: 600;
    white-space: nowrap;
}
.wpl-badge-points {
    background: #e8f0fe;
    color: #2271b1;
}
.wpl-badge-coins {
    background: #fdf3e0;
    color: #b8860b;
}

/* 用户中心 */
.wpl-dashboard {
    max-width: 600px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 20px;
}
.wpl-dashboard-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}
.wpl-dashboard-info h3 { margin: 0 0 6px; }
.wpl-dashboard-balances {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin-top: 6px;
}
.wpl-dashboard-points { font-size: 18px; font-weight: bold; }
.wpl-dashboard-coins {
    font-size: 18px;
    font-weight: bold;
    color: #d4a017;
}
.wpl-dashboard-progress { margin-bottom: 20px; }
.wpl-dashboard-levels, .wpl-dashboard-logs { margin-top: 20px; }

/* 排行榜 */
.wpl-ranking table,
.wpl-logs-table,
.wpl-levels-table,
.wpl-signin-logs-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}
.wpl-ranking th, .wpl-ranking td,
.wpl-logs-table th, .wpl-logs-table td,
.wpl-levels-table th, .wpl-levels-table td,
.wpl-signin-logs-table th, .wpl-signin-logs-table td {
    border: 1px solid #e8e8e8;
    padding: 8px 10px;
    text-align: left;
}
.wpl-ranking th, .wpl-logs-table th, .wpl-levels-table th, .wpl-signin-logs-table th {
    background: #f7f7f7;
    font-weight: bold;
}
.wpl-level-current { background: #fff8e1; }

/* 等级路径图 */
.wpl-level-path {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px 0;
}
.wpl-path-node {
    text-align: center;
    flex: 1;
    min-width: 60px;
    opacity: 0.4;
}
.wpl-path-node.wpl-passed { opacity: 1; }
.wpl-path-node.wpl-active .wpl-path-dot {
    transform: scale(1.4);
    box-shadow: 0 0 0 4px rgba(255,215,0,0.3);
}
.wpl-path-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin: 0 auto 6px;
    transition: all 0.3s;
}
.wpl-path-label { font-size: 13px; font-weight: bold; }
.wpl-path-min { font-size: 11px; color: #999; }

/* 签到卡片 */
.wpl-signin-card {
    max-width: 400px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 16px;
}
.wpl-signin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.wpl-signin-header h4 { margin: 0; }
.wpl-signin-btn {
    background: #ffd700;
    color: #333;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}
.wpl-signin-btn:disabled,
.wpl-signin-btn.disabled {
    background: #ccc;
    cursor: not-allowed;
}
.wpl-signin-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 12px 0;
}
.wpl-stat-item { text-align: center; }
.wpl-stat-num {
    display: block;
    font-size: 20px;
    font-weight: bold;
    color: #333;
}
.wpl-stat-label {
    font-size: 11px;
    color: #999;
}
.wpl-signin-points {
    font-size: 13px;
    color: #666;
    text-align: center;
    margin-top: 8px;
}
.wpl-signin-result {
    margin-top: 10px;
    font-size: 13px;
    text-align: center;
    min-height: 18px;
}
.wpl-signin-result.success { color: #2ea44f; }
.wpl-signin-result.error { color: #d73a49; }

/* 签到统计卡片 */
.wpl-signin-stats-card {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 500px;
}
.wpl-signin-stats-card .wpl-stat-item {
    background: #f7f7f7;
    border-radius: 6px;
    padding: 10px;
}

/* 日历 */
.wpl-calendar {
    max-width: 360px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 12px;
}
.wpl-calendar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.wpl-calendar-nav button {
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 2px 10px;
    cursor: pointer;
}
.wpl-cal-title { font-weight: bold; }
.wpl-cal-weekdays, .wpl-cal-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}
.wpl-cal-weekdays span, .wpl-cal-days span {
    text-align: center;
    font-size: 13px;
    padding: 6px 0;
}
.wpl-cal-weekdays span { font-weight: bold; color: #666; }
.wpl-cal-day {
    background: #f7f7f7;
    border-radius: 4px;
}
.wpl-cal-day.wpl-cal-signed {
    background: #ffd700;
    color: #333;
    font-weight: bold;
}
.wpl-cal-empty { visibility: hidden; }

/* Widget */
.wpl-widget-content { padding: 8px 0; }
.wpl-widget-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.wpl-widget-user img { border-radius: 50%; }
.wpl-widget-name { font-weight: bold; }
.wpl-widget-points { text-align: center; margin: 10px 0; }
.wpl-widget-points .wpl-coins-num {
    font-size: 20px;
    font-weight: bold;
    color: #d4a017;
}
.wpl-widget-coins-sep { color: #ccc; margin: 0 8px; }
.wpl-widget-progress .wpl-progress-text { text-align: center; }

/* 未登录提示 */
.wpl-notice {
    padding: 10px 14px;
    background: #fff4e5;
    border-left: 3px solid #ffa500;
    border-radius: 4px;
    color: #8a5a00;
}

/* ===== 个人资料页（响应式 / 防主题冲突） =====
   说明：profile 页通过 get_header/get_footer 渲染在主题内，主题 CSS 会
   覆盖我们的通用元素（table/td/th/h2/h3/img/a）。本块全部使用
   #wpl-profile-page ID 前缀提高特异性（ID > 类），并加入主题重置。 */

/* 统一盒模型 + 主题重置：清空主题对表格/标题/图片/链接的默认样式 */
#wpl-profile-page,
#wpl-profile-page *,
#wpl-profile-page *::before,
#wpl-profile-page *::after {
    box-sizing: border-box;
}
#wpl-profile-page table,
#wpl-profile-page thead,
#wpl-profile-page tbody,
#wpl-profile-page tr,
#wpl-profile-page th,
#wpl-profile-page td {
    border: none;
    border-collapse: separate;
    border-spacing: 0;
    margin: 0;
    padding: 0;
    background: none;
    width: auto;
    max-width: 100%;
}
#wpl-profile-page h1,
#wpl-profile-page h2,
#wpl-profile-page h3 {
    margin: 0;
    padding: 0;
    border: none;
    line-height: 1.3;
}
#wpl-profile-page img {
    max-width: 100%;
    height: auto;
    border: none;
}
#wpl-profile-page a {
    text-decoration: none;
    color: inherit;
}
#wpl-profile-page p { margin: 0; }
#wpl-profile-page .dashicons {
    font-family: dashicons;
    display: inline-block;
    line-height: 1;
    font-weight: 400;
    font-style: normal;
    speak: never;
    text-decoration: inherit;
    text-transform: none;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    width: 1em;
    height: 1em;
    font-size: 1em;
    vertical-align: top;
    text-align: center;
    transition: color .1s ease-in;
}

#wpl-profile-page { padding: 16px 0; width: 100%; }
#wpl-profile-page .wpl-profile {
    max-width: 880px;
    margin: 0 auto;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}

/* 头部 Hero */
#wpl-profile-page .wpl-profile-hero {
    background: linear-gradient(135deg, #6a8dff 0%, #8a5cf6 50%, #b14db4 100%);
    color: #fff;
    padding: 28px 24px;
}
#wpl-profile-page .wpl-profile-hero-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    max-width: 100%;
}
#wpl-profile-page .wpl-profile-avatar {
    flex: 0 0 auto;
    line-height: 0;
}
#wpl-profile-page .wpl-profile-avatar img.wpl-avatar-img {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    border: 4px solid rgba(255,255,255,0.85);
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    object-fit: cover;
    max-width: 100%;
}
#wpl-profile-page .wpl-profile-info {
    flex: 1 1 200px;
    min-width: 0;
}
#wpl-profile-page .wpl-profile-name {
    margin: 0 0 8px;
    font-size: 22px;
    line-height: 1.3;
    color: #fff;
    word-break: break-word;
    overflow-wrap: anywhere;
}
#wpl-profile-page .wpl-profile-tags {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
#wpl-profile-page .wpl-profile-email {
    color: rgba(255,255,255,0.92);
    font-size: 13px;
    text-decoration: none;
    word-break: break-all;
}
#wpl-profile-page .wpl-profile-email:hover { text-decoration: underline; }

#wpl-profile-page .wpl-profile-points-pill {
    flex: 0 0 auto;
    margin-left: auto;
    padding: 10px 18px;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 999px;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.1;
}
#wpl-profile-page .wpl-profile-points-pill .wpl-points-big {
    font-size: 26px;
    font-weight: 700;
    color: #fff;
}
#wpl-profile-page .wpl-profile-points-pill .wpl-points-unit {
    font-size: 12px;
    color: rgba(255,255,255,0.85);
    margin: 2px 0 0;
}

/* 主体 */
#wpl-profile-page .wpl-profile-body { padding: 20px 24px 24px; }

/* 进度条 */
#wpl-profile-page .wpl-profile-progress { margin-bottom: 20px; }
#wpl-profile-page .wpl-profile-progress .wpl-progress-bar-wrap {
    height: 10px;
    background: #eceff5;
    border-radius: 6px;
    overflow: hidden;
}
#wpl-profile-page .wpl-profile-progress .wpl-progress-text {
    margin-top: 8px;
    font-size: 13px;
    color: #6b7280;
    word-break: break-word;
}

/* 统计卡片 —— 已简化：去除多余边框，仅保留浅色背景区分 */
#wpl-profile-page .wpl-profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 4px;
}
#wpl-profile-page .wpl-profile-stat-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: #f8f9fc;
    border: none;
    border-radius: 12px;
    min-width: 0;
}
#wpl-profile-page .wpl-profile-stat-card .wpl-stat-icon {
    font-size: 26px;
    color: #ffb300;
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    line-height: 30px;
    text-align: center;
}
#wpl-profile-page .wpl-profile-stat-card .wpl-stat-content { min-width: 0; }
#wpl-profile-page .wpl-profile-stat-card .wpl-stat-num {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.2;
}
#wpl-profile-page .wpl-profile-stat-card .wpl-stat-label {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 2px;
}

/* 分区 —— 已简化：去除分隔边框 */
#wpl-profile-page .wpl-profile-section {
    padding: 18px 0;
    border: none;
    overflow: hidden;
}
#wpl-profile-page .wpl-profile-section h3 {
    margin: 0 0 14px;
    font-size: 15px;
    font-weight: 600;
    color: #374151;
    word-break: break-word;
}
/* 等级路径：横向滚动（节点不收缩，保持可读宽度） */
#wpl-profile-page .wpl-profile-section .wpl-level-path {
    padding: 0 0 6px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
#wpl-profile-page .wpl-profile-section .wpl-level-path .wpl-path-node {
    flex: 0 0 auto;
    min-width: 64px;
}
#wpl-profile-page .wpl-profile-section .wpl-level-path .wpl-path-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin: 0 auto 6px;
    transition: all 0.3s;
}
#wpl-profile-page .wpl-profile-section .wpl-level-path .wpl-path-label {
    font-size: 13px;
    font-weight: bold;
    text-align: center;
}
#wpl-profile-page .wpl-profile-section .wpl-level-path .wpl-path-min {
    font-size: 11px;
    color: #999;
    text-align: center;
}
#wpl-profile-page .wpl-profile-section .wpl-level-path .wpl-path-node.wpl-passed { opacity: 1; }
#wpl-profile-page .wpl-profile-section .wpl-level-path .wpl-path-node.wpl-active .wpl-path-dot {
    transform: scale(1.4);
    box-shadow: 0 0 0 4px rgba(255,215,0,0.3);
}

/* ===== 头像上传 ===== */
.wpl-avatar-upload {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 16px;
    background: #f8f9fc;
    border: 1px solid #eef0f4;
    border-radius: 12px;
    flex-wrap: wrap;
}
.wpl-avatar-preview {
    flex: 0 0 auto;
}
.wpl-avatar-preview img.wpl-avatar-img {
    border-radius: 50%;
    border: 3px solid #e5e7eb;
    width: 88px;
    height: 88px;
    object-fit: cover;
    max-width: 100%;
}
.wpl-avatar-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1 1 200px;
    min-width: 0;
}
.wpl-avatar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    border: none;
    transition: background .2s, transform .15s;
}
.wpl-avatar-btn:active { transform: scale(0.97); }
.wpl-btn-upload {
    background: #2271b1;
    color: #fff;
}
.wpl-btn-upload:hover { background: #135e96; }
.wpl-btn-delete {
    background: #d63638;
    color: #fff;
}
.wpl-btn-delete:hover { background: #b32d2e; }
.wpl-avatar-tip {
    font-size: 12px;
    color: #9ca3af;
    margin: 0;
}
.wpl-avatar-msg {
    font-size: 13px;
    margin: 0;
    min-height: 18px;
}
.wpl-avatar-msg.wpl-success { color: #00a32a; }
.wpl-avatar-msg.wpl-error { color: #d63638; }
.wpl-avatar-msg.wpl-loading {
    color: #2271b1;
    position: relative;
    padding-left: 20px;
}
.wpl-avatar-msg.wpl-loading::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 14px;
    height: 14px;
    margin-top: -7px;
    border: 2px solid #c3c4c7;
    border-top-color: #2271b1;
    border-radius: 50%;
    animation: wpl-spin .6s linear infinite;
}
@keyframes wpl-spin { to { transform: rotate(360deg); } }

/* ===== 平板及以下（768px 以下）统一响应式 =====
   说明：将原 600px 才触发的「日志表卡片化」「等级路径节点不换行」
   提前到 768px，避免 600-768px 的平板/大手机出现表格溢出与文字换行。 */
@media (max-width: 768px) {
    #wpl-profile-page { padding: 12px 0; }
    #wpl-profile-page .wpl-profile { border-radius: 12px; }
    #wpl-profile-page .wpl-profile-hero { padding: 24px 18px; }
    #wpl-profile-page .wpl-profile-body { padding: 18px 18px 20px; }
    #wpl-profile-page .wpl-profile-avatar img.wpl-avatar-img { width: 84px; height: 84px; }

    /* 统计卡片 2 列：单卡宽度足够容纳「3000」「化神期」等长内容，避免换行 */
    #wpl-profile-page .wpl-profile-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    #wpl-profile-page .wpl-profile-stat-card .wpl-stat-icon { font-size: 24px; }

    /* 等级路径：节点最小宽度 72px，文字强制不换行，超出宽度走横向滚动 */
    #wpl-profile-page .wpl-profile-section .wpl-level-path .wpl-path-node { min-width: 72px; }
    #wpl-profile-page .wpl-profile-section .wpl-level-path .wpl-path-label,
    #wpl-profile-page .wpl-profile-section .wpl-level-path .wpl-path-min {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* 日志表 → 卡片化（避免 4 列表格在窄屏溢出容器） */
    #wpl-profile-page .wpl-profile-section .wpl-logs-table thead { display: none; }
    #wpl-profile-page .wpl-profile-section .wpl-logs-table,
    #wpl-profile-page .wpl-profile-section .wpl-logs-table tbody,
    #wpl-profile-page .wpl-profile-section .wpl-logs-table tr,
    #wpl-profile-page .wpl-profile-section .wpl-logs-table td {
        display: block;
        width: 100%;
    }
    #wpl-profile-page .wpl-profile-section .wpl-logs-table tr {
        margin-bottom: 10px;
        border: none;
        border-radius: 10px;
        padding: 6px 10px;
        background: #f8f9fc;
    }
    #wpl-profile-page .wpl-profile-section .wpl-logs-table td {
        border: none;
        padding: 6px 4px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        text-align: right;
        font-size: 13px;
        word-break: break-word;
    }
    #wpl-profile-page .wpl-profile-section .wpl-logs-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #6b7280;
        text-align: left;
        flex: 0 0 auto;
    }
}

/* ===== 手机（600px 以下） ===== */
@media (max-width: 600px) {
    #wpl-profile-page { padding: 8px 0; }
    #wpl-profile-page .wpl-profile { border-radius: 0; box-shadow: none; }
    #wpl-profile-page .wpl-profile-hero { padding: 20px 14px; }
    #wpl-profile-page .wpl-profile-body { padding: 14px; }

    /* Hero 改为垂直堆叠：头像 + 名称居中，积分胶囊居中 */
    #wpl-profile-page .wpl-profile-hero-inner {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: 14px;
    }
    #wpl-profile-page .wpl-profile-avatar { align-self: center; }
    #wpl-profile-page .wpl-profile-avatar img.wpl-avatar-img { width: 76px; height: 76px; }
    #wpl-profile-page .wpl-profile-info { flex: 1 1 auto; }
    #wpl-profile-page .wpl-profile-name { font-size: 19px; }
    #wpl-profile-page .wpl-profile-tags { justify-content: center; }
    #wpl-profile-page .wpl-profile-points-pill {
        margin-left: 0;
        align-self: center;
        padding: 8px 16px;
    }
    #wpl-profile-page .wpl-profile-points-pill .wpl-points-big { font-size: 22px; }

    /* 统计卡片保持 2 列，单卡更宽松，避免数字/等级名换行 */
    #wpl-profile-page .wpl-profile-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    #wpl-profile-page .wpl-profile-stat-card {
        flex-direction: column;
        text-align: center;
        gap: 4px;
        padding: 10px 4px;
    }
    #wpl-profile-page .wpl-profile-stat-card .wpl-stat-icon { font-size: 20px; width: 20px; height: 20px; }
    #wpl-profile-page .wpl-profile-stat-card .wpl-stat-num { font-size: 15px; }
    #wpl-profile-page .wpl-profile-stat-card .wpl-stat-label { font-size: 10px; }

    /* 头像上传表单：垂直堆叠（同时用于 public profile 与后台编辑页，保持全局） */
    .wpl-avatar-upload { flex-direction: column; align-items: stretch; gap: 14px; }
    .wpl-avatar-preview { text-align: center; }
    .wpl-avatar-preview img.wpl-avatar-img { width: 80px; height: 80px; }

    /* 等级路径节点压缩到 64px */
    #wpl-profile-page .wpl-profile-section .wpl-level-path .wpl-path-node { min-width: 64px; }
    #wpl-profile-page .wpl-profile-section .wpl-level-path .wpl-path-label { font-size: 12px; }
    #wpl-profile-page .wpl-profile-section .wpl-level-path .wpl-path-min { font-size: 10px; }
}

/* ===== 超小屏（380px 以下） ===== */
@media (max-width: 380px) {
    #wpl-profile-page .wpl-profile-stats { grid-template-columns: 1fr; }
    #wpl-profile-page .wpl-profile-hero { padding: 16px 10px; }
    #wpl-profile-page .wpl-profile-body { padding: 10px; }
}
