/* ===== 背包页面 ===== */
/* 设计理念：古卷丹青 · 纳戒藏珍 · 乾坤为界 */
/* 参考排版：水墨仙境 · 菱形分类 · 古朴厚重 */

#page-bag {
    flex: 1;
    flex-direction: column;
    min-height: 0;
    padding-bottom: 70px;
    gap: 0;
    height: auto;
}

/* ===== ① 角色状态栏 ===== */
.bag-status-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--ink-surface);
    backdrop-filter: blur(6px);
    border-radius: var(--radius-lg);
    padding: 8px 10px;
    border: 1px solid var(--ink-border);
    flex-shrink: 0;
    margin-bottom: 6px;
}
.bag-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 1.5px solid color-mix(in srgb, var(--gold-foil) 40%, transparent);
    box-shadow: 0 0 8px var(--gold-foil-dim);
}
.bag-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 25%;
    display: block;
}
.bag-status-info { flex: 1; min-width: 0; }
.bag-status-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--gold-foil-light);
}
.bag-status-realm {
    font-size: 12px;
    color: var(--paper-muted);
    margin-top: 1px;
}
.bag-status-realm::before { content: '◆ '; color: var(--gold-foil); }
.bag-status-resources {
    display: flex;
    gap: 10px;
    margin-top: 2px;
}
.bag-resource {
    font-size: 12px;
    color: var(--paper-muted);
}
.bag-resource b { font-weight: 600; }
.bag-res-gold b { color: var(--gold-foil-light); }
.bag-res-crystal b { color: #88ccff; }
.bag-res-jade b { color: #c77dff; }

/* ===== ② 经验条 ===== */
.bag-exp-bar {
    flex-shrink: 0;
    margin-bottom: 8px;
}
.bag-exp-header {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--paper-muted);
    margin-bottom: 2px;
}
.bag-exp-number { color: var(--gold-foil); font-weight: 500; }
.bag-exp-track {
    width: 100%;
    height: 4px;
    background: color-mix(in srgb, var(--ink) 60%, transparent);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--ink-border);
}
.bag-exp-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold-foil), var(--gold-foil-light));
    border-radius: 10px;
    transition: width 0.5s ease;
}

/* ===== ③ 背包控制栏 ===== */
.bag-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    margin-bottom: 4px;
}
.bag-title {
    font-size: 16px;
    color: var(--gold-foil-light);
    letter-spacing: 2px;
    font-weight: 500;
}
.bag-upgrade-level {
    font-size: 11px;
    color: #87ceeb;
    padding: 2px 8px;
    background: rgba(30, 50, 80, 0.6);
    border: 1px solid rgba(135, 206, 235, 0.3);
    border-radius: 10px;
    margin: 0 5px;
}
.bag-expand-btn {
    background: transparent;
    border: 1px solid var(--gold-foil-dim);
    color: var(--gold-foil);
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 14px;
    cursor: pointer;
    transition: 0.2s;
}
.bag-expand-btn:active {
    background: var(--gold-foil-dim);
}

/* ===== ④ 背包容量 ===== */
.bag-capacity {
    font-size: 12px;
    color: var(--paper-muted);
    flex-shrink: 0;
    margin-bottom: 8px;
    padding: 0 2px;
}
.bag-cap-icon {
    color: var(--gold-foil);
    margin-right: 2px;
}
.bag-capacity #bag-used { color: var(--gold-foil); }
.bag-capacity #bag-max { color: var(--paper-muted); }

/* ===== ⑤ 主内容区域 ===== */
.bag-main {
    flex: 1;
    min-height: 0;
    display: flex;
    gap: 6px;
}

/* 左侧物品列表容器 */
.bag-items-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.bag-list {
    flex: 1;
    overflow-y: auto;
    padding: 2px 0;
    scrollbar-width: thin;
    scrollbar-color: var(--gold-foil-dim) transparent;
}

/* ===== 物品卡片（新版：名称 + 阶数 + 数量） ===== */
.bag-item {
    background: color-mix(in srgb, var(--ink) 55%, transparent);
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    border: 1px solid var(--ink-border);
    border-left-width: 3px;
    transition: 0.15s;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}
.bag-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-foil-dim), transparent);
}
.bag-item:active {
    background: color-mix(in srgb, var(--ink) 70%, transparent);
}
.bag-item-bulk {
    cursor: default;
    opacity: 0.75;
    background: color-mix(in srgb, var(--ink) 35%, transparent) !important;
    border-left-color: color-mix(in srgb, var(--gold-foil) 20%, transparent) !important;
}
.bag-item-bulk .bag-item-name {
    color: var(--paper-muted) !important;
}
.bag-item-bulk .bag-item-qty {
    color: color-mix(in srgb, var(--gold-foil) 50%, transparent) !important;
}
.bag-item-bulk::before {
    content: '⚙';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: var(--gold-foil-glow);
}
.bag-item-bulk:active {
    background: color-mix(in srgb, var(--ink) 35%, transparent) !important;
    transform: none;
}
.bag-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.bag-item-top {
    display: flex;
    align-items: center;
    gap: 8px;
}
.bag-item-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--paper);
    text-shadow: 0 0 6px var(--gold-foil-dim);
}
.bag-item-tier {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 50%;
    margin-top: -10px;
    font-size: 12px;
    color: var(--paper-muted);
    background: color-mix(in srgb, var(--gold-foil) 10%, transparent);
    padding: 0 8px;
    border-radius: 8px;
    line-height: 20px;
    letter-spacing: 0.5px;
    z-index: 1;
    white-space: nowrap;
}
.bag-item-equip {
    font-size: 11px;
    color: #88ccff;
    background: rgba(88, 204, 255, 0.08);
    padding: 0 6px;
    border-radius: 8px;
    line-height: 18px;
}
.bag-item-bottom {
    display: flex;
    align-items: center;
    gap: 6px;
}
.bag-item-qty {
    font-size: 13px;
    color: var(--gold-foil);
    font-weight: 500;
    margin-left: auto;
    margin-right: 4px;
    flex-shrink: 0;
}
.bag-item-arrow {
    font-size: 18px;
    color: var(--gold-foil-dim);
    flex-shrink: 0;
    margin-left: 8px;
}

/* ===== 板块标题分隔线 ===== */
.bag-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 4px 8px 4px;
    opacity: 0.85;
}
.bag-section-header:first-child {
    padding-top: 4px;
}
.bag-section-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--gold-foil-glow), transparent);
}
.bag-section-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gold-foil);
    letter-spacing: 2px;
    text-shadow: 0 0 8px var(--gold-foil-dim);
    white-space: nowrap;
}

/* 板块加载异常提示 */
.bag-section-error {
    text-align: center;
    padding: 12px 16px;
    color: var(--paper-muted);
    font-size: 12px;
    opacity: 0.6;
}

/* ===== 右侧分类栏（炼器房风格：竖排矩形） ===== */
.bag-categories {
    width: 66px;
    background: color-mix(in srgb, var(--ink) 60%, transparent);
    border-left: 1px solid var(--gold-foil-dim);
    overflow-y: auto;
    padding: 8px 5px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex-shrink: 0;
}
.bag-cat-btn {
    padding: 9px 4px;
    text-align: center;
    font-size: 13px;
    color: var(--paper-muted);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
    border: 1px solid transparent;
    white-space: nowrap;
    width: 100%;
    box-sizing: border-box;
}
.bag-cat-btn:hover {
    color: var(--gold-foil);
    background: var(--gold-foil-dim);
}
.bag-cat-btn.active {
    background: var(--gold-foil-dim);
    color: var(--gold-foil);
    border-color: color-mix(in srgb, var(--gold-foil) 40%, transparent);
}

/* ===== 空状态提示 ===== */
.bag-empty {
    text-align: center;
    padding: 40px 16px;
    color: var(--paper-muted);
    font-size: 14px;
}

/* ==============================================
   物品详情弹窗（点击背包物品后弹出）
   ============================================== */
.bag-detail-modal-body {
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
}

.bag-detail-body {
    display: flex;
    flex-direction: column;
    gap: 0;
    flex: 1;
    overflow: hidden;
}

/* 固定位置上锁/解锁按钮（字体比按钮大5号） */
.bag-detail-lock-btn {
    position: absolute;
    bottom: 160px;
    right: 75px;
    padding: 3px 10px;
    border: none;
    border-radius: 12px;
    background: var(--gold-foil);
    color: var(--ink);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: 0.15s;
    font-family: var(--font-body);
    letter-spacing: 0.5px;
    z-index: 10;
}

.bag-detail-lock-btn:active {
    transform: scale(0.93);
    opacity: 0.85;
}

.bag-detail-lock-btn:hover {
    box-shadow: 0 2px 8px var(--gold-foil-dim);
    transform: translateY(-1px);
}

.bag-detail-lock-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 头部信息 */
.bag-detail-head {
    padding: 8px 12px 6px;
    border-bottom: 1px solid var(--ink-border);
}
.bag-detail-desc {
    font-size: 12px;
    color: var(--paper-secondary);
    line-height: 1.5;
    margin-bottom: 4px;
}
.bag-detail-realm {
    font-size: 11px;
    color: var(--vermillion);
    background: color-mix(in srgb, var(--vermillion) 6%, transparent);
    display: inline-block;
    padding: 0 8px;
    border-radius: 8px;
    line-height: 20px;
}

/* 品质列表 */
.bag-detail-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}
.bag-detail-list::-webkit-scrollbar { width: 6px; }
.bag-detail-list::-webkit-scrollbar-track { background: transparent; }
.bag-detail-list::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--gold-foil-glow), var(--gold-foil-dim));
    border-radius: 10px;
}
.bag-detail-row {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-left: 3px solid var(--ink-border);
    border-bottom: 1px solid var(--ink-border);
    gap: 12px;
    background: var(--ink-surface);
}
.bag-detail-row:last-child {
    border-bottom: none;
}
.bag-detail-row-info {
    cursor: pointer;
    padding: 4px 2px;
    border-radius: 6px;
    transition: background 0.15s;
}
.bag-detail-row-info:hover {
    background: var(--gold-foil-dim);
}
.bag-detail-qname {
    font-size: 13px;
    font-weight: 600;
    min-width: 36px;
}
.bag-detail-qty {
    font-size: 13px;
    color: var(--gold-foil);
    font-weight: 500;
    min-width: 40px;
}
.bag-detail-actions {
    margin-left: auto;
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}
.bag-detail-action {
    padding: 3px 10px;
    border: none;
    border-radius: 12px;
    background: var(--gold-foil);
    color: var(--ink);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: 0.15s;
    font-family: var(--font-body);
    letter-spacing: 0.5px;
}
.bag-detail-action:active {
    transform: scale(0.93);
    opacity: 0.85;
}
.bag-detail-action:hover {
    box-shadow: 0 2px 8px var(--gold-foil-dim);
    transform: translateY(-1px);
}
.bag-detail-action.loading {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
    position: relative;
}
.bag-detail-action.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    border: 2px solid color-mix(in srgb, var(--paper) 30%, transparent);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* ===== 上锁按钮 ===== */
.bag-lock-wrap {
    flex-shrink: 0;
    margin-left: 6px;
}
.bag-lock-btn {
    width: 36px;
    height: 28px;
    border: 1px solid color-mix(in srgb, var(--gold-foil) 40%, transparent);
    border-radius: 6px;
    background: color-mix(in srgb, var(--ink) 60%, transparent);
    color: var(--gold-foil);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    padding: 0;
    line-height: 1;
}
.bag-lock-btn:hover {
    border-color: var(--gold-foil);
    background: var(--gold-foil-dim);
    transform: scale(1.05);
}
.bag-lock-btn:active {
    transform: scale(0.92);
}
.bag-lock-btn.locked {
    background: var(--vermillion-glow);
    border-color: var(--vermillion);
    color: var(--vermillion);
}
.bag-lock-btn[disabled] {
    opacity: 0.35;
    cursor: not-allowed;
}
.bag-detail-row.is-locked {
    background: color-mix(in srgb, var(--vermillion) 6%, transparent);
}
.bag-detail-row.is-locked .bag-detail-row-info {
    opacity: 0.75;
}
.bag-detail-count-inline {
    flex-shrink: 0;
    margin-left: 8px;
    font-size: 11px;
    color: var(--paper-muted);
    white-space: nowrap;
}
/* 详情弹窗上锁按钮样式 */
.lock-action {
    background: linear-gradient(135deg, #7c5a9a, #5a3d7a) !important;
    color: #fff !important;
}
.lock-action:active {
    background: linear-gradient(135deg, #5a3d7a, #4a2d6a) !important;
}
@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}
.bag-detail-action.success {
    animation: successPulse 0.4s ease-out;
}
@keyframes successPulse {
    0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--jade) 60%, transparent); }
    100% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--jade) 0%, transparent); }
}
.bag-detail-action.error {
    animation: shake 0.4s ease-out;
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}
.bag-detail-noaction {
    font-size: 11px;
    color: var(--paper-muted);
}

/* 总数量 */
.bag-detail-total {
    padding: 8px 12px;
    font-size: 13px;
    color: var(--paper-muted);
    border-top: 1px solid var(--ink-border);
    text-align: right;
}

/* ===== 按钮区自定义内容 ===== */
.custom-modal-actions .bag-detail-count {
    font-size: 12px;
    color: var(--paper-muted);
    font-weight: 500;
    font-family: var(--font-body);
    letter-spacing: 0.5px;
    margin-right: auto;
    line-height: 1;
}
.custom-modal-actions .bag-detail-footer-actions {
    display: flex;
    gap: 6px;
}
.custom-modal-actions .bag-detail-action {
    padding: 3px 10px;
    font-size: 11px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--gold-foil), var(--gold-foil));
    box-shadow: 0 1px 3px color-mix(in srgb, var(--ink) 30%, transparent);
    line-height: 1;
}
.custom-modal-actions .bag-detail-action:active {
    box-shadow: inset 0 1px 2px color-mix(in srgb, var(--ink) 30%, transparent);
}

/* ===== 批量兑换弹窗：品质行紧凑按钮（单行、轻背景、金色收益点缀） ===== */
.batch-sell-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px;
    border: 1px solid color-mix(in srgb, var(--gold-foil) 55%, transparent);
    border-radius: 10px;
    background: color-mix(in srgb, var(--gold-foil) 12%, transparent);
    color: var(--paper);
    font-size: 11px;
    font-weight: 600;
    font-family: var(--font-body);
    letter-spacing: 0.5px;
    line-height: 1.6;
    cursor: pointer;
    white-space: nowrap;
    transition: 0.15s;
}
.batch-sell-btn:hover {
    background: color-mix(in srgb, var(--gold-foil) 22%, transparent);
    border-color: var(--gold-foil);
}
.batch-sell-btn:active {
    transform: scale(0.95);
}
.batch-sell-btn .batch-sell-gain {
    font-size: 10px;
    font-weight: 700;
    color: var(--gold-foil);
}

/* ===== 蛋详情品质汇总 ===== */
.custom-modal-actions .bag-detail-quality-summary {
    font-size: 11px;
    color: var(--paper-muted);
    margin-top: 4px;
    line-height: 1.4;
}

/* ===== 批量兑换弹窗 ===== */
.batch-sell-body {
    padding: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
}
.batch-sell-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}
.bag-quality-btn {
    display: inline-block;
    justify-content: center;
    align-items: center;
    padding: 4px 16px;
    border: 2px solid;
    border-radius: 6px;
    background: color-mix(in srgb, var(--gold-foil) 5%, transparent);
    cursor: pointer;
    transition: 0.15s;
    font-family: var(--font-body);
    min-width: 80px;
    text-align: center;
}
.bag-quality-btn:hover {
    background: color-mix(in srgb, var(--gold-foil) 15%, transparent);
    transform: translateY(-1px);
}
.bag-quality-btn:active {
    transform: scale(0.98);
}
.bag-quality-btn-empty {
    opacity: 0.35;
    cursor: not-allowed;
}
.bag-quality-btn-empty:hover {
    background: color-mix(in srgb, var(--gold-foil) 5%, transparent);
    transform: none;
}

/* ===== 飞出文字动画 ===== */
.bag-float-text {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: auto;
    max-width: calc(100vw - 32px);
    box-sizing: border-box;
    padding: 0 8px;
    line-height: 1.4;
    letter-spacing: 0;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    font-family: var(--font-body);
    text-shadow: 0 0 10px currentColor, 0 2px 4px color-mix(in srgb, var(--ink) 50%, transparent);
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease-out;
}
.bag-float-text.show {
    animation: floatUp 2.5s ease-out forwards;
}
@keyframes floatUp {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%);
    }
    15% {
        opacity: 1;
        transform: translate(-50%, -60%);
    }
    85% {
        opacity: 1;
        transform: translate(-50%, -150%);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -150%);
    }
}

/* ===== 物品详情信息（弹窗顶部） ===== */
.bag-item-info-header {
    padding: 10px 12px;
    background: linear-gradient(180deg, var(--ink-border), transparent);
    border-bottom: 1px solid color-mix(in srgb, var(--gold-foil) 15%, transparent);
}
.bag-item-info-name {
    font-size: 16px;
    font-weight: 700;
    font-family: var(--font-body);
    margin-bottom: 4px;
}
.bag-item-info-meta {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-bottom: 4px;
}
.bag-item-info-type {
    font-size: 11px;
    color: var(--paper-secondary);
    background: var(--ink-border);
    padding: 1px 8px;
    border-radius: 10px;
}
.bag-item-info-quality {
    font-size: 11px;
    font-weight: 600;
}
.bag-item-info-req {
    font-size: 11px;
    color: var(--vermillion);
    background: color-mix(in srgb, var(--vermillion) 6%, transparent);
    padding: 2px 8px;
    border-radius: 10px;
    display: inline-block;
    margin-top: 2px;
}
.bag-item-info-desc {
    font-size: 12px;
    color: var(--paper-muted);
    line-height: 1.5;
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px dashed color-mix(in srgb, var(--gold-foil) 15%, transparent);
}

/* ===== 物品详情分区 ===== */
.bag-item-detail-section {
    padding: 8px 12px;
    border-bottom: 1px solid var(--ink-border);
}
.bag-item-detail-title {
    font-size: 12px;
    color: var(--gold-foil);
    font-weight: 600;
    margin-bottom: 4px;
    font-family: var(--font-body);
}
.bag-item-detail-content {
    font-size: 12px;
    color: var(--paper-secondary);
    line-height: 1.6;
}

/* ===== 物品详情行格式 ===== */
.bag-item-detail-line {
    font-size: 13px;
    line-height: 1.8;
    color: var(--paper-secondary);
    margin-bottom: 2px;
}
.bag-item-detail-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--gold-foil);
    font-family: var(--font-body);
    margin-bottom: 8px;
    text-align: center;
    padding-bottom: 8px;
    border-bottom: 1px solid color-mix(in srgb, var(--gold-foil) 20%, transparent);
}
.bag-item-detail-label {
    color: var(--paper-muted);
    font-weight: 500;
}
.bag-item-detail-value {
    color: var(--paper-text);
}

/* ==============================================
   物品详情弹窗 V2（美化版）
   ============================================== */
.item-detail-modal-wrap {
    padding: 0;
    background: linear-gradient(180deg, var(--ink) 0%, var(--ink) 100%);
    border-radius: 6px;
    position: relative;
    overflow: hidden;
}

.item-detail-modal-wrap::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--item-color, var(--gold-foil)), transparent);
    opacity: 0.7;
}

/* ---- 头部区域 ---- */
.item-detail-header {
    padding: 16px 16px 12px;
    background: linear-gradient(180deg, 
        color-mix(in srgb, var(--item-color, var(--gold-foil)) 8%, transparent) 0%, 
        transparent 100%);
    position: relative;
}

.item-detail-header-top {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.item-detail-title-area {
    flex: 1;
    min-width: 0;
    padding-top: 2px;
}

.item-detail-name {
    font-size: 18px;
    font-weight: 700;
    font-family: var(--font-body);
    color: var(--item-color, var(--gold-foil));
    letter-spacing: 1px;
    text-shadow: 0 0 12px color-mix(in srgb, var(--item-color, var(--gold-foil)) 40%, transparent);
    margin-bottom: 6px;
    line-height: 1.3;
}

.item-detail-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.item-detail-badge {
    font-size: 11px;
    font-weight: 500;
    padding: 2px 10px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--paper) 6%, transparent);
    color: var(--paper-secondary);
    border: 1px solid var(--gold-foil-dim);
    letter-spacing: 0.5px;
}

.item-detail-badge-quality {
    font-weight: 600;
    background: color-mix(in srgb, var(--item-color, var(--gold-foil)) 12%, transparent);
    border-width: 1px;
}

/* ---- 境界要求 ---- */
.item-detail-req {
    margin-top: 10px;
    padding: 4px 10px;
    font-size: 11px;
    color: #e8a0a0;
    background: var(--vermillion-glow);
    border: 1px solid var(--vermillion-glow);
    border-radius: 6px;
    display: inline-block;
}

/* ---- 描述文字 ---- */
.item-detail-desc {
    margin-top: 10px;
    padding: 10px 12px;
    font-size: 12px;
    color: var(--paper-secondary);
    line-height: 1.7;
    background: color-mix(in srgb, var(--paper) 3%, transparent);
    border-radius: 6px;
    border-left: 2px solid color-mix(in srgb, var(--item-color, var(--gold-foil)) 40%, transparent);
    font-style: italic;
    position: relative;
}

/* ---- 分隔线 ---- */
.item-detail-divider {
    height: 1px;
    margin: 4px 16px;
    background: linear-gradient(90deg, 
        transparent, 
        color-mix(in srgb, var(--item-color, var(--gold-foil)) 40%, transparent), 
        transparent);
    position: relative;
}

.item-detail-divider::before {
    content: '◆';
    position: absolute;
    left: 50%;
    top: -8px;
    transform: translateX(-50%);
    color: var(--item-color, var(--gold-foil));
    font-size: 10px;
    background: var(--ink);
    padding: 0 6px;
}

/* ---- 分区样式 ---- */
.item-detail-section {
    padding: 12px 16px;
    border-bottom: 1px solid var(--ink-border);
}

.item-detail-section:last-child {
    border-bottom: none;
}

.item-detail-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--item-color, var(--gold-foil));
    font-family: var(--font-body);
    margin-bottom: 8px;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.item-detail-section-body {
    font-size: 12px;
    color: var(--paper-muted);
    line-height: 1.7;
}

/* ---- 掉落来源 ---- */
.item-detail-drops {
    color: var(--paper-muted);
}

.item-detail-drops-more {
    color: var(--paper-muted);
    font-size: 11px;
}

/* ---- 效果展示 ---- */
.item-detail-effects {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.item-detail-effect {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: color-mix(in srgb, var(--paper) 4%, transparent);
    border: 1px solid var(--gold-foil-dim);
    border-radius: 8px;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.item-detail-effect::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--item-color, var(--gold-foil));
    border-radius: 8px 0 0 8px;
}

.item-detail-effect:hover {
    background: color-mix(in srgb, var(--paper) 7%, transparent);
    border-color: var(--gold-foil-glow);
    transform: translateX(2px);
}

.item-detail-effect-restore {
    background: linear-gradient(135deg, 
        color-mix(in srgb, var(--jade) 8%, transparent) 0%, 
        color-mix(in srgb, var(--jade) 2%, transparent) 100%);
    border-color: color-mix(in srgb, var(--jade) 20%, transparent);
}

.item-detail-effect-restore::before {
    background: linear-gradient(180deg, var(--jade), var(--jade));
}

.item-detail-effect-restore .item-detail-effect-value {
    color: #63e6be;
}

.item-detail-effect-name {
    font-size: 13px;
    color: var(--paper-secondary);
    font-weight: 500;
}

.item-detail-effect-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--item-color, var(--gold-foil));
    font-family: var(--font-body);
    letter-spacing: 0.5px;
    text-shadow: 0 0 8px color-mix(in srgb, var(--item-color, var(--gold-foil)) 40%, transparent);
}

/* ===== 纳戒扩容弹窗（与背包弹窗同风格，正文无嵌套标题/深色卡片） ===== */
.bag-upgrade-body {
    padding: 10px 12px 6px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.bag-upgrade-status {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 8px;
    font-size: 12px;
    color: var(--paper-muted);
    font-family: var(--font-body);
    letter-spacing: 0.5px;
}
.bag-upgrade-status b {
    color: var(--paper);
    font-weight: 600;
    margin: 0 2px;
}
.bag-upgrade-dot {
    opacity: 0.5;
}
.bag-upgrade-next {
    text-align: center;
    border: 1px solid var(--ink-border);
    border-radius: 10px;
    padding: 12px 10px 8px;
    background: color-mix(in srgb, var(--ink) 6%, transparent);
}
.bag-upgrade-next-title {
    font-size: 13px;
    color: var(--gold-foil);
    font-weight: 600;
    font-family: var(--font-body);
    letter-spacing: 1px;
}
.bag-upgrade-next-slots {
    font-size: 20px;
    color: var(--jade);
    font-weight: 700;
    font-family: var(--font-body);
    margin: 4px 0;
    text-shadow: 0 0 8px var(--jade-glow);
}
.bag-upgrade-next-desc {
    font-size: 11px;
    color: var(--paper-muted);
    margin-bottom: 8px;
}
.bag-upgrade-cost {
    display: flex;
    justify-content: center;
    gap: 28px;
    padding-top: 6px;
    border-top: 1px dashed var(--ink-border);
}
.bag-upgrade-cost-item {
    text-align: center;
}
.bag-upgrade-cost-label {
    display: block;
    font-size: 10px;
    color: var(--paper-muted);
    margin-bottom: 2px;
}
.bag-upgrade-cost-item > span:last-child {
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-body);
}
.bag-upgrade-ok {
    color: var(--jade);
}
.bag-upgrade-bad {
    color: var(--vermillion);
}
.bag-upgrade-have {
    color: var(--paper);
}
.bag-upgrade-max {
    text-align: center;
    padding: 18px 0;
    color: var(--paper-muted);
    font-size: 13px;
    font-family: var(--font-body);
}
.bag-upgrade-history-label {
    font-size: 11px;
    color: var(--paper-muted);
    font-family: var(--font-body);
    letter-spacing: 0.5px;
}
.bag-upgrade-history {
    max-height: 110px;
    overflow-y: auto;
    border: 1px solid var(--ink-border);
    border-radius: 8px;
    padding: 4px 8px;
    background: color-mix(in srgb, var(--ink) 4%, transparent);
}
.bag-upgrade-history-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
    font-size: 11px;
    color: var(--paper-secondary);
    font-family: var(--font-body);
}
.bag-upgrade-history-row.is-done {
    color: var(--jade);
}
.custom-modal-actions .bag-detail-action:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}
.custom-modal-actions .bag-upgrade-confirm-btn {
    font-weight: 700;
    letter-spacing: 1px;
}

/* ===== 物品详情弹窗：上部内容顺序排列，下部来源与操作分区 =====
   bag-item-grid 负责名称、属性和描述；bag-item-lower 负责掉落来源与操作按钮。 */
.bag-item-grid {
    display: grid;
    width: 100%;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    padding-bottom: 24px;
    grid-template-columns: minmax(0, 1fr) minmax(44px, auto) minmax(44px, auto) minmax(12px, 0.35fr) minmax(0, 1fr);
    grid-template-rows: repeat(20, auto);
    column-gap: 14px;
    row-gap: 6px;
    align-items: center;
    align-content: start;
    grid-auto-flow: row dense;
    padding: 8px 16px 12px;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}
.bag-item-grid > .bag-item-title,
.bag-item-grid > .bag-item-badges,
.bag-item-grid > .bag-item-req,
.bag-item-grid > .bag-item-eff-row {
    min-width: 0;
}
.bag-item-grid > .bag-item-badges,
.bag-item-grid > .bag-item-req,
.bag-item-grid > .bag-item-eff-row {
    grid-column: 1 / 4;
}
.bag-item-grid > .bag-item-desc {
    grid-column: 1 / -1;
    grid-row: auto;
    padding-left: 0;
}
.bag-item-grid > .bag-item-eff-row {
    grid-template-columns: minmax(0, 1fr) minmax(44px, auto) minmax(44px, auto);
    column-gap: 18px;
}
.bag-item-grid > .bag-item-eff-row:not(.bag-item-eff-row-equip) {
    grid-template-columns: minmax(0, 1fr) minmax(52px, auto);
}
.bag-item-grid > .bag-item-eff-row + .bag-item-eff-row {
    margin-top: 1px;
}
.bag-item-lower {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    gap: 14px;
    align-items: stretch;
    min-height: 70px;
    padding: 8px 16px 12px;
    box-sizing: border-box;
    background: color-mix(in srgb, var(--ink-surface) 96%, transparent);
    border-top: 1px solid color-mix(in srgb, var(--gold-foil) 18%, transparent);
    z-index: 2;
}
.bag-item-lower-left {
    flex: 1;
    min-width: 0;
    padding: 10px 12px 0 0;
    border-top: 1px solid color-mix(in srgb, var(--gold-foil) 12%, transparent);
}
.bag-item-actions {
    width: 96px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: flex-end;
}
.bag-item-title {
    grid-column: 1 / -1;
    color: var(--paper);
    grid-row: 1 / span 2;
    align-self: center;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 34px;
    font-size: 20px;
    font-weight: 700;
    font-family: var(--font-body);
    letter-spacing: 1px;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.bag-item-title .bag-item-enh {
    margin-left: 6px;
}
.bag-item-badges {
    grid-column: 1 / 4;
    grid-row: 3;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.bag-item-badge {
    font-size: 11px;
    font-weight: 500;
    padding: 2px 10px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--paper) 6%, transparent);
    color: var(--paper-secondary);
    border: 1px solid var(--gold-foil-dim);
    letter-spacing: 0.5px;
}
.bag-item-badge-quality {
    font-weight: 600;
    background: color-mix(in srgb, var(--item-color, var(--gold-foil)) 12%, transparent);
    border-width: 1px;
}
.bag-item-req {
    grid-column: 1 / 4;
    grid-row: 4;
    padding: 3px 10px;
    font-size: 11px;
    color: var(--vermillion);
    background: var(--vermillion-glow);
    border: 1px solid var(--vermillion-glow);
    border-radius: 6px;
    display: inline-block;
    justify-self: start;
}
/* 效果行：整行包裹占列1-3；普通物品为两列，装备/法宝为三列（属性名/基础值/加成值） */
.bag-item-eff-row {
    grid-column: 1 / 4;
    display: grid;
    grid-template-columns: minmax(0, auto) minmax(0, auto);
    column-gap: 14px;
    align-items: baseline;
    min-width: 0;
}
.bag-item-eff-row-equip {
    grid-template-columns: minmax(0, 1fr) minmax(40px, auto) minmax(40px, auto);
}
.bag-item-eff-name {
    font-size: 14px;
    color: var(--paper);
    font-family: var(--font-body);
    line-height: 1.6;
    white-space: nowrap;
    min-width: 0;
}
.bag-item-eff-val {
    font-size: 14px;
    color: var(--paper);
    font-weight: 700;
    font-family: var(--font-body);
    line-height: 1.6;
    white-space: nowrap;
    text-align: right;
    min-width: 0;
}
.bag-item-eff-bonus {
    font-size: 14px;
    color: var(--gold-foil-light);
    font-weight: 700;
    font-family: var(--font-body);
    line-height: 1.6;
    white-space: nowrap;
    text-align: right;
    min-width: 0;
}
.bag-item-enh {
    color: var(--vermillion);
    font-weight: 700;
}
.bag-item-desc {
    grid-column: 1 / -1;
    grid-row: auto;
    align-self: start;
    margin-top: 4px;
    font-size: 13px;
    color: var(--paper);
    line-height: 1.75;
    font-family: var(--font-body);
    font-style: normal;
    opacity: 0.96;
    min-width: 0;
    overflow-wrap: break-word;
    word-break: break-word;
}
.bag-item-sub-label {
    font-size: 12px;
    color: var(--paper-muted);
    font-family: var(--font-body);
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    white-space: nowrap;
}
.bag-item-drops {
    font-size: 13px;
    color: var(--paper-secondary);
    font-family: var(--font-body);
    line-height: 1.7;
    overflow-wrap: break-word;
    word-break: break-word;
}
.bag-item.is-loading {
    opacity: 0.72;
    pointer-events: none;
}
.bag-item.is-loading .bag-item-arrow {
    color: var(--gold-foil);
    animation: bagEggArrowPulse 0.8s ease-in-out infinite;
}
@keyframes bagEggArrowPulse {
    0%, 100% { transform: translateX(0); opacity: 0.45; }
    50% { transform: translateX(3px); opacity: 1; }
}
/* 按钮样式（与装备详情弹窗 pp-equip-btn 一致） */
.bag-item-btn {
    min-height: 36px;
    padding: 8px 6px;
    border: 1px solid color-mix(in srgb, var(--gold-foil) 45%, transparent);
    border-radius: 10px;
    background: color-mix(in srgb, var(--ink) 55%, transparent);
    color: var(--gold-foil);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-body);
    letter-spacing: 1px;
    cursor: pointer;
    transition: 0.15s;
}
.bag-item-btn:hover {
    background: color-mix(in srgb, var(--gold-foil) 14%, transparent);
}
.bag-item-btn:active {
    transform: scale(0.93);
    opacity: 0.85;
}
.bag-item-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.bag-item-btn-main {
    min-height: 40px;
    padding: 8px 0;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--gold-foil), color-mix(in srgb, var(--gold-foil) 78%, var(--ink)));
    color: var(--ink);
    font-size: 13px;
    font-weight: 700;
    font-family: var(--font-body);
    letter-spacing: 2px;
    cursor: pointer;
    transition: 0.15s;
    box-shadow: 0 2px 10px color-mix(in srgb, var(--gold-foil) 25%, transparent);
}
.bag-item-btn-main:active {
    transform: scale(0.97);
    opacity: 0.9;
}