/* ====================================== */
/* 全局基础样式 */
/* ====================================== */
* {
    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;
}

/* ====================================== */
/* 顶部导航栏（左侧标题 + 右侧菜单） */
/* ====================================== */
.top-bar {
    display: flex;
    justify-content: space-between; /* 左右分开 */
    align-items: center;
    padding: 14px 30px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    position: sticky; /* 顶部悬浮 */
    top: 0;
    z-index: 99;
}

.top-bar h1 {
    font-size: 22px;
    margin: 0;
}

/* 顶部右侧菜单 */
.top-menu {
    display: flex;
    align-items: center;
    gap: 16px;
}

.top-menu-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: #fff;
  border: 2px solid #1976d2;
  color: #1976d2;
  border-radius: 10px;
  font-weight: bold;
  font-size: 15px;
  cursor: pointer;
  white-space: nowrap;
}
.top-menu-btn:hover {
  background: #f0f7ff;
}

.menu-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

/* ====================================== */
/* 主页内容区域 */
/* ====================================== */
.content {
    flex: 1;
    padding: 20px;
    overflow: auto;
}

/* ====================================== */
/* 宠物卡片样式 */
/* ====================================== */
.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;
}

/* 卡片标题 */
.small-card h3 {
    text-align: center;
    width: 100%;
    margin: 4px 0 4px;
}

/* 卡片编号 */
.small-card h4 {
    font-size: 14px;
    color: #666;
    text-align: center;
    width: 100%;
}

/* ====================================== */
/* 属性标签样式 */
/* ====================================== */
.element {
    padding: 4px 12px;
    border-radius: 16px;
    color: #fff;
    font-size: 14px;
}

.element-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    vertical-align: middle;
}

/* ====================================== */
/* 筛选栏样式 */
/* ====================================== */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 24px;
}

.filter-btn {
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 20px;
    border: none;
    background: #f1f1f1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.filter-btn.active {
  filter: brightness(1.2);
  transform: scale(1.08);
  box-shadow: 0 0 12px currentColor;
}

.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: 960px;
    margin: 0 auto;
    width: 100%;
}

/* 详情页布局：左右分栏 */
.pet-layout {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    width: 100%;
}

.left-section {
    flex: 1;
    min-width: 0;
    width: 100%;
}

.right-section {
    flex: 1;
    min-width: 0;
    width: 100%;
}

.left-section h3,
.right-section h3,
.middle-section h3 {
    width: 100%;
    font-size: 18px;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid #444;
}

/* ====================================== */
/* 宠物名称 + 属性行 */
/* ====================================== */
.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;
}

/* ====================================== */
/* 种族值 3D 雷达图 */
/* ====================================== */
.stat-radar-3d {
    position: relative;
    width: 100%;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2a2a2e;
    border-radius: 20px;
    margin-bottom: 20px;
}

/* 六边形网格线 */
.radar-grid {
    position: absolute;
    width: 150px;
    height: 150px;
    background: repeating-conic-gradient(#8b8b8b 0 1deg, transparent 1deg 60deg);
    -webkit-mask: radial-gradient(circle 1px, transparent 99%, #fff 100%);
    mask: radial-gradient(circle 1px, transparent 99%, #fff 100%);
    border-radius: 50%;
    border: 2px solid #8b8b8b;
    z-index: 1;
}

/* 蓝色属性覆盖区域 */
.radar-area {
    position: absolute;
    width: 120px;
    height: 120px;
    clip-path: polygon(
        50% calc(50% - var(--hp)),
        calc(50% + var(--mat)*0.866) calc(50% - var(--mat)*0.5),
        calc(50% + var(--mdf)*0.866) calc(50% + var(--mdf)*0.5),
        50% calc(50% + var(--spd)),
        calc(50% - var(--def)*0.866) calc(50% + var(--def)*0.5),
        calc(50% - var(--atk)*0.866) calc(50% - var(--atk)*0.5)
    );
    background: #4a9eff;
    opacity: 0.6;
    z-index: 2;
}

/* 雷达图标注（血量、攻击等） */
.radar-label {
    position: absolute;
    font-size: 14px;
    color: #dddddd;
    font-weight: 500;
    z-index: 3;
    transform: translate(-50%, -50%);
    white-space: nowrap;
    width: max-content;
}

.label-hp  { top: 7.5%; left: 50%; }
.label-mat { top: 27.5%; left: 72.5%; }
.label-mdf { top: 72.5%; left: 72.5%; }
.label-spd { top: 92.5%; left: 50%; }
.label-def { top: 72.5%; left: 27.5%; }
.label-atk { top: 27.5%; left: 27.5%; }

/* 种族值下方数字长条 */
.stat-numbers-bar {
    background: #2a2a2e;
    padding: 10px 12px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 13px;
    color: #eee;
}

/* ====================================== */
/* 技能列表样式 */
/* ====================================== */
.middle-section {
    margin-top: 30px;
    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;
}

/* ====================================== */
/* 属性克制页面专用样式 */
/* ====================================== */
.weakness-layout {
  display: flex;
  width: 100%;
  min-height: 80vh;
  border-radius: 20px;
  overflow: hidden;
}

/* 左侧 30% */
.weakness-left {
  width: 30%;
  background: #1a1a1d;
  color: #fff;
  padding: 20px;
  border-right: 2px solid #333;
  padding: 20px;
  box-sizing: border-box;
}

/* 右侧 70% */
.weakness-right {
  width: 70%;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 20px;
  box-sizing: border-box;
}


/* 进攻/防守切换 */
.mode-bar {
  margin: 16px 0;
}
.mode-btn {
  padding: 8px 16px;
  margin: 0 4px;
  border-radius: 8px;
  border: 1px solid #666;
  background: #2a2a2e;
  color: #fff;
  cursor: pointer;
}
.mode-btn.active {
  background: #ff9f43;
}

/* 克制说明 */
.legend {
  position: absolute;
  top: 10px;
  left: 15px;
  display: flex;
  gap: 14px;
  font-size: 14px;
  color: #e5e5e5;
  z-index: 10;
  border: 1px solid #666;
  padding: 4px 8px;
  border-radius: 8px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.line {
  width: 16px;
  height: 3px;
  border-radius: 2px;
}
.line.very {
  background: #ff4444;
}
.line.not {
  background: #33bb55;
}

/* 环形布局容器 */
.circle-wrap {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  position: relative;
  flex-shrink: 0;
}
.circle-center {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 80px;
  height: 80px;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.center-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.circle-item {
  position: absolute;
  width: 70px;
  height: 70px;
  transform: translate(-50%, -50%);
}

/* 箭头线条基础样式 */
.arrow {
  position: absolute;
  width: 2px;
}

/* 克制箭头：红色 */
.arrow.very-effective {
  background: #ff5252;
}
/* 抵抗箭头：绿色 */
.arrow.not-effective {
  background: #4cd964;
}

/* 箭头三角（统一样式） */
.arrow-head {
  position: absolute;
  top: 0;
  left: -4px;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
}
/* 红色箭头头 */
.arrow-head.very-effective {
  border-top: 10px solid #ff5252;
}
/* 绿色箭头头 */
.arrow-head.not-effective {
  border-top: 10px solid #4cd964;
}

/* ====================================== */
/* 底部版权信息 */
/* ====================================== */
.footer {
    text-align: left;
    padding: 20px;
    color: #4a4a4a;
    margin-top: 40px;
    font-size: 14px;
}


/* ====================================== */
/* 移动端响应式适配 */
/* ====================================== */
@media (max-width: 768px) {
    .pet-layout {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .detail-card {
        padding: 20px;
    }

    .left-section,
    .right-section {
        width: 100%;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }

    .weakness-layout {
    flex-direction: column;
    min-height: unset;
    }

    .weakness-left,
    .weakness-right {
        width: 100%;
    }
}