* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, sans-serif;
}

body {
    background: #f6f6f6;
}

.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.small-card {
    width: 100%;
    padding: 16px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
    cursor: pointer;
    transition: .2s;
}

.small-card:hover {
    transform: translateY(-4px);
}

.avatar {
    width: 130px;
    height: 130px;
    border-radius: 16px;
    object-fit: cover;
    background: #fff;
    display: block;
}

.avatar-box {
    border-radius: 18px;
    padding: 5px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, .15);
    width: fit-content;
    margin: 0 auto 12px;
}

.pet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    justify-content: center;
}

.element {
    padding: 4px 12px;
    border-radius: 16px;
    color: #fff;
    font-size: 14px;
}

.element-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  vertical-align: middle;
}

.title-center {
    text-align: center;
    margin-bottom: 16px;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 24px;
}

.filter-btn {
    padding: 8px 16px;
    border-radius: 20px;
    border: none;
    background: #f1f1f1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.filter-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.filter-btn:hover {
  filter: brightness(1.15);
  transform: scale(1.04);
}

.back-btn {
    padding: 8px 16px;
    border-radius: 12px;
    border: none;
    background: #333;
    color: #fff;
    cursor: pointer;
    margin-bottom: 20px;
    display: inline-block;
    text-decoration: none;
}

.detail-card {
    background: #1a1a1d;
    color: #fff;
    padding: 36px;
    border-radius: 20px;
    max-width: 860px;
    margin: 0 auto;
    width: 100%;
}

.pet-layout {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    width: 100%;
}

.small-card h3 {
  text-align: center;
  width: 100%;
  margin: 8px 0 4px;
}

.left-section {
    flex: 1;
    min-width: 0; /* 🔥 核心修复：让左侧可以正常缩小 */
    width: 100%;
}

.right-section {
    flex: 1;
    min-width: 0; /* 🔥 核心修复：让右侧可以正常拉伸填满 */
    width: 100%;
}

.right-section h3 {
    width: 100%;
    font-size: 18px;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid #444;
}

.middle-section {
  margin-top: 30px;
  width: 100%;
}

.middle-section h3 {
    width: 100%;
    font-size: 18px;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid #444;
}

.stat-grid {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    min-width: 0;
}

.stat {
    background: #2a2a2e;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    width: 100%;
}

.name-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 12px 0;
}

.pet-name {
    font-size: 24px;
}

.trait-box {
    background: #2a2a2e;
    padding: 12px;
    border-radius: 10px;
    width: 100%;
    text-align: left;
    align-items: center;
}

.trait-name {
    font-weight: bold;
    font-size: 16px;
}

.trait-desc {
    font-size: 14px;
    color: #ccc;
    margin-top: 4px;
}

.trait-icon {
  width: 70px;
  height: 70px;
  object-fit: contain;
  vertical-align: middle;
}

.skill-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
    width: 100%;
}

.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
}

.skill-item {
    background: #2a2a2e;
    padding: 12px;
    border-radius: 8px;
    width: 100%;
    min-width: 0;
}

.skill-name {
    font-weight: bold;
    font-size: 15px;
}

.skill-icon {
  width: 50px;
  height: 50px;
  object-fit: contain;
  vertical-align: middle;
}

.skill-desc {
    font-size: 12px;
    color: #ccc;
    margin-top: 4px;
}

@media (max-width: 768px) {
    .pet-layout {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .stat-grid {
        grid-template-columns: 1fr 1fr; /* 保持两列，不变成一列 */
        width: 100%;
    }

    .detail-card {
        padding: 20px;
        width: 100%;
    }

    .left-section,
    .right-section {
        width: 100%;
    }

    .skills-grid {
        grid-template-columns: 1fr; /* 小屏幕下技能列表改为单列 */
    }
}