/* =============================================================
   高品质个人中心 v9.6 - 全面重写
   - 用统一主题变量（--bg-* / --text-* / --accent* / --border-* / --success / --warning / --danger）
   - 自动适配 dark / light / stardew 三套主题
   - 信息密度高、视觉层次清晰、移动端友好
   ============================================================= */

:root {
    --pp-width: 380px;
    --pp-min-w: 300px;
    --pp-max-w: 640px;

    /* v10.2:品质色加深,白底也能看清(原色太亮) */
    --pp-quality-white:  #475569;   /* slate-600(原 #cbd5e1 偏白) */
    --pp-quality-green:  #16a34a;   /* green-600(原 #4ade80 太亮) */
    --pp-quality-blue:   #2563eb;   /* blue-600(原 #60a5fa) */
    --pp-quality-purple: #7c3aed;   /* violet-600(原 #a78bfa) */
    --pp-quality-orange: #ea580c;   /* orange-600(原 #fb923c) */
}

/* ===== 面板主容器 ===== */
.profile-panel {
    position: relative;
    flex: 0 0 var(--pp-width);
    min-width: var(--pp-min-w);
    max-width: var(--pp-max-w);
    height: 100%;
    background: var(--bg-surface, #fff);
    border-right: 1px solid var(--border-soft, rgba(0,0,0,0.06));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: pp-slide-in 0.22s ease-out;
    color: var(--text-primary, #1e293b);
}

/* v10.4:折叠态 —— display:none,grid 列变 0,让 chat-body 占满 */
.profile-panel.is-closed {
    display: none;
}

/* 在三栏 grid 布局下由 grid 撑满,保留拖拽功能 */
/* v10.3:宽度由 grid 列宽(--pp-grid-w)决定,这里 100% 跟随 */
.chat-layout > .profile-panel {
    height: 100%;
    border-right: 1px solid var(--border-soft, rgba(0,0,0,0.06));
    border-radius: 0;        /* 贴边无圆角(列在 grid 里,圆角会让右边缘断开) */
    box-shadow: var(--shadow-sm, 0 2px 6px rgba(0,0,0,0.06));
    overflow: visible;        /* ★ 修复：允许 pp-resize 溢出到右侧(原 overflow:hidden 会裁掉拖拽条) */
    width: 100%;
    min-width: 0;
    max-width: none;
}

/* grid 布局下 pp-scroll 自己负责内部滚动(已自带 overflow-y:auto) */

@keyframes pp-slide-in {
    from { transform: translateX(-12px); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

/* ===== 拖拽条 v2.0:12px 永远可见的灰线,hover/拖拽时变紫 ===== */
.pp-resize {
    position: absolute;
    top: 0;
    right: 0;                 /* 贴栏右边界 */
    transform: translateX(50%); /* 自身宽度一半溢出到栏外 */
    width: 12px;
    height: 100%;
    cursor: ew-resize;
    z-index: 50;              /* 高于栏内一切(覆盖卡片/标题) */
    background: transparent;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
}
.pp-resize::before {
    /* 永远可见的中央灰线 */
    content: '';
    width: 2px;
    height: 100%;
    background: var(--border-soft, rgba(0,0,0,0.08));
    transition: background 0.15s, height 0.15s, width 0.15s;
    border-radius: 1px;
}
.pp-resize::after {
    /* hover/拖拽时显示中点高亮 */
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 56px;
    border-radius: 2px;
    background: transparent;
    transition: background 0.15s, height 0.15s, box-shadow 0.15s;
    pointer-events: none;
}
.pp-resize:hover::before,
.pp-resize.is-dragging::before {
    background: var(--accent, #6366f1);
}
.pp-resize:hover::after,
.pp-resize.is-dragging::after {
    background: var(--accent, #6366f1);
    height: 96px;
    box-shadow: 0 0 8px var(--accent-soft, rgba(99,102,241,0.4));
}

/* ===== 顶部操作按钮（刷新/关闭，绝对定位在 <aside> 右上角） ===== */
.pp-refresh,
.pp-close {
    position: absolute;
    top: 12px;
    z-index: 10;
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-soft, rgba(0,0,0,0.08));
    border-radius: 10px;
    background: var(--color-surface, #fff);
    color: var(--text-secondary, #475569);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
    transition: all 0.18s;
    box-shadow: var(--shadow-xs, 0 1px 2px rgba(0,0,0,0.04));
}
.pp-refresh { right: 52px; padding: 0; }
.pp-close   { right: 12px; font-size: 22px; font-weight: 300; }
.pp-refresh:hover,
.pp-close:hover {
    background: var(--accent, #6366f1);
    color: var(--text-on-accent, #fff);
    border-color: transparent;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm, 0 2px 6px rgba(0,0,0,0.1));
}
.pp-refresh.is-spinning svg {
    animation: pp-spin 0.8s linear infinite;
}
@keyframes pp-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ===== Loading / Empty ===== */
.pp-loading {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--text-muted, #94a3b8);
    font-size: 14px;
}
.pp-loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border-soft, rgba(0,0,0,0.08));
    border-top-color: var(--accent, #6366f1);
    border-radius: 50%;
    animation: pp-spin 0.8s linear infinite;
}
.pp-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-muted, #94a3b8);
}
.pp-empty-icon { font-size: 48px; opacity: 0.6; }

/* ===== Header 角色卡 ===== */
.pp-header {
    position: relative;
    padding: 18px 18px 16px;
    background:
        linear-gradient(135deg, var(--accent-soft, rgba(99,102,241,0.10)) 0%, transparent 60%),
        var(--bg-surface, #fff);
    border-bottom: 1px solid var(--border-soft, rgba(0,0,0,0.06));
    overflow: hidden;
}
.pp-header-bg {
    position: absolute;
    top: -40px;
    right: -40px;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, var(--accent-soft, rgba(99,102,241,0.15)) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}
.pp-header-main,
.pp-header-stats {
    position: relative;
    z-index: 1;
}

.pp-header-main {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 14px;
}

/* 头像 */
.pp-avatar {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--accent, #6366f1), var(--accent-2, #ec4899));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-on-accent, #fff);
    font-size: 28px;
    font-weight: 600;
    flex-shrink: 0;
    overflow: hidden;
    box-shadow: var(--shadow-md, 0 6px 20px rgba(0,0,0,0.08));
}
.pp-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pp-avatar-level {
    position: absolute;
    bottom: -4px;
    right: -4px;
    min-width: 26px;
    height: 22px;
    padding: 0 6px;
    background: var(--warning, #f59e0b);
    color: #fff;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 22px;
    text-align: center;
    border: 2px solid var(--bg-surface, #fff);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* 身份信息 */
.pp-id { flex: 1; min-width: 0; }

.pp-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary, #1e293b);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
    margin-bottom: 8px;
    letter-spacing: 0.01em;
}

/* ===== chip 行（两行复用） ===== */
.pp-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 5px;
    align-items: center;
}
.pp-chips-last { margin-bottom: 0; }

/* ===== 等级徽章：Lv.24 金色胶囊 ===== */
.pp-level-badge {
    display: inline-block;
    font-size: 18px;
    font-weight: 600;
    font-family: inherit;
    line-height: 1;
    padding: 4px 9px;
    background: linear-gradient(135deg, #fff3a0 0%, #f5cc47 60%, #e8a800 100%);
    color: #6b4a00;
    border-radius: 999px;
    border: 1px solid rgba(184, 134, 11, 0.5);
    letter-spacing: 0.02em;
    box-shadow: 0 1px 2px rgba(200, 155, 0, 0.18);
    white-space: nowrap;
    vertical-align: middle;
}

/* ===== 通用 chip ===== */
.pp-chip {
    display: inline-block;
    font-size: 16px;
    font-weight: 500;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 999px;
    white-space: nowrap;
    border: 1px solid transparent;
    letter-spacing: 0.01em;
    vertical-align: middle;
}

/* 职业：淡紫底 + 紫文字 */
.pp-chip-job {
    background: rgba(99, 102, 241, 0.10);
    color: #5b5dd4;
    border-color: rgba(99, 102, 241, 0.18);
}

/* 性别：淡青底 + 青文字 */
.pp-chip-gender {
    background: rgba(20, 184, 166, 0.10);
    color: #0d8a80;
    border-color: rgba(20, 184, 166, 0.20);
}

/* 称号：暖琥珀胶囊（与等级同色系） */
.pp-chip-title {
    background: linear-gradient(135deg, #ffe8b0 0%, #f5c060 60%, #e09030 100%);
    color: #6a3800;
    border-color: rgba(160, 110, 10, 0.50);
    box-shadow: 0 1px 2px rgba(180, 120, 20, 0.18);
    font-weight: 600;
}

/* ===== 点赞：深棕实心胶囊 + 浅金文字（和 chip 区分） ===== */
.pp-up {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    padding: 4px 10px;
    background: linear-gradient(180deg, #6a4a1c 0%, #4d3314 100%);
    border: 1px solid rgba(40, 25, 5, 0.5);
    border-radius: 999px;
    color: #f5d98a;
    cursor: default;
    transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
    vertical-align: middle;
    box-shadow: 0 1px 2px rgba(40, 25, 5, 0.25);
}
.pp-up:hover {
    background: linear-gradient(180deg, #7a5828 0%, #5a3a18 100%);
    box-shadow: 0 2px 6px rgba(40, 25, 5, 0.35);
    transform: translateY(-1px);
}
.pp-up-label {
    color: #f5d98a;
    font-weight: 600;
    letter-spacing: 0.05em;
}
.pp-up-count {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: #ffe9a8;
}
.pp-server {
    font-size: 12px;
    color: var(--text-muted, #94a3b8);
}

/* 战力 / 排位 / VIP */
.pp-header-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 12px;
    background: var(--bg-surface-2, rgba(0,0,0,0.03));
    border-radius: 12px;
    border: 1px solid var(--border-soft, rgba(0,0,0,0.04));
}
.pp-stat {
    text-align: center;
}
.pp-stat-label {
    font-size: 16px;
    color: var(--text-secondary, #475569);   /* v10.1:加深(原 --text-muted) */
    font-weight: 500;
    margin-bottom: 2px;
}
.pp-stat-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary, #1e293b);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    letter-spacing: -0.2px;
    line-height: 1.2;
    word-break: break-all;
}
.pp-vip-pill {
    grid-column: 1 / -1;
    text-align: center;
    padding: 6px 10px;
    margin-top: 4px;
    background: linear-gradient(135deg, var(--accent-2, #f59e0b), var(--warning, #f59e0b));
    color: #fff;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(245,158,11,0.3);
}

/* ===== 滚动内容区 ===== */
.pp-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    scrollbar-width: thin;
    scrollbar-color: var(--border-mid, rgba(0,0,0,0.1)) transparent;
}
.pp-scroll::-webkit-scrollbar { width: 6px; }
.pp-scroll::-webkit-scrollbar-thumb {
    background: var(--border-mid, rgba(0,0,0,0.1));
    border-radius: 3px;
}
.pp-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--accent, #6366f1);
}

/* ===== Card 通用 ===== */
.pp-card {
    background: var(--bg-surface, #fff);
    border: 1px solid var(--border-soft, rgba(0,0,0,0.06));
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
    transition: border-color 0.15s;
}
.pp-card:hover { border-color: var(--border-mid, rgba(0,0,0,0.1)); }

.pp-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary, #475569);
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    letter-spacing: 0.02em;
}

/* 折叠头 */
.pp-collapse-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    padding: 2px 0;
}
.pp-collapse-arrow {
    font-size: 10px;
    color: var(--text-muted, #94a3b8);
    transition: transform 0.2s;
}
.pp-collapse-arrow.is-open { transform: rotate(90deg); }

/* 特色卡片（位置+任务） */
.pp-card--feature {
    background:
        linear-gradient(135deg, var(--accent-soft, rgba(99,102,241,0.06)) 0%, transparent 80%),
        var(--bg-surface, #fff);
    border-color: var(--accent-border, rgba(99,102,241,0.2));
    border-left: 3px solid var(--accent, #6366f1);
}
.pp-card--feature .pp-card-title {
    color: var(--accent, #6366f1);
    font-weight: 700;
}

/* ===== 位置 + 任务 ===== */
.pp-location {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding: 8px 12px;
    background: var(--bg-surface-2, rgba(0,0,0,0.03));
    border-radius: 10px;
    font-size: 14px;
}
.pp-location-icon { font-size: 18px; }
.pp-location-text strong {
    color: var(--text-primary, #1e293b);
    font-size: 15px;
    font-weight: 700;
}

.pp-task {
    background: var(--bg-surface-2, rgba(0,0,0,0.03));
    border: 1px solid var(--border-soft, rgba(0,0,0,0.05));
    border-radius: 10px;
    padding: 10px 12px;
    margin-top: 6px;
}
.pp-task-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}
.pp-task-head .pp-task-name { flex: 1; min-width: 0; }   /* 任务名称占满,奖励标签自然靠右 */
.pp-task-head .pp-task-reward { margin-left: auto; }     /* 奖励靠右贴边 */
.pp-task-type {
    font-size: 10px;
    padding: 2px 8px;
    background: var(--accent, #6366f1);
    color: var(--text-on-accent, #fff);
    border-radius: 999px;
    font-weight: 600;
}
.pp-task-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #1e293b);
}
.pp-task-des {
    font-size: 12px;
    color: var(--text-secondary, #475569);
    margin-bottom: 4px;
    line-height: 1.5;
}
.pp-task-fun {
    font-size: 12px;
    color: var(--text-muted, #94a3b8);
    font-style: italic;
    margin-bottom: 6px;
    line-height: 1.5;
}
.pp-task-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 6px;
    border-top: 1px dashed var(--border-soft, rgba(0,0,0,0.08));
}
.pp-task-reward {
    font-size: 11px;
    padding: 2px 8px;
    background: var(--warning-soft, rgba(245,158,11,0.12));
    color: var(--warning, #f59e0b);
    border-radius: 999px;
    font-weight: 600;
}
.pp-task--empty { text-align: center; padding: 16px 12px; }
.pp-task-empty-text {
    font-size: 13px;
    color: var(--text-secondary, #475569);
    margin-bottom: 4px;
}
.pp-task-empty-tip {
    font-size: 11px;
    color: var(--text-muted, #94a3b8);
}

/* ===== 进度条（经验/血量/背包） ===== */
.pp-bar-row {
    display: grid;
    /* 标签32 + 进度条fr + 数值90：固定三列，两行 grid 列宽天然一致 */
    grid-template-columns: 32px minmax(0, 1fr) 90px;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 12px;
}
.pp-bar-row:last-child { margin-bottom: 0; }
.pp-bar-label {
    color: var(--text-secondary, #475569);   /* v10.1:加深 */
    font-weight: 500;
}
.pp-bar-track {
    height: 8px;
    background: var(--bg-floating, rgba(0,0,0,0.06));
    border-radius: 4px;
    overflow: hidden;
}
.pp-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s ease;
}
.pp-bar-fill.exp {
    background: linear-gradient(90deg, var(--accent, #6366f1), var(--accent-2, #ec4899));
}
.pp-bar-fill.hp {
    background: linear-gradient(90deg, var(--danger, #ef4444), var(--warning, #f59e0b));
}
.pp-bar-fill.bag {
    background: linear-gradient(90deg, var(--success, #10b981), var(--accent, #6366f1));
}
.pp-bar-value {
    color: var(--text-primary, #1e293b);     /* v10.1:加深(原 secondary) */
    font-weight: 600;                        /* v10.1:加粗 */
    text-align: right;
    white-space: nowrap;
}

/* ===== 行（label + value） ===== */
.pp-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 12px;
}
.pp-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    font-size: 12px;
    border-bottom: 1px dashed var(--border-soft, rgba(0,0,0,0.05));
}
.pp-row:last-child { border-bottom: none; }
.pp-row-label {
    color: var(--text-secondary, #475569);   /* v10.1:加深 */
    font-weight: 500;
    flex-shrink: 0;
}
.pp-row-value {
    color: var(--text-primary, #1e293b);
    font-weight: 600;
    text-align: right;
}
.pp-add {
    color: var(--success, #10b981);
    font-size: 10px;
    font-weight: 600;
    margin-left: 2px;
}
.pp-add--neg { color: var(--danger, #ef4444); }

/* ===== 天赋 6 维网格 ===== */
.pp-attr-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.pp-attr {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 4px;
    background: var(--bg-surface-2, rgba(0,0,0,0.03));
    border-radius: 8px;
    border: 1px solid var(--border-soft, rgba(0,0,0,0.04));
}
.pp-attr-icon { font-size: 18px; margin-bottom: 2px; }
.pp-attr-name {
    font-size: 10px;
    color: var(--text-muted, #94a3b8);
    margin-bottom: 2px;
}
.pp-attr-val {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary, #1e293b);
}

/* ===== 标签 ===== */
.pp-tag {
    font-size: 14px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--bg-surface-2, rgba(0,0,0,0.06));
    color: var(--text-secondary, #475569);
    font-weight: 500;
}
.pp-tag.is-muted {
    background: var(--bg-floating, rgba(0,0,0,0.05));
    color: var(--text-muted, #94a3b8);
    font-weight: 400;
}

/* ===== 装备 3x3 九宫格（参考小程序 equipment/index） ===== */
.pp-equip-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;                              /* 紧凑间距(原 8px) */
    padding: 2px 0;
}
.pp-equip-cell {
    position: relative;
    aspect-ratio: 1 / 1;
    border: 2px solid transparent;         /* 收紧边框(原 3px) */
    border-radius: 6px;
    background: var(--bg-surface-2, rgba(0,0,0,0.04));
    overflow: hidden;
    box-sizing: border-box;
    transition: transform 0.12s;
}
.pp-equip-cell:active {
    transform: scale(0.96);
}
.pp-equip-cell-inner {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;            /* v10.2:居中排布(图标+文字),由 flex:1 的 icon 和 min-height 的 name/sub 自行分配 */
    padding: 3px 2px;
    box-sizing: border-box;
    gap: 1px;
}
.pp-equip-cell-icon {
    position: relative;
    width: 100%;
    flex: 1 1 0;                        /* v10.2:占满剩余空间(图片视觉最大) */
    min-height: 0;                      /* 关键:允许被 flex 压缩到 0 */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;                   /* 防止图溢出 */
}
.pp-equip-cell-icon img {
    max-width: 86%;                        /* 装备图加大(原 70%) */
    max-height: 86%;
    object-fit: contain;
    image-rendering: -webkit-optimize-contrast;
}
.pp-equip-cell-icon span {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-muted, #94a3b8);
}
.pp-equip-cell-force {
    position: absolute;
    top: 1px;
    right: 1px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #000;
    font-size: 6px;                       /* v10.3:缩小字号,+15以内不溢出 */
    font-weight: 700;
    padding: 0 2.5px;
    min-width: 16px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border-radius: 3px;                    /* 四角圆边 */
}
/* v10.1:宝石镶嵌齐全,装备图视觉放大 */
.pp-equip-cell-icon--big img,
.pp-equip-cell-icon--big > span:not(.pp-equip-cell-force):not(.pp-equip-cell-gem) {
    max-width: 100% !important;           /* 原 86% → 100% */
    max-height: 100% !important;
}
/* v10.1→v10.2:宝石齐全角标(已弃用,改为 godmark) */
.pp-equip-cell-gem { display: none; }
.pp-equip-cell-name {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    width: 100%;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 0 0 auto;                  /* v10.2:锁高度,不被 icon 挤压 */
    min-height: 12px;                /* v10.2:硬底线 */
}
.pp-equip-cell-sub {
    font-size: 12px;
    color: var(--text-secondary, #475569);
    line-height: 1.2;
    width: 100%;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 0 0 auto;                  /* v10.2:锁高度,不被 icon 挤压 */
    min-height: 11px;                /* v10.2:硬底线 */
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    letter-spacing: -0.2px;
}

/* 品质边框（与小程序一致） */
.pp-equip-cell.quality-white  { border-color: #9ca3af; }
.pp-equip-cell.quality-green  { border-color: #22c55e; }
.pp-equip-cell.quality-blue   { border-color: #3b82f6; }
.pp-equip-cell.quality-purple { border-color: #a855f7; }
.pp-equip-cell.quality-orange {
    border-color: #f59e0b;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, var(--bg-surface-2, rgba(0,0,0,0.04)) 100%);
}

/* v10.2:品质文字颜色:用类选择器强制覆盖行内(行内 var 在类选择器面前无效) */
.pp-equip-cell.quality-white  .pp-equip-cell-name { color: #1e293b; }   /* slate-800,深到白底可读 */
.pp-equip-cell.quality-green  .pp-equip-cell-name { color: #15803d; }
.pp-equip-cell.quality-blue   .pp-equip-cell-name { color: #1d4ed8; }
.pp-equip-cell.quality-purple .pp-equip-cell-name { color: #7e22ce; }
.pp-equip-cell.quality-orange .pp-equip-cell-name { color: #c2410c; }

/* 空槽位 */
.pp-equip-cell-empty {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--text-tertiary, #94a3b8);
    background: transparent;
    border: 2px dashed var(--text-tertiary, #94a3b8);
    border-radius: 6px;
    margin: 0;
}
.pp-equip-cell.quality-empty {
    background: transparent;
    border-color: transparent;
    padding: 2px;
}
.pp-equip-cell-plus {
    font-size: 24px;
    font-weight: 300;
    line-height: 1;
}
.pp-equip-cell-slotname {
    font-size: 10px;
    line-height: 1.1;
}

/* ===== 宠物列表 ===== */
.pp-pet-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.pp-pet {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 6px 10px;
    background: var(--bg-surface-2, rgba(0,0,0,0.03));
    border-left: 3px solid var(--pp-quality-white, #cbd5e1);
    border-radius: 6px;
}
.pp-pet-main { flex: 1; min-width: 0; }
.pp-pet-row1 {
    display: flex;
    gap: 6px;
    align-items: center;
    font-size: 13px;
    margin-bottom: 2px;
    flex-wrap: wrap;
}
.pp-pet-row2 {
    display: flex;
    gap: 6px;
    font-size: 11px;
    color: var(--text-secondary, #475569);   /* v10.1:加深 */
    font-weight: 500;
    flex-wrap: wrap;
}
.pp-pet-name {
    font-weight: 600;
    color: var(--text-primary, #1e293b);
}
.pp-pet-quality {
    font-size: 11px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(0,0,0,0.05);
}
.pp-pet-active {
    color: var(--success, #10b981);
    font-weight: 600;
    font-size: 11px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--success-soft, rgba(16,185,129,0.12));
}
.pp-pet-status {
    color: var(--text-secondary, #475569);   /* v10.1:加深 */
    font-weight: 500;
    font-size: 11px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(0,0,0,0.05);
}

/* ===== 技能列表 ===== */
.pp-skill-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.pp-skill {
    padding: 6px 10px;
    background: var(--bg-surface-2, rgba(0,0,0,0.03));
    border-radius: 6px;
}
.pp-skill-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary, #1e293b);
    margin-bottom: 2px;
}
.pp-skill-meta {
    font-size: 11px;
    color: var(--text-secondary, #475569);   /* v10.1:加深 */
    font-weight: 500;
    display: flex;
    gap: 4px;
}

/* ===== Footer ===== */
.pp-footer {
    text-align: center;
    font-size: 10px;
    color: var(--text-faint, rgba(0,0,0,0.3));
    padding: 12px 0 4px;
    letter-spacing: 0.05em;
}

/* ===== 响应式 ===== */
@media (max-width: 480px) {
    .profile-panel { --pp-width: 100vw !important; min-width: 0 !important; max-width: 100vw !important; }
    .pp-attr-grid { grid-template-columns: repeat(2, 1fr); }
    .pp-grid-2 { grid-template-columns: 1fr; }
}

/* =========================================================
   v10.2:无孔神装(可打孔)炫彩特效 + 装备详情弹窗
   ========================================================= */

/* 无孔神装整体:金色外发光(参考小程序 god-equip) */
.pp-equip-cell.god-equip {
    border-color: #fbbf24 !important;
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.55), 0 0 14px rgba(251, 191, 36, 0.25);
    overflow: hidden;
    cursor: pointer;
}
.pp-equip-cell.god-equip:hover {
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.7), 0 0 18px rgba(251, 191, 36, 0.4);
}

/* 呼吸光背景层(径向金色光 + 3s 呼吸) */
.pp-equip-god-breath {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(ellipse at center,
                rgba(255, 215, 0, 0.50) 0%,
                rgba(255, 180, 0, 0.30) 40%,
                transparent 75%);
    animation: ppGodBreath 3s ease-in-out infinite;
    pointer-events: none;
    /* v10.2:无 z-index,走 DOM 自然顺序,在 inner 之前绘制 → 视觉上在图底 */
}
@keyframes ppGodBreath {
    0%, 100% { opacity: 0.3; }
    50%      { opacity: 1; }
}

/* 微光扫过(斜向 105deg 高光带,5s 一次) */
.pp-equip-cell.god-equip::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -80%;
    width: 50%;
    height: 200%;
    background: linear-gradient(105deg,
        transparent 0%, transparent 35%,
        rgba(255, 255, 255, 0.40) 42%,
        rgba(255, 245, 180, 0.70) 50%,
        rgba(255, 255, 255, 0.40) 58%,
        transparent 65%, transparent 100%);
    z-index: 5;                          /* v10.2:顶层装饰(角标之上) */
    animation: ppGodShine 5s ease-in-out infinite;
    pointer-events: none;
}
@keyframes ppGodShine {
    0%, 70% { left: -80%; opacity: 0; }
    75%     { opacity: 1; }
    100%    { left: 180%; opacity: 0.8; }
}

/* v10.2:无孔神装堆叠顺序(从底到顶,核心原则:装备图在 z=0 最底)
   z=0  装备图(.pp-equip-cell-icon img)        ← 最底层(用户要求)
   z=1  文字(name/sub)                          ← 自然在图之上
   z=2  角标(force/godmark)                     ← 浮在文字之上
   z=3  呼吸光(breath)                          ← 装饰(径向金色光,从图上扫过)
   z=4  微光扫过(::before)                      ← 顶层装饰(偶尔高光) */

/* 核心:装备图明确为 z=0 最底 */
.pp-equip-cell.god-equip .pp-equip-cell-inner { z-index: auto; }
.pp-equip-cell.god-equip .pp-equip-cell-icon  { z-index: 0; }
.pp-equip-cell.god-equip .pp-equip-cell-name,
.pp-equip-cell.god-equip .pp-equip-cell-sub   { z-index: 1; position: relative; }

/* 角标永远最顶 */
.pp-equip-cell-force,
.pp-equip-cell-godmark { z-index: 6; }


.pp-equip-cell-icon--big img,
.pp-equip-cell-icon--big > span:not(.pp-equip-cell-force):not(.pp-equip-cell-godmark) {
    max-width: 100% !important;     /* 占满 icon 容器 100%(原 86%) */
    max-height: 100% !important;
    filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.6));
}
.pp-equip-cell-godmark {
    position: absolute;
    top: 1px;                    /* 左上角 */
    left: 1px;
    font-size: 11px;
    color: #ffd700;              /* 金色字 */
    line-height: 1;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.8);  /* 仅黑色描边,不再金色强光 */
    pointer-events: none;
    background: rgba(0, 0, 0, 0.7);           /* 深黑半透底(原 0.4 太亮) */
    border: 1px solid rgba(255, 215, 0, 0.6); /* 金色细边框 */
    border-radius: 2px 4px 4px 0;
    padding: 1px 3px;
    z-index: 6;                                /* v10.2:角标永远最顶 */
}

/* ===== 装备详情弹窗(参考小程序 detail-popup,改屏幕正中央) ===== */
.pp-modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;          /* v11.5:垂直居中 */
    justify-content: center;     /* v11.5:水平居中 */
    z-index: 9999;
    animation: ppFadeIn 0.18s ease-out;
}
@keyframes ppFadeIn { from { opacity: 0; } to { opacity: 1; } }

.pp-equip-detail-popup {
    width: 520px;                /* v11.5:稍微加宽 */
    max-width: 92vw;
    max-height: 85vh;            /* v11.5:留出上下边距 */
    background: var(--color-surface, #ffffff);
    border-radius: 16px;         /* v11.5:四圆角 */
    padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);   /* v11.5:全方向阴影 */
    animation: ppPopIn 0.22s ease-out;             /* v11.5:弹出动画 */
    display: flex;
    flex-direction: column;
    color: var(--text-primary, #1e293b);           /* v11.5:弹窗整体文字色 */
}
@keyframes ppPopIn {                              /* v11.5:从中心放大 */
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}

/* v11.5:深色模式下弹窗用深色背景 */
[data-theme="dark"] .pp-equip-detail-popup {
    background: #2A2F3D;
    color: #E8E9EE;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* v11.5.1:深色模式下弹窗内子元素用具体深色色值(不依赖 chat.css 14-16 行的变量,
   避免 chat.css 被清理后深色弹窗子元素回退到浅色 fallback) */
[data-theme="dark"] .pp-equip-detail-popup .edp-icon-wrap,
[data-theme="dark"] .pp-equip-detail-popup .edp-tag:not(.quality-bg-white):not(.quality-bg-green):not(.quality-bg-blue):not(.quality-bg-purple):not(.quality-bg-orange):not(.god-tag):not(.nohole-tag),
[data-theme="dark"] .pp-equip-detail-popup .edp-close-btn,
[data-theme="dark"] .pp-equip-detail-popup .edp-attrs,
[data-theme="dark"] .pp-equip-detail-popup .edp-section,
[data-theme="dark"] .pp-equip-detail-popup .edp-gem-slot:not(.empty.god) {
    background: #1F2430;
    color: #E8E9EE;
    border-color: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .pp-equip-detail-popup .edp-close-btn:hover { background: #3A4150; }
[data-theme="dark"] .pp-equip-detail-popup .edp-section-meta { color: #B0B3BD; }
[data-theme="dark"] .pp-equip-detail-popup .edp-attr-label { color: #B0B3BD; }
[data-theme="dark"] .pp-equip-detail-popup .edp-gem-name { color: #F0F1F5; }

.edp-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    gap: 12px;
}
.edp-header-left { display: flex; gap: 12px; align-items: center; flex: 1; min-width: 0; }
.edp-icon-wrap {
    width: 64px; height: 64px;
    border-radius: 12px;
    border: 3px solid;
    background: var(--bg-input, #f1f5f9);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}
.edp-icon-wrap img { width: 86%; height: 86%; object-fit: contain; }
.edp-icon-wrap.quality-white  { border-color: #9ca3af; }
.edp-icon-wrap.quality-green  { border-color: #22c55e; }
.edp-icon-wrap.quality-blue   { border-color: #3b82f6; }
.edp-icon-wrap.quality-purple { border-color: #a855f7; }
.edp-icon-wrap.quality-orange { border-color: #f59e0b; }

.edp-header-info { flex: 1; min-width: 0; }
.edp-name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-primary, #1e293b);
}
.edp-name.quality-white  { color: #6b7280; }
.edp-name.quality-green  { color: #16a34a; }
.edp-name.quality-blue   { color: #2563eb; }
.edp-name.quality-purple { color: #9333ea; }
.edp-name.quality-orange { color: #d97706; }

.edp-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.edp-tag {
    font-size: 14px;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--bg-input, #f1f5f9);
    color: var(--text-secondary, #475569);
}
.edp-tag.quality-bg-white  { background: #9ca3af; color: #fff; }
.edp-tag.quality-bg-green  { background: #22c55e; color: #fff; }
.edp-tag.quality-bg-blue   { background: #3b82f6; color: #fff; }
.edp-tag.quality-bg-purple { background: #a855f7; color: #fff; }
.edp-tag.quality-bg-orange { background: linear-gradient(135deg, #f59e0b, #ea580c); color: #fff; }
.edp-tag.god-tag    { background: linear-gradient(135deg, #ffd700, #ff8c00); color: #000; font-weight: 600; }
.edp-tag.nohole-tag { background: var(--text-muted, #94a3b8); color: #fff; }

.edp-close-btn {
    width: 28px; height: 28px;
    line-height: 26px;
    text-align: center;
    font-size: 16px;
    border-radius: 50%;
    background: var(--bg-input, #f1f5f9);
    color: var(--text-secondary, #475569);
    cursor: pointer;
    flex-shrink: 0;
    user-select: none;
}
.edp-close-btn:hover { background: var(--text-muted, #94a3b8); color: #fff; }

/* 基础属性(等级/强化/突破) */
.edp-attrs {
    background: var(--bg-input, #f1f5f9);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-around;
}
.edp-attr-item { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.edp-attr-label { font-size: 11px; color: var(--text-muted, #94a3b8); }
.edp-attr-val   { font-size: 16px; font-weight: 700; color: var(--text-primary, #1e293b); }
.text-yellow { color: #d97706 !important; }
.text-cyan   { color: #0891b2 !important; }

/* v11.5:深色模式下属性数字更亮 */
[data-theme="dark"] .edp-attr-val { color: #F0F1F5; }

/* 通用小节标题 */
.edp-section {
    background: var(--bg-input, #f1f5f9);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 12px;
}
.edp-section-hd { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.edp-section-title { font-size: 14px; font-weight: 600; color: var(--text-primary, #1e293b); }
.edp-section-meta  { font-size: 12px; color: var(--text-muted, #94a3b8); }

/* v11.5:深色模式下小节标题更亮 */
[data-theme="dark"] .edp-section-title { color: #F0F1F5; }

/* 宝石列表 */
.edp-gems { display: flex; flex-direction: column; gap: 6px; }
.edp-gem-slot {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px;
    background: var(--color-surface, #ffffff);
    border-radius: 6px;
    border: 1px solid var(--bg-input, #e2e8f0);
}
.edp-gem-slot.empty { opacity: 0.55; border-style: dashed; }
.edp-gem-slot.empty.god {  /* v10.2:无孔神装(可打孔)金边高亮 */
    opacity: 1;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.12) 0%, rgba(255, 215, 0, 0.04) 100%);
    border: 1px solid rgba(255, 215, 0, 0.6);
    color: #b45309;
}
.edp-gem-slot.empty.god .edp-gem-name { color: #b45309; font-weight: 600; }
.edp-gem-emoji { font-size: 18px; }
.edp-gem-name  { font-size: 13px; font-weight: 500; color: var(--text-primary, #1e293b); }

/* v11.5:深色模式下宝石名更亮 */
[data-theme="dark"] .edp-gem-name { color: #F0F1F5; }

/* 元素效果 chip */
.edp-effects { display: flex; flex-wrap: wrap; gap: 8px; }
.edp-effect-tag {
    display: flex; align-items: center; gap: 4px;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid transparent;
    font-size: 12px;
}
.edp-effect-tag.add {
    background: linear-gradient(135deg, rgba(255, 183, 77, 0.25), rgba(255, 152, 0, 0.15));
    border-color: rgba(255, 152, 0, 0.4);
}
.edp-effect-tag.reduce {
    background: linear-gradient(135deg, rgba(79, 195, 247, 0.25), rgba(3, 169, 244, 0.15));
    border-color: rgba(3, 169, 244, 0.4);
}
.edp-tag-emoji  { font-size: 14px; }
.edp-tag-label  { color: var(--text-secondary, #475569); }
.edp-tag-value  { font-weight: 700; font-size: 13px; }
.edp-effect-tag.add    .edp-tag-value { color: #e65100; }
.edp-effect-tag.reduce .edp-tag-value { color: #0277bd; }

/* v11.5:深色模式下元素效果文字更亮 */
[data-theme="dark"] .edp-tag-label { color: #C8CAD2; }
[data-theme="dark"] .edp-effect-tag.add    .edp-tag-value { color: #FFB74D; }
[data-theme="dark"] .edp-effect-tag.reduce .edp-tag-value { color: #4FC3F7; }

/* 星露谷主题下适配 */
[data-theme="stardew"] .pp-equip-detail-popup,
[data-skin="stardew"]  .pp-equip-detail-popup {
    background: #fff7e3;
    border-left: 3px solid var(--sd-wood, #8b5a2b);
}

/* v10.5+：已回退修改昵称功能 —— 保留备份注释，不引入未使用的 .pp-edit-nick / .pp-nick-* / .np-* 样式 */
