/* ===== lineup.css - 阵容模拟页面专属样式 ===== */
/* 包含: 元素标签、跟宠卡片、已选跟宠、羁绊系统、布局预览
         敌方配置、跟宠池、拖拽交互、玩家数值输入、响应式适配 */

/* --- 触控反馈 --- */
/* 触控反馈 - 所有可点击元素 */
.element-tab,
.pet-card,
.selected-pet {
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.element-tab:active,
.pet-card:active,
.selected-pet:active {
    transform: scale(0.92) !important;
    opacity: 0.75 !important;
}

/* --- 跟宠布局区域图片允许拖拽 --- */
/* 跟宠布局区域内的图片允许拖拽（用于跟宠拖拽功能） */
.pet-layout-container img,
#configPetPool img,
#configPetLayoutSlots img,
#petPool img,
#petLayoutSlots img,
.pet-pool-item img,
.pet-slot img {
    -webkit-user-drag: element;
}

/* --- 主容器与页面布局 --- */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 25px 30px;
    background: var(--gradient-primary);
    border-radius: 20px;
    margin-bottom: 25px;
    box-shadow: 0 10px 40px var(--shadow-primary);
}

header h1 {
    font-weight: 800;
    font-size: 2.5em;
    background: linear-gradient(90deg, #ffffff, #f0f0f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 2px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header p {
    color: rgba(255,255,255,0.9);
    font-size: 1.1em;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 25px;
}

.pets-section {
    background: #ffffff;
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.04);
}

.selected-section {
    background: #ffffff;
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.04);
    position: sticky;
    top: 20px;
    height: fit-content;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.section-title {
    font-size: 1.25em;
    padding-bottom: 14px;
    border-bottom: 2px solid #eef0f2;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #2d3748;
    font-weight: 700;
}

.section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 2px solid #eef0f2;
}

.section-title-row .section-title {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.btn-group {
    display: flex;
    gap: 8px;
}

.btn-config {
    padding: 8px 18px;
    background: var(--gradient-primary);
    color: var(--text-on-gradient);
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    /* 使用 box-shadow 替代 border，完美跟随圆角 */
    box-shadow: 0 3px 12px var(--shadow-primary-light), 0 0 0 1px transparent;
    overflow: hidden;
}

.btn-config:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow-primary), 0 0 0 1px rgba(255,255,255,0.3);
}

.btn-config:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow-primary);
}

.section-title .icon {
    width: 30px;
    height: 30px;
    background: var(--gradient-primary);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.section-title .icon svg {
    width: 18px;
    height: 18px;
    fill: white;
}

.element-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}

@media (max-width: 900px) {
    .element-tabs {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
    }
}

.element-tab {
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.25s ease;
    font-size: 0.9em;
    /* 使用 box-shadow 替代 border，完美跟随圆角 */
    border: none;
    box-shadow: 0 0 0 2px transparent;
    background: #f5f5f5;
    color: #666;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    user-select: none;
    overflow: hidden;
}

.element-tab:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1), 0 0 0 2px #e0e0e0;
}

.element-tab.active {
    box-shadow: 0 6px 24px rgba(0,0,0,0.18);
    transform: scale(1.04);
}

.element-tab:active {
    transform: scale(0.95);
}

.pets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 18px;
}

.pet-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 16px 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    /* 使用 box-shadow 替代 border，完美跟随圆角 */
    border: none;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04), 0 0 0 2px #e8e8e8;
    position: relative;
    overflow: hidden;
}

.pet-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px var(--shadow-primary-subtle), 0 0 0 2px var(--color-primary-light);
}

.pet-card.selected {
    box-shadow: 0 8px 28px rgba(255, 215, 0, 0.25), 0 0 0 2px #ffd700;
    background: linear-gradient(145deg, #fffbeb, #fef3c7);
}

.pet-card.in-team {
    opacity: 0.5;
}

.pet-card:active {
    transform: scale(0.95);
}

.pet-icon {
    width: 85px;
    height: 85px;
    margin: 0 auto 10px;
    border-radius: 50%;
    background: linear-gradient(145deg, #f0f0f0, #e0e0e0);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.1);
}

.pet-icon img {
    width: 75px;
    height: 75px;
    object-fit: contain;
}

.pet-icon.demo-icon {
    background: transparent !important;
    box-shadow: none !important;
}

.pet-name {
    font-size: 0.95em;
    font-weight: 600;
    margin-bottom: 6px;
    color: #333;
}

.pet-bonds {
    display: flex;
    justify-content: center;
    gap: 2px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.bond-mini-icon {
    width: 16px;
    height: 16px;
    border-radius: 3px;
}

.pet-level {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--gradient-primary);
    color: var(--text-on-gradient);
    font-size: 0.7em;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 600;
}

.pet-count {
    position: absolute;
    top: 8px;
    left: 8px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7em;
    font-weight: 600;
}

.selected-pets {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    min-height: 180px;
    margin-bottom: 20px;
    padding: 20px 16px;
    background: linear-gradient(145deg, #f8f9fa, #f3f4f6);
    border-radius: 16px;
    justify-content: center;
    /* 使用 box-shadow 替代 dashed border，完美跟随圆角 */
    border: none;
    box-shadow: 0 0 0 2px dashed #e2e5ea;
}

.selected-pet {
    width: 80px;
    height: 100px;
    background: #ffffff;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 6px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* 使用 box-shadow 替代 border，完美跟随圆角 */
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04), 0 0 0 2px #e8e8e8;
    overflow: hidden;
}

.selected-pet:hover {
    background: linear-gradient(145deg, #fff5f5, #fee2e2);
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.15), 0 0 0 2px #ef4444;
}

.selected-pet:active {
    transform: scale(0.92);
    opacity: 0.7;
}

.selected-pet .slot-number {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 22px;
    height: 22px;
    background: var(--gradient-primary);
    color: var(--text-on-gradient);
    border-radius: 50%;
    font-size: 0.75em;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    line-height: 1;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px var(--shadow-primary-light);
}

.selected-pet .pet-icon {
    width: 55px;
    height: 55px;
}

.selected-pet .pet-icon img {
    width: 50px;
    height: 50px;
}

.selected-pet .pet-name {
    font-size: 0.7em;
    margin-top: 5px;
    text-align: center;
}

.empty-slot {
    width: 80px;
    height: 100px;
    /* 使用 box-shadow 替代 dashed border，完美跟随圆角 */
    border: none;
    box-shadow: 0 0 0 2px dashed #d0d0d0;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #bbb;
    font-size: 0.75em;
    background: #fafafa;
}

.empty-slot .slot-num {
    font-size: 1.2em;
    margin-bottom: 3px;
}

.slots-count {
    text-align: center;
    margin-bottom: 15px;
    font-size: 1.05em;
    color: #666;
}

.slots-count span {
    color: var(--color-primary);
    font-weight: 700;
}

.fetter-section {
    margin-top: 20px;
}

/* 羁绊区块容器 */
.fetter-box {
    background: linear-gradient(145deg, #f8f9fa, #f0f0f0);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
}

.fetter-box-title {
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.fetter-box-active .fetter-box-title {
    color: #10b981;
    border-bottom-color: #10b981;
}

.fetter-box-inactive .fetter-box-title {
    color: #9ca3af;
    border-bottom-color: #d1d5db;
}

/* 羁绊子分类（元素/种族/特性分组） */
.fetter-sub-category {
    margin-bottom: 14px;
}

.fetter-sub-category:last-child {
    margin-bottom: 0;
}

.fetter-sub-title {
    font-size: 0.9em;
    font-weight: 600;
    color: #666;
    margin-bottom: 10px;
    padding-left: 10px;
    border-left: 3px solid;
}

.fetter-sub-category:nth-child(1) .fetter-sub-title {
    border-color: #ff6b6b;
    color: #ff6b6b;
}

.fetter-sub-category:nth-child(2) .fetter-sub-title {
    border-color: #4ecdc4;
    color: #4ecdc4;
}

.fetter-sub-category:nth-child(3) .fetter-sub-title {
    border-color: #a29bfe;
    color: #a29bfe;
}

.fetter-category {
    margin-bottom: 22px;
}

.fetter-category-title {
    font-size: 1em;
    color: #555;
    margin-bottom: 12px;
    padding-left: 12px;
    border-left: 4px solid;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.fetter-category-title.element { border-color: #ff6b6b; }
.fetter-category-title.race { border-color: #4ecdc4; }
.fetter-category-title.feature { border-color: #a29bfe; }

.fetter-category-title img {
    width: 26px;
    height: 26px;
    border-radius: 6px;
}

.fetter-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.fetter-item {
    background: #ffffff;
    border-radius: 14px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* 使用 box-shadow 替代 border，完美跟随圆角 */
    border: none;
    box-shadow: 0 1px 6px rgba(0,0,0,0.02), 0 0 0 1px #e8e8e8;
    position: relative;
    overflow: hidden;
}

.fetter-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #d1d5db;
    transition: all 0.3s;
}

.fetter-item.level-1::before {
    background: linear-gradient(180deg, #10b981, #059669);
}

.fetter-item.level-2::before {
    background: linear-gradient(180deg, #3b82f6, #2563eb);
}

.fetter-item.level-3::before {
    background: linear-gradient(180deg, #8b5cf6, #7c3aed);
}

.fetter-item:hover {
    transform: translateX(6px);
    box-shadow: 0 6px 24px rgba(0,0,0,0.08), 0 0 0 1px #d0d0d0;
}

.fetter-item.level-1:hover {
    box-shadow: 0 6px 24px rgba(16, 185, 129, 0.15), 0 0 0 1px #10b981;
}

.fetter-item.level-2:hover {
    box-shadow: 0 6px 24px rgba(59, 130, 246, 0.15), 0 0 0 1px #3b82f6;
}

.fetter-item.level-3:hover {
    box-shadow: 0 6px 24px rgba(139, 92, 246, 0.2), 0 0 0 1px #8b5cf6;
}

.fetter-item.inactive {
    opacity: 0.5;
}

.fetter-item.active-highlight {
    background: linear-gradient(145deg, #f0fdf4, #dcfce7);
}

.fetter-item.level-2.active-highlight {
    background: linear-gradient(145deg, #eff6ff, #dbeafe);
}

.fetter-item.level-3.active-highlight {
    background: linear-gradient(145deg, #f5f3ff, #ede9fe);
}

.fetter-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    background: linear-gradient(145deg, #f0f0f0, #e8e8e8);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.fetter-icon img {
    width: 42px;
    height: 42px;
    object-fit: contain;
}

.fetter-info {
    flex: 1;
    min-width: 0;
}

.fetter-name {
    font-weight: 600;
    margin-bottom: 4px;
    color: #333;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.fetter-desc {
    font-size: 0.8em;
    color: #888;
    margin-bottom: 4px;
}

/* 羁绊数值突出样式 */
.fetter-value {
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8em;
    display: inline-block;
    margin-top: 4px;
}

.fetter-value.level-1 {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #065f46;
}

.fetter-value.level-2 {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1e40af;
}

.fetter-value.level-3 {
    background: linear-gradient(135deg, #ede9fe, #ddd6fe);
    color: #5b21b6;
}

/* 等级徽章 */
.fetter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 22px;
    padding: 0 8px;
    border-radius: 11px;
    font-size: 0.75em;
    font-weight: 700;
    color: white;
    vertical-align: middle;
}

.fetter-badge.level-0 {
    background: #d1d5db;
}

.fetter-badge.level-1 {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.fetter-badge.level-2 {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.fetter-badge.level-3 {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.no-fetters {
    text-align: center;
    color: #999;
    padding: 40px;
    font-size: 1em;
}

.btn-share {
    padding: 7px 16px;
    background: var(--gradient-primary);
    border: none;
    border-radius: 8px;
    color: var(--text-on-gradient);
    font-size: 0.8em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 10px var(--shadow-primary-light), 0 0 0 1px transparent;
    display: flex;
    align-items: center;
    gap: 5px;
    overflow: hidden;
}

.btn-share:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px var(--shadow-primary), 0 0 0 1px rgba(255,255,255,0.3);
}

.btn-share:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 18px var(--shadow-primary);
}

.btn-share:active {
    transform: scale(0.95);
}

.btn-share svg {
    fill: white;
}

.btn-share:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-share-icon {
    width: 34px;
    height: 34px;
    padding: 0;
    background: #f3f4f6;
    /* 使用 box-shadow 替代 border，完美跟随圆角 */
    border: none;
    box-shadow: 0 0 0 1px #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    overflow: hidden;
}

.btn-share-icon:hover {
    background: #e5e7eb;
    transform: scale(1.08);
}

.btn-share-icon:active {
    transform: scale(0.95);
}

.btn-share-icon svg {
    fill: #6b7280;
}

/* 阵容配置按钮组的分享按钮样式 */
.btn-group .header-share {
    padding: 8px 16px;
    background: var(--gradient-primary);
    border: none;
    border-radius: 10px;
    color: var(--text-on-gradient);
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 3px 12px var(--shadow-primary-light), 0 0 0 1px transparent;
    overflow: hidden;
}

.btn-group .header-share:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 18px var(--shadow-primary), 0 0 0 1px rgba(255,255,255,0.3);
}

.btn-group .header-share:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow-primary);
}

.btn-group .header-share:active {
    transform: scale(0.95);
}

.btn-group .header-share-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    background: var(--gradient-primary);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 3px 12px var(--shadow-primary-light), 0 0 0 1px transparent;
    overflow: hidden;
}

.btn-group .header-share-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 18px var(--shadow-primary), 0 0 0 1px rgba(255,255,255,0.3);
}

.btn-group .header-share-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow-primary);
}

.btn-group .header-share-icon:active {
    transform: scale(0.95);
}

.btn-group .header-share-icon svg {
    fill: white;
}

/* ===== 复合功能按钮（设置 + 分享） ===== */
.composite-btn {
    display: inline-flex;
    align-items: center;
    background: var(--gradient-primary);
    border: none;
    border-radius: 10px;
    box-shadow: 0 3px 12px var(--shadow-primary-light), 0 0 0 1px transparent;
    overflow: hidden;
    transition: all 0.25s ease;
    height: 36px;
}

.composite-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 18px var(--shadow-primary), 0 0 0 1px rgba(255,255,255,0.3);
}

.composite-btn-left,
.composite-btn-right {
    height: 100%;
    padding: 0 12px;
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.composite-btn-left {
    padding-left: 10px;
    padding-right: 10px;
    border-radius: 9px 0 0 9px;
}

.composite-btn-right {
    padding-right: 14px;
    padding-left: 12px;
    border-radius: 0 9px 9px 0;
    white-space: nowrap;
}

.composite-btn-divider {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.35);
    flex-shrink: 0;
}

.composite-btn-left:hover {
    background: rgba(255, 255, 255, 0.15);
}

.composite-btn-right:hover {
    background: rgba(255, 255, 255, 0.15);
}

.composite-btn-left:active,
.composite-btn-right:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.25);
}

.composite-btn-left svg,
.composite-btn-right svg {
    fill: white;
    flex-shrink: 0;
}

/* 左侧设置按钮点击波纹效果 */
.composite-btn-left::after,
.composite-btn-right::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease, opacity 0.4s ease;
    opacity: 0;
    pointer-events: none;
}

.composite-btn-left:active::after,
.composite-btn-right:active::after {
    width: 120px;
    height: 120px;
    opacity: 0;
}

/* 提示标签 */
.composite-btn-left[title]::before,
.composite-btn-right[title]::before {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75em;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    z-index: 100;
}

.composite-btn-left:hover[title]:hover::before,
.composite-btn-right:hover[title]:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* 模态框样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
}

.modal-overlay.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: #ffffff;
    border-radius: 18px;
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(-30px) scale(0.97);
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1), transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.show .modal-content {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid #eef0f2;
    flex-shrink: 0;
}

.modal-header h3 {
    font-size: 1.1em;
    color: #1f2937;
    margin: 0;
    font-weight: 700;
}

.modal-close {
    width: 30px;
    height: 30px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #f3f4f6;
    transform: rotate(90deg);
}

.modal-close svg {
    fill: #6b7280;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

.modal-large .modal-content {
    max-width: 550px;
}

.config-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.config-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.config-section h4 {
    font-size: 1em;
    color: #1f2937;
    margin: 0 0 12px 0;
    font-weight: 600;
}

.setting-group {
    margin-bottom: 20px;
}

.setting-group:last-child {
    margin-bottom: 0;
}

.setting-group label {
    display: block;
    font-size: 0.9em;
    font-weight: 600;
    color: #374151;
    margin-bottom: 10px;
}

.setting-group input[type="text"] {
    width: 100%;
    padding: 10px 14px;
    /* 使用 box-shadow 替代 border，完美跟随圆角 */
    border: none;
    box-shadow: 0 0 0 1px #d1d5db;
    border-radius: 8px;
    font-size: 0.9em;
    color: #1f2937;
    transition: box-shadow 0.2s;
    box-sizing: border-box;
}

.setting-group input[type="text"]:focus {
    outline: none;
    box-shadow: 0 0 0 1px var(--color-primary-light), 0 0 0 3px var(--shadow-primary-subtle);
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9em;
    color: #4b5563;
    position: relative;
    padding-left: 32px;
}

.checkbox-item input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkmark {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    /* 使用 box-shadow 替代 border，完美跟随圆角 */
    border: none;
    box-shadow: 0 0 0 2px #d1d5db;
    border-radius: 5px;
    transition: all 0.2s ease;
}

.checkbox-item:hover .checkmark {
    box-shadow: 0 0 0 2px var(--color-primary-light);
}

.checkbox-item input:checked ~ .checkmark {
    background: var(--gradient-primary);
    box-shadow: 0 0 0 2px var(--color-primary-light);
}

.checkbox-item input:checked ~ .checkmark::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* select 下拉框样式 */
.setting-group select {
    width: 100%;
    padding: 10px 14px;
    /* 使用 box-shadow 替代 border，完美跟随圆角 */
    border: none;
    box-shadow: 0 0 0 1px #d1d5db;
    border-radius: 8px;
    font-size: 0.9em;
    font-family: inherit;
    color: #374151;
    background: white;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.setting-group select:focus {
    outline: none;
    box-shadow: 0 0 0 1px var(--color-primary-light), 0 0 0 3px var(--shadow-primary-subtle);
}

/* 敌方独立网格布局（用于预览页面的敌方区域） */
.enemy-slots {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(5, 1fr);
    gap: 2px;
    padding: 2px;
}

.enemy-slots .pet-slot {
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 6px;
}

.enemy-slots .pet-slot.has-pet {
    display: flex;
    align-items: center;
    justify-content: center;
}

.enemy-slots .pet-icon-small {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.enemy-slots .pet-icon-small img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.enemy-slots .pet-level-label {
    font-size: 9px;
    color: #fff;
    background: rgba(0,0,0,0.6);
    padding: 1px 4px;
    border-radius: 3px;
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
}

/* 敌对布局样式 */
.pet-layout-container.enemy-layout {
    justify-content: center;
}

.pet-layout-container.enemy-layout .map-preview {
    width: 280px;
}

.pet-layout-container.enemy-layout .map-title {
    text-align: center;
    font-size: 0.85em;
    color: #6b7280;
    margin-bottom: 8px;
}

.pet-layout-container.enemy-layout .pet-slots {
    position: absolute;
    top: 25px;
    left: 0;
    right: 0;
    bottom: 0;
}

/*
 * 敌方跟宠布局 - 配置模态框中的右侧区域
 * 关键：容器必须叠加在右侧背景图(enemy_stand_bg.webp)上方
 * 格式：3列 x 5行 grid 布局，填满右半区域
 */
#configEnemyLayoutSlots {
    /* 继承 .pet-slots 的 absolute 定位，修正为右侧 */
    position: absolute;
    top: 0;
    left: auto;
    right: 0;
    width: 50%;
    height: 100%;

    /* 3列5行网格布局 - 紧凑规格（仅配置模态框使用） */
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(5, 1fr);
    gap: 2px;
    padding: 2px;

    /* 确保在背景图之上、分隔线之下可见 */
    z-index: 3;
}

/* 配置模态框中敌方格子基础样式（可变长方形） */
#configEnemyLayoutSlots .pet-slot {
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 6px;
}

/* 配置模态框中有宠物的敌方格子 */
#configEnemyLayoutSlots .pet-slot.has-pet {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

#configEnemyLayoutSlots .pet-slot.has-pet:hover {
    background: rgba(138, 196, 226, 0.3);
}

/* 配置模态框中敌方跟宠图标 - 白色圆形底 */
#configEnemyLayoutSlots .pet-icon-small {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

#configEnemyLayoutSlots .pet-icon-small img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

#configEnemyLayoutSlots .pet-icon-small img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid #e5e7eb;
    justify-content: flex-end;
    flex-shrink: 0;
}

.btn-cancel {
    padding: 8px 20px;
    background: #f3f4f6;
    /* 使用 box-shadow 替代 border，完美跟随圆角 */
    border: none;
    box-shadow: 0 0 0 1px #d1d5db;
    border-radius: 8px;
    color: #4b5563;
    font-size: 0.85em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    overflow: hidden;
}

.btn-cancel:hover {
    background: #e5e7eb;
}

.btn-confirm {
    padding: 8px 20px;
    background: var(--gradient-primary);
    border: none;
    border-radius: 8px;
    color: var(--text-on-gradient);
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 0 0 1px transparent;
    overflow: hidden;
}

.btn-confirm:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px var(--shadow-primary-light), 0 0 0 1px rgba(255,255,255,0.3);
}

.btn-confirm:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px var(--shadow-primary);
}

/* 跟宠布局预览样式 - 允许拖拽 */
.pet-layout-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.map-preview {
    position: relative;
    width: 100%;
    height: 200px;
    border-radius: 12px;
    overflow: hidden;
    background: #1a1a2e;
}

/* 中间分隔线 */
.map-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, transparent, rgba(255,255,255,0.5), transparent);
    z-index: 5;
    pointer-events: none;
}

/* 移动端地图预览更大高度 */
@media (max-height: 600px) {
    .map-preview {
        height: 180px;
    }
}

.map-bg {
    position: absolute;
    top: 0;
    height: 100%;
    object-fit: cover;
}

.map-left {
    left: 0;
    width: 50%;
}

.map-right {
    right: 0;
    width: 50%;
}

.pet-slots {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(5, 1fr);
    gap: 4px;
    padding: 8px;
}

.pet-slots.enemy-side {
    left: auto;
    right: 0;
    width: 50%;
    /* 敌方区域使用紧凑型网格（与 .enemy-slots 一致） */
    gap: 2px;
    padding: 2px;
}

/* 敌方区域槽位 - 对齐玩家跟宠规格（可变长方形 + 虚线圆角矩形） */
.pet-slots.enemy-side .pet-slot {
    background: transparent;
    border: 2px dashed rgba(255, 255, 255, 0.25);
    border-radius: 6px;
}

.pet-slots.enemy-side .pet-slot.empty {
    border: 2px dashed rgba(255, 255, 255, 0.25);
    background: transparent;
}

.pet-slots.enemy-side .pet-slot.has-pet {
    background: rgba(255, 255, 255, 0.85);
    border: none;
}

/* 敌方区域图标 - 白色圆形底 + 固定小尺寸 */
.pet-slots.enemy-side .pet-icon-small {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.pet-slots.enemy-side .pet-icon-small img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

/*敌方区域等级标签 */
.pet-slots.enemy-side .pet-level-label {
    font-size: 9px;
    color: #fff;
    background: rgba(0,0,0,0.6);
    padding: 1px 4px;
    border-radius: 3px;
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
}

.pet-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}

.pet-slot.empty {
    border: 2px dashed rgba(255,255,255,0.3);
}

.pet-slot.has-pet {
    background: rgba(255,255,255,0.15);
}

.pet-slot.enemy-slot.empty {
    border-color: rgba(239,68,68,0.3);
    background: rgba(239,68,68,0.1);
}

.pet-slot.enemy-slot.has-pet {
    background: rgba(239,68,68,0.15);
}

.pet-slot.enemy-slot:hover {
    background: rgba(239,68,68,0.4);
}

/* 敌方跟宠详情小窗口样式 */
.enemy-pet-detail-modal {
    max-width: 180px;
    border-radius: 12px;
    overflow: hidden;
}

/* 桌面端弹窗增大 */
@media (min-width: 768px) {
    .enemy-pet-detail-modal {
        max-width: 200px;
        max-height: 280px;
    }
    
    .enemy-pet-detail-modal .modal-header {
        padding: 10px 14px;
    }
    
    .enemy-pet-detail-modal .modal-header .pet-name {
        font-size: 16px;
    }
    
    .enemy-pet-detail-modal .modal-header .pet-level-badge {
        font-size: 12px;
        padding: 3px 8px;
    }
    
    .enemy-pet-detail-modal .modal-header .modal-close {
        width: 24px;
        height: 24px;
    }
    
    .enemy-pet-detail-modal .modal-header .modal-close svg {
        width: 14px;
        height: 14px;
    }
    
    .enemy-pet-detail-stats {
        padding: 12px 14px;
    }
    
    .enemy-pet-detail-stats .stat-grid {
        gap: 8px;
    }
    
    .enemy-pet-detail-stats .stat-item {
        padding: 6px 8px;
    }
    
    .enemy-pet-detail-stats .stat-label {
        font-size: 10px;
    }
    
    .enemy-pet-detail-stats .stat-value {
        font-size: 14px;
    }
}

.enemy-pet-detail-modal .modal-body {
    padding: 0;
}

.enemy-pet-detail-modal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: #ffffff;
    color: #333;
    border-bottom: 1px solid #e5e7eb;
}

.enemy-pet-detail-modal .modal-header .pet-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
}

.enemy-pet-detail-modal .modal-header .pet-name {
    font-size: 14px;
    font-weight: bold;
}

.enemy-pet-detail-modal .modal-header .pet-level-badge {
    font-size: 11px;
    background: #f3f4f6;
    color: #666;
    padding: 2px 6px;
    border-radius: 8px;
}

.enemy-pet-detail-modal .modal-header .modal-close {
    width: 20px;
    height: 20px;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
}

.enemy-pet-detail-modal .modal-header .modal-close:hover {
    background: #e5e7eb;
}

.enemy-pet-detail-modal .modal-header .modal-close svg {
    width: 12px;
    height: 12px;
    fill: #666;
}

.enemy-pet-detail-stats {
    padding: 8px 10px;
}

.enemy-pet-detail-stats .stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.enemy-pet-detail-stats .stat-item {
    background: #f9fafb;
    border-radius: 4px;
    padding: 4px 6px;
    text-align: center;
}

.enemy-pet-detail-stats .stat-label {
    font-size: 9px;
    color: #6b7280;
    margin-bottom: 2px;
}

.enemy-pet-detail-stats .stat-value {
    font-size: 12px;
    font-weight: bold;
    color: #1f2937;
}

.enemy-pet-detail-stats .stat-value.hp {
    color: #10b981;
}

.enemy-pet-detail-stats .stat-value.atk {
    color: #ef4444;
}

.enemy-pet-detail-stats .stat-value.def {
    color: #3b82f6;
}

.enemy-pet-detail-stats .stat-value.spd {
    color: #f59e0b;
}

/* 羁绊跟宠列表弹窗样式 */
.bond-pets-modal {
    max-width: 320px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.bond-pets-modal .modal-body {
    overflow-y: auto;
    padding: 10px;
}

.bond-pets-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.bond-pet-item {
    width: 52px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px;
    border-radius: 8px;
    background: #f9fafb;
    cursor: pointer;
    transition: all 0.15s ease;
}

.bond-pet-item:hover {
    background: #e5e7eb;
    transform: scale(1.05);
}

.bond-pet-item.selected {
    background: rgba(138, 196, 226, 0.15);
    box-shadow: 0 0 0 1px var(--color-primary-light);
}

.bond-pet-item.selected .bond-pet-icon {
    filter: grayscale(100%);
    opacity: 0.6;
}

.bond-pet-item.selected::after {
    content: '已选';
    font-size: 9px;
    color: var(--color-primary);
    font-weight: bold;
}

.bond-pet-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.bond-pet-icon img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

.bond-pet-name {
    font-size: 10px;
    color: #374151;
    text-align: center;
    max-width: 50px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bond-empty {
    text-align: center;
    padding: 20px;
    color: #9ca3af;
    font-size: 13px;
}

.pet-slot:hover {
    background: rgba(138, 196, 226, 0.4);
}

.pet-slot .pet-icon-small {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.pet-slot .pet-icon-small img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    pointer-events: none;
    -webkit-user-drag: none;
}

.pet-pool {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
    background: #f3f4f6;
    border-radius: 10px;
    min-height: 50px;
    transition: background 0.2s, border 0.2s;
    border: 2px dashed #e2e5ea;
}

.pet-pool.drag-over {
    background: #d1fae5;
    border-color: #10b981;
}

.pet-pool-item {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transition: transform 0.2s;
}

.pet-pool-item:hover {
    transform: scale(1.1);
}

.pet-pool-item:active {
    cursor: grabbing;
}

.pet-pool-item img,
.pet-slot .pet-icon-small img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    pointer-events: none;
    -webkit-user-drag: none;
}

.pet-slot .pet-icon-small img {
    width: 30px;
    height: 30px;
}

/* 移动端拖拽样式 */
.mobile-drag-ghost {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px var(--shadow-primary);
}

.mobile-drag-ghost img {
    width: 32px !important;
    height: 32px !important;
    pointer-events: none;
}

.dragging-source {
    opacity: 0.4;
    transform: scale(0.9);
}

.pet-slot.drop-target {
    background: rgba(138, 196, 226, 0.4) !important;
    border: 2px dashed var(--color-primary-light) !important;
    transform: scale(1.05);
}

/* 移动端触摸优化 */
@media (hover: none) and (pointer: coarse) {
    .pet-pool-item {
        cursor: pointer;
        -webkit-touch-callout: none;
    }
    
    .pet-pool-item:active {
        transform: scale(0.95);
    }
    
    .pet-slot {
        cursor: pointer;
    }
    
    .pet-slot:active {
        transform: scale(0.95);
    }
}

/* 羁绊区域的标题行 */
.fetter-section .section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0;
    border-bottom: none;
    margin-bottom: 15px;
}

.fetter-section .section-title-row .section-title {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.tips {
    background: linear-gradient(145deg, #fef8e7, #fef3cd);
    border-radius: 12px;
    padding: 14px 18px;
    margin-top: 18px;
    font-size: 0.85em;
    color: #92400e;
    border-left: 4px solid #f59e0b;
    line-height: 1.6;
}

.tips::before {
    content: '💡 ';
}

.fetter-stat {
    background: linear-gradient(145deg, #f8f9fa, #f0f1f3);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 18px;
    display: flex;
    justify-content: space-around;
    text-align: center;
    /* 使用 box-shadow 替代 border，完美跟随圆角 */
    border: none;
    box-shadow: 0 0 0 1px #e5e7eb;
    gap: 8px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.stat-value {
    font-size: 2em;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.8em;
    color: #888;
    margin-top: 6px;
    font-weight: 500;
}

/* 折叠按钮样式 */
.collapse-btn {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: opacity 0.2s, transform 0.15s ease;
}

.collapse-btn:hover {
    opacity: 1;
}

.collapse-btn:active {
    transform: scale(0.9);
    opacity: 0.6;
}

.collapse-btn svg {
    width: 24px;
    height: 24px;
    fill: #666;
    transition: transform 0.3s;
}

.collapse-btn.collapsed svg {
    transform: rotate(-90deg);
}

/* 折叠内容区 */
.pets-content {
    overflow: hidden;
    max-height: 2000px;
    transition: max-height 0.4s ease, opacity 0.3s ease;
    opacity: 1;
}

.pets-content.collapsed {
    max-height: 0;
    opacity: 0;
}

/* 响应式布局 - 手机端 */
@media (max-width: 900px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .selected-section {
        position: static;
        max-height: none;
        padding: 15px;
    }
    
    .section-title-row {
        flex-direction: row;
        align-items: center;
    }
    
    .section-title-row .section-title {
        font-size: 1.1em;
    }
    
    .btn-clear {
        padding: 6px 12px;
        font-size: 0.75em;
    }
    
    .selected-pets {
        justify-content: center;
    }
    
    .selected-pet, .empty-slot {
        width: calc((100% - 24px) / 3);
        max-width: 110px;
        height: auto;
        min-height: 90px;
    }
    
    .selected-pet .pet-icon {
        width: 50px;
        height: 50px;
    }
    
    .selected-pet .pet-icon img {
        width: 45px;
        height: 45px;
    }
    
    .selected-pet .pet-name {
        font-size: 0.65em;
    }
    
    .pets-section {
        padding: 15px;
    }
    
    .pets-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .pet-card {
        width: 100%;
        padding: 10px 5px;
    }
    
    .pet-card .pet-icon {
        width: 55px;
        height: 55px;
    }
    
    .pet-card .pet-icon img {
        width: 48px;
        height: 48px;
    }
    
    .pet-card .pet-name {
        font-size: 0.8em;
    }

    .pet-card .bond-mini-icon {
        width: 14px;
        height: 14px;
    }

    /* 手机端折叠按钮样式 */
    .collapse-btn {
        display: flex;
    }
}

/* --- 复合功能按钮 --- */
/* ===== 复合功能按钮（设置 + 分享） ===== */
.composite-btn {
    display: inline-flex;
    align-items: center;
    background: var(--gradient-primary);
    border: none;
    border-radius: 10px;
    box-shadow: 0 3px 12px var(--shadow-primary-light), 0 0 0 1px transparent;
    overflow: hidden;
    transition: all 0.25s ease;
    height: 36px;
}

.composite-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 18px var(--shadow-primary), 0 0 0 1px rgba(255,255,255,0.3);
}

.composite-btn-left,
.composite-btn-right {
    height: 100%;
    padding: 0 12px;
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.composite-btn-left {
    padding-left: 10px;
    padding-right: 10px;
    border-radius: 9px 0 0 9px;
}

.composite-btn-right {
    padding-right: 14px;
    padding-left: 12px;
    border-radius: 0 9px 9px 0;
    white-space: nowrap;
}

.composite-btn-divider {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.35);
    flex-shrink: 0;
}

.composite-btn-left:hover {
    background: rgba(255, 255, 255, 0.15);
}

.composite-btn-right:hover {
    background: rgba(255, 255, 255, 0.15);
}

.composite-btn-left:active,
.composite-btn-right:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.25);
}

.composite-btn-left svg,
.composite-btn-right svg {
    fill: white;
    flex-shrink: 0;
}

/* 左侧设置按钮点击波纹效果 */
.composite-btn-left::after,
.composite-btn-right::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease, opacity 0.4s ease;
    opacity: 0;
    pointer-events: none;
}

.composite-btn-left:active::after,
.composite-btn-right:active::after {
    width: 120px;
    height: 120px;
    opacity: 0;
}

/* 提示标签 */
.composite-btn-left[title]::before,
.composite-btn-right[title]::before {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75em;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    z-index: 100;
}

.composite-btn-left:hover[title]:hover::before,
.composite-btn-right:hover[title]:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* --- 敌方跟宠布局样式 --- */
/* 敌方独立网格布局（用于预览页面的敌方区域） */
.enemy-slots {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(5, 1fr);
    gap: 2px;
    padding: 2px;
}

.enemy-slots .pet-slot {
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 6px;
}

.enemy-slots .pet-slot.has-pet {
    display: flex;
    align-items: center;
    justify-content: center;
}

.enemy-slots .pet-icon-small {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.enemy-slots .pet-icon-small img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.enemy-slots .pet-level-label {
    font-size: 9px;
    color: #fff;
    background: rgba(0,0,0,0.6);
    padding: 1px 4px;
    border-radius: 3px;
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
}

/* 敌对布局样式 */
.pet-layout-container.enemy-layout {
    justify-content: center;
}

.pet-layout-container.enemy-layout .map-preview {
    width: 280px;
}

.pet-layout-container.enemy-layout .map-title {
    text-align: center;
    font-size: 0.85em;
    color: #6b7280;
    margin-bottom: 8px;
}

.pet-layout-container.enemy-layout .pet-slots {
    position: absolute;
    top: 25px;
    left: 0;
    right: 0;
    bottom: 0;
}

/*
 * 敌方跟宠布局 - 配置模态框中的右侧区域
 * 关键：容器必须叠加在右侧背景图(enemy_stand_bg.webp)上方
 * 格式：3列 x 5行 grid 布局，填满右半区域
 */
#configEnemyLayoutSlots {
    /* 继承 .pet-slots 的 absolute 定位，修正为右侧 */
    position: absolute;
    top: 0;
    left: auto;
    right: 0;
    width: 50%;
    height: 100%;

    /* 3列5行网格布局 - 紧凑规格（仅配置模态框使用） */
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(5, 1fr);
    gap: 2px;
    padding: 2px;

    /* 确保在背景图之上、分隔线之下可见 */
    z-index: 3;
}

/* 配置模态框中敌方格子基础样式（可变长方形） */
#configEnemyLayoutSlots .pet-slot {
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 6px;
}

/* 配置模态框中有宠物的敌方格子 */
#configEnemyLayoutSlots .pet-slot.has-pet {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

#configEnemyLayoutSlots .pet-slot.has-pet:hover {
    background: rgba(138, 196, 226, 0.3);
}

/* 配置模态框中敌方跟宠图标 - 白色圆形底 */
#configEnemyLayoutSlots .pet-icon-small {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

#configEnemyLayoutSlots .pet-icon-small img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

#configEnemyLayoutSlots .pet-icon-small img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* --- 跟宠布局预览与拖拽交互 --- */
/* 跟宠布局预览样式 - 允许拖拽 */
.pet-layout-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.map-preview {
    position: relative;
    width: 100%;
    height: 200px;
    border-radius: 12px;
    overflow: hidden;
    background: #1a1a2e;
}

/* 中间分隔线 */
.map-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, transparent, rgba(255,255,255,0.5), transparent);
    z-index: 5;
    pointer-events: none;
}

/* 移动端地图预览更大高度 */
@media (max-height: 600px) {
    .map-preview {
        height: 180px;
    }
}

.map-bg {
    position: absolute;
    top: 0;
    height: 100%;
    object-fit: cover;
}

.map-left {
    left: 0;
    width: 50%;
}

.map-right {
    right: 0;
    width: 50%;
}

.pet-slots {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(5, 1fr);
    gap: 4px;
    padding: 8px;
}

.pet-slots.enemy-side {
    left: auto;
    right: 0;
    width: 50%;
    /* 敌方区域使用紧凑型网格（与 .enemy-slots 一致） */
    gap: 2px;
    padding: 2px;
}

/* 敌方区域槽位 - 对齐玩家跟宠规格（可变长方形 + 虚线圆角矩形） */
.pet-slots.enemy-side .pet-slot {
    background: transparent;
    border: 2px dashed rgba(255, 255, 255, 0.25);
    border-radius: 6px;
}

.pet-slots.enemy-side .pet-slot.empty {
    border: 2px dashed rgba(255, 255, 255, 0.25);
    background: transparent;
}

.pet-slots.enemy-side .pet-slot.has-pet {
    background: rgba(255, 255, 255, 0.85);
    border: none;
}

/* 敌方区域图标 - 白色圆形底 + 固定小尺寸 */
.pet-slots.enemy-side .pet-icon-small {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.pet-slots.enemy-side .pet-icon-small img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

/*敌方区域等级标签 */
.pet-slots.enemy-side .pet-level-label {
    font-size: 9px;
    color: #fff;
    background: rgba(0,0,0,0.6);
    padding: 1px 4px;
    border-radius: 3px;
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
}

.pet-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}

.pet-slot.empty {
    border: 2px dashed rgba(255,255,255,0.3);
}

.pet-slot.has-pet {
    background: rgba(255,255,255,0.15);
}

.pet-slot.enemy-slot.empty {
    border-color: rgba(239,68,68,0.3);
    background: rgba(239,68,68,0.1);
}

.pet-slot.enemy-slot.has-pet {
    background: rgba(239,68,68,0.15);
}

.pet-slot.enemy-slot:hover {
    background: rgba(239,68,68,0.4);
}

/* 敌方跟宠详情小窗口样式 */
.enemy-pet-detail-modal {
    max-width: 180px;
    border-radius: 12px;
    overflow: hidden;
}

/* 桌面端弹窗增大 */
@media (min-width: 768px) {
    .enemy-pet-detail-modal {
        max-width: 200px;
        max-height: 280px;
    }
    
    .enemy-pet-detail-modal .modal-header {
        padding: 10px 14px;
    }
    
    .enemy-pet-detail-modal .modal-header .pet-name {
        font-size: 16px;
    }
    
    .enemy-pet-detail-modal .modal-header .pet-level-badge {
        font-size: 12px;
        padding: 3px 8px;
    }
    
    .enemy-pet-detail-modal .modal-header .modal-close {
        width: 24px;
        height: 24px;
    }
    
    .enemy-pet-detail-modal .modal-header .modal-close svg {
        width: 14px;
        height: 14px;
    }
    
    .enemy-pet-detail-stats {
        padding: 12px 14px;
    }
    
    .enemy-pet-detail-stats .stat-grid {
        gap: 8px;
    }
    
    .enemy-pet-detail-stats .stat-item {
        padding: 6px 8px;
    }
    
    .enemy-pet-detail-stats .stat-label {
        font-size: 10px;
    }
    
    .enemy-pet-detail-stats .stat-value {
        font-size: 14px;
    }
}

.enemy-pet-detail-modal .modal-body {
    padding: 0;
}

.enemy-pet-detail-modal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: #ffffff;
    color: #333;
    border-bottom: 1px solid #e5e7eb;
}

.enemy-pet-detail-modal .modal-header .pet-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
}

.enemy-pet-detail-modal .modal-header .pet-name {
    font-size: 14px;
    font-weight: bold;
}

.enemy-pet-detail-modal .modal-header .pet-level-badge {
    font-size: 11px;
    background: #f3f4f6;
    color: #666;
    padding: 2px 6px;
    border-radius: 8px;
}

.enemy-pet-detail-modal .modal-header .modal-close {
    width: 20px;
    height: 20px;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
}

.enemy-pet-detail-modal .modal-header .modal-close:hover {
    background: #e5e7eb;
}

.enemy-pet-detail-modal .modal-header .modal-close svg {
    width: 12px;
    height: 12px;
    fill: #666;
}

.enemy-pet-detail-stats {
    padding: 8px 10px;
}

.enemy-pet-detail-stats .stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.enemy-pet-detail-stats .stat-item {
    background: #f9fafb;
    border-radius: 4px;
    padding: 4px 6px;
    text-align: center;
}

.enemy-pet-detail-stats .stat-label {
    font-size: 9px;
    color: #6b7280;
    margin-bottom: 2px;
}

.enemy-pet-detail-stats .stat-value {
    font-size: 12px;
    font-weight: bold;
    color: #1f2937;
}

.enemy-pet-detail-stats .stat-value.hp {
    color: #10b981;
}

.enemy-pet-detail-stats .stat-value.atk {
    color: #ef4444;
}

.enemy-pet-detail-stats .stat-value.def {
    color: #3b82f6;
}

.enemy-pet-detail-stats .stat-value.spd {
    color: #f59e0b;
}

/* 羁绊跟宠列表弹窗样式 */
.bond-pets-modal {
    max-width: 320px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.bond-pets-modal .modal-body {
    overflow-y: auto;
    padding: 10px;
}

.bond-pets-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.bond-pet-item {
    width: 52px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px;
    border-radius: 8px;
    background: #f9fafb;
    cursor: pointer;
    transition: all 0.15s ease;
}

.bond-pet-item:hover {
    background: #e5e7eb;
    transform: scale(1.05);
}

.bond-pet-item.selected {
    background: rgba(138, 196, 226, 0.15);
    box-shadow: 0 0 0 1px var(--color-primary-light);
}

.bond-pet-item.selected .bond-pet-icon {
    filter: grayscale(100%);
    opacity: 0.6;
}

.bond-pet-item.selected::after {
    content: '已选';
    font-size: 9px;
    color: var(--color-primary);
    font-weight: bold;
}

.bond-pet-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.bond-pet-icon img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

.bond-pet-name {
    font-size: 10px;
    color: #374151;
    text-align: center;
    max-width: 50px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bond-empty {
    text-align: center;
    padding: 20px;
    color: #9ca3af;
    font-size: 13px;
}

.pet-slot:hover {
    background: rgba(138, 196, 226, 0.4);
}

.pet-slot .pet-icon-small {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.pet-slot .pet-icon-small img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    pointer-events: none;
    -webkit-user-drag: none;
}

.pet-pool {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
    background: #f3f4f6;
    border-radius: 10px;
    min-height: 50px;
    transition: background 0.2s, border 0.2s;
    border: 2px dashed #e2e5ea;
}

.pet-pool.drag-over {
    background: #d1fae5;
    border-color: #10b981;
}

.pet-pool-item {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transition: transform 0.2s;
}

.pet-pool-item:hover {
    transform: scale(1.1);
}

.pet-pool-item:active {
    cursor: grabbing;
}

.pet-pool-item img,
.pet-slot .pet-icon-small img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    pointer-events: none;
    -webkit-user-drag: none;
}

.pet-slot .pet-icon-small img {
    width: 30px;
    height: 30px;
}

/* 移动端拖拽样式 */
.mobile-drag-ghost {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px var(--shadow-primary);
}

.mobile-drag-ghost img {
    width: 32px !important;
    height: 32px !important;
    pointer-events: none;
}

.dragging-source {
    opacity: 0.4;
    transform: scale(0.9);
}

.pet-slot.drop-target {
    background: rgba(138, 196, 226, 0.4) !important;
    border: 2px dashed var(--color-primary-light) !important;
    transform: scale(1.05);
}

/* 移动端触摸优化 */
@media (hover: none) and (pointer: coarse) {
    .pet-pool-item {
        cursor: pointer;
        -webkit-touch-callout: none;
    }
    
    .pet-pool-item:active {
        transform: scale(0.95);
    }
    
    .pet-slot {
        cursor: pointer;
    }
    
    .pet-slot:active {
        transform: scale(0.95);
    }
}

/* --- 玩家跟宠数值输入界面 --- */
/* ===== 玩家跟宠数值输入界面样式 ===== */
.player-pet-stats-container {
    display: flex;
    gap: 16px;
    min-height: 280px;
}

/* 左侧导航栏 */
.player-pet-nav {
    width: 70px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 12px;
    /* 使用 box-shadow 替代 border，完美跟随圆角 */
    border: none;
    box-shadow: 0 0 0 1px #e5e7eb;
}

.player-pet-nav-item {
    width: 54px;
    height: 54px;
    border-radius: 10px;
    background: white;
    /* 使用 box-shadow 替代 transparent border */
    border: none;
    box-shadow: 0 0 0 2px transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.player-pet-nav-item:hover {
    transform: scale(1.05);
    box-shadow: 0 0 0 2px var(--color-primary-light);
}

.player-pet-nav-item.active {
    box-shadow: 0 0 0 2px var(--color-primary-light);
    background: rgba(138, 196, 226, 0.1);
}

.player-pet-nav-item.empty {
    background: #f3f4f6;
    border: 2px dashed #d1d5db;
    cursor: default;
}

.player-pet-nav-item.empty:hover {
    transform: none;
    border-color: #d1d5db;
}

.player-pet-nav-item img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: contain;
}

.player-pet-nav-item .slot-number {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: var(--color-primary);
    color: white;
    font-size: 9px;
    font-weight: bold;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-pet-nav-item.empty .slot-number {
    background: #9ca3af;
}

/* 右侧数值编辑面板 */
.player-pet-stats-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.stats-empty-hint {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9fafb;
    border-radius: 12px;
    /* 使用 box-shadow 替代 dashed border */
    border: none;
    box-shadow: 0 0 0 1px dashed #e5e7eb;
}

.stats-empty-hint p {
    color: #9ca3af;
    font-size: 13px;
}

.stats-edit-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fafafa;
    border-radius: 12px;
    /* 使用 box-shadow 替代 border，完美跟随圆角 */
    border: none;
    box-shadow: 0 0 0 1px #e5e7eb;
    padding: 12px;
}

/* 跟宠头部信息 */
.stats-pet-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 12px;
}

.stats-pet-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    background: white;
    /* 使用 box-shadow 替代 border，完美跟随圆角 */
    border: none;
    box-shadow: 0 0 0 2px #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.stats-pet-icon img {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.stats-pet-info {
    flex: 1;
}

.stats-pet-name {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.hb-pet-trait {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-on-gradient);
    background: var(--gradient-primary);
    padding: 1px 8px;
    border-radius: 8px;
    white-space: nowrap;
}

.hb-pet-fetters {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #f9fafb;
    border-radius: 10px;
    margin-bottom: 2px;
}

.hb-pet-evolution-item {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.hb-pet-evolution-icon {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    object-fit: contain;
}

.hb-pet-evolution-name {
    font-size: 11px;
    color: #374151;
    font-weight: 500;
    white-space: nowrap;
}

.hb-pet-fetters-right {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.hb-pet-fetter-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.hb-pet-fetter-icon {
    width: 26px;
    height: 26px;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s;
}

.hb-pet-fetter-icon:hover {
    transform: scale(1.25);
}

.hb-fetters-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 8px 0;
}

.hb-pet-fetter-name {
    font-size: 9px;
    color: #9ca3af;
    white-space: nowrap;
    line-height: 1;
}

.stats-pet-level {
    font-size: 12px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 6px;
}

.stats-pet-level input {
    width: 55px;
    padding: 3px 6px;
    /* 使用 box-shadow 替代 border，完美跟随圆角 */
    border: none;
    box-shadow: 0 0 0 1px #d1d5db;
    border-radius: 4px;
    font-size: 12px;
    text-align: center;
    color: #374151;
}

.stats-pet-level input:focus {
    outline: none;
    box-shadow: 0 0 0 1px var(--color-primary-light);
}

/* 数值项容器 */
.stats-items {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* 单个数值项 */
.stats-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    background: white;
    border-radius: 8px;
    /* 使用 box-shadow 替代 border，完美跟随圆角 */
    border: none;
    box-shadow: 0 0 0 1px #e5e7eb;
}

.stats-item-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stats-item-icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.stats-item-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.stats-item-label {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
    flex-shrink: 0;
    min-width: 24px;
}

.stats-item-value {
    width: 42px;
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: color 0.15s ease, transform 0.15s ease;
    border-radius: 4px;
    padding: 2px 4px;
}

.stats-item-value:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.stats-item-value:active {
    transform: scale(0.95);
}

.stats-item-bar {
    flex: 1;
    display: flex;
    gap: 4px;
    height: 18px;
}

.bar-segment {
    width: 16px;
    height: 100%;
    background-image: url('/%E7%8E%A9%E5%AE%B6%E8%B7%9F%E5%AE%A0%E9%9D%A2%E6%9D%BF/%E7%A9%BA%E8%BF%9B%E5%BA%A6%E6%9D%A1.webp');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    cursor: pointer;
    transition: transform 0.1s;
    border-radius: 2px;
    flex-shrink: 0;
}

.bar-segment:hover {
    transform: scaleY(1.1);
}

.bar-segment.filled {
    background-image: url('/%E7%8E%A9%E5%AE%B6%E8%B7%9F%E5%AE%A0%E9%9D%A2%E6%9D%BF/%E5%AE%9E%E8%BF%9B%E5%BA%A6%E6%9D%A1.webp');
}

/* 响应式调整 */
@media (max-width: 500px) {
    .player-pet-stats-container {
        flex-direction: column;
    }

    .player-pet-nav {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }

    .player-pet-nav-item {
        width: 48px;
        height: 48px;
    }

    .player-pet-nav-item img {
        width: 36px;
        height: 36px;
    }
}