/* ========== 基础样式 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 30%, #a5d6a7 60%, #81c784 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ========== 顶部标题栏 ========== */
.header {
    background: linear-gradient(180deg, #2e7d32 0%, #43a047 50%, #66bb6a 100%);
    padding: 30px 20px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 10;
}

.header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(180deg, #66bb6a 0%, #a5d6a7 100%);
    clip-path: polygon(0 0, 5% 100%, 10% 0, 15% 100%, 20% 0, 25% 100%, 30% 0, 35% 100%, 40% 0, 45% 100%, 50% 0, 55% 100%, 60% 0, 65% 100%, 70% 0, 75% 100%, 80% 0, 85% 100%, 90% 0, 95% 100%, 100% 0);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-size: 2.8em;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: 4px;
}

.subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1em;
    margin-top: 8px;
}

/* ========== 公园容器 ========== */
.park-container {
    max-width: 1100px;
    margin: 30px auto;
    padding: 0 20px;
}

/* ========== 公园地图 ========== */
.park-map {
    position: relative;
    width: 100%;
    aspect-ratio: 1000 / 650;
    max-height: 1024px;
    background: linear-gradient(135deg, #7cb342 0%, #8bc34a 30%, #9ccc65 60%, #aed581 100%);
    border-radius: 24px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2), inset 0 2px 10px rgba(255, 255, 255, 0.3);
    overflow: hidden;
    display: grid;
    grid-template-columns: 20% 30% 30% 20%;
    grid-template-rows: 30% 30% 35% 35%;
}

/* ========== 地图分块 ========== */
.map-section {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    padding: 8px;
    z-index: 5;
}

.top-left     { grid-column: 1/2; grid-row: 1/2; }
.top-center   { grid-column: 2/4; grid-row: 1/2; }
.top-right    { grid-column: 4/5; grid-row: 1/2; flex-direction: column; gap: 4px; padding: 6px; }
.middle-left  { grid-column: 1/2; grid-row: 2/3; }
.middle-center { grid-column: 2/4; grid-row: 2/3; }
.middle-right { grid-column: 4/5; grid-row: 2/3; }
.bottom-left  { grid-column: 1/3; grid-row: 3/4; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 6px; align-content: center; justify-items: center; }
.bottom-left .enclosure { width: 92%; height: 92%; margin: 0; }
.bottom-left .enclosure.active.large { grid-column: 1 / 3; grid-row: 1 / 2; width: 96%; height: 100%; }
.bottom-left .enclosure[data-animal="hippo"],
.bottom-left .enclosure[data-animal="otter"] { grid-row: 2 / 3; width: 92%; height: 92%; }
.bottom-center { grid-column: 3/4; grid-row: 3/5; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 6px; padding: 8px; align-content: center; justify-items: center; }
.bottom-center .enclosure,
.bottom-center .food-court,
.bottom-center .gift-shop {
    width: 92%;
    height: 92%;
    margin-top: 0;
}
.bottom-right { grid-column: 4/5; grid-row: 3/4; }

/* ========== 动物馆样式 ========== */
.enclosure {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 90%;
    height: 48%;
    border-radius: 16px;
    text-decoration: none;
    position: relative;
    z-index: 10;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

/* 已开放的动物馆 */
.enclosure.active {
    background: linear-gradient(145deg, #fff9c4 0%, #fff176 40%, #ffee58 100%);
    border: 3px solid #f9a825;
    box-shadow: 0 4px 15px rgba(249, 168, 37, 0.5),
                0 0 30px rgba(255, 235, 59, 0.3);
    animation: pulse-glow 2s ease-in-out infinite;
}

.enclosure.active.large {
    width: 90%;
    height: 70%;
}

.enclosure-glow {
    position: absolute;
    inset: -6px;
    border-radius: 20px;
    background: transparent;
    border: 2px dashed rgba(249, 168, 37, 0.6);
    animation: rotate-glow 8s linear infinite;
    pointer-events: none;
}

@keyframes rotate-glow {
    0% { transform: rotate(0deg); clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%); }
    100% { transform: rotate(0deg); clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%); }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 4px 15px rgba(249, 168, 37, 0.5), 0 0 30px rgba(255, 235, 59, 0.3); }
    50% { box-shadow: 0 4px 20px rgba(249, 168, 37, 0.7), 0 0 50px rgba(255, 235, 59, 0.5); }
}

.enclosure.active:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 30px rgba(249, 168, 37, 0.8), 0 0 60px rgba(255, 235, 59, 0.6);
    z-index: 20;
}

/* 未开放的动物馆 */
.enclosure.locked {
    background: linear-gradient(145deg, #cfd8dc 0%, #b0bec5 50%, #90a4ae 100%);
    border: 2px dashed #78909c;
    cursor: not-allowed;
    opacity: 0.7;
}

.enclosure.locked .enclosure-icon {
    filter: grayscale(1);
}

.enclosure.locked .enclosure-name {
    color: #607d8b;
}

.enclosure-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 1em;
    z-index: 10;
}

.enclosure-icon {
    font-size: 2em;
    margin-bottom: 2px;
    transition: transform 0.3s;
}

.enclosure.active:hover .enclosure-icon {
    transform: scale(1.15) rotate(-5deg);
}

.enclosure-name {
    font-size: 0.8em;
    font-weight: bold;
    color: #5d4037;
    margin-bottom: 2px;
}

.enclosure-status {
    font-size: 0.7em;
    color: #999;
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 10px;
    border-radius: 10px;
}

.enclosure-tag {
    font-size: 0.65em;
    color: #e65100;
    background: rgba(255, 152, 0, 0.2);
    padding: 2px 8px;
    border-radius: 12px;
    white-space: nowrap;
    animation: tag-bounce 1.5s ease-in-out infinite;
}

@keyframes tag-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* ========== 入口 ========== */
.park-entrance {
    background: linear-gradient(145deg, #ffcc80 0%, #ffab40 100%);
    border: 2px solid #e65100;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 75%;
    height: 60%;
    color: #bf360c;
    font-weight: bold;
    font-size: 0.85em;
}

.entrance-icon {
    font-size: 2em;
    margin-bottom: 2px;
}

/* ========== 游客中心 ========== */
.visitor-center {
    background: linear-gradient(145deg, #ffe0b2 0%, #ffcc80 100%);
    border: 2px solid #ff9800;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 35%;
    height: 55%;
    color: #e65100;
    font-weight: bold;
    font-size: 0.85em;
}

.vc-icon {
    font-size: 2em;
    margin-bottom: 2px;
}

/* ========== 广场 ========== */
.park-plaza {
    background: linear-gradient(145deg, #fff3e0 0%, #ffe0b2 100%);
    border: 2px solid #ffb74d;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 70%;
    height: 55%;
    color: #4e342e;
    font-weight: bold;
    font-size: 0.85em;
}

.plaza-icon {
    font-size: 2.2em;
    margin-bottom: 2px;
}

/* ========== 湖 ========== */
.park-lake {
    position: relative;
    width: 80%;
    height: 85%;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.park-lake:hover {
    transform: scale(1.04);
    box-shadow: 0 0 20px rgba(79, 195, 247, 0.8);
}

.park-lake .lake-label {
    text-decoration: none;
}

.lake-water {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, #4fc3f7 0%, #0288d1 50%, #01579b 100%);
    border: 3px solid #0277bd;
    border-radius: 50%;
}

.lake-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.ripple-1 {
    width: 40%;
    height: 40%;
    top: 30%;
    left: 30%;
    animation: ripple 3s ease-in-out infinite;
}

.ripple-2 {
    width: 25%;
    height: 25%;
    top: 35%;
    left: 40%;
    animation: ripple 3s ease-in-out 0.5s infinite;
}

.ripple-3 {
    width: 15%;
    height: 15%;
    top: 45%;
    left: 48%;
    animation: ripple 3s ease-in-out 1s infinite;
}

@keyframes ripple {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.8); opacity: 0; }
}

.lake-label {
    position: relative;
    z-index: 5;
    color: #fff;
    font-weight: bold;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
    font-size: 1em;
    pointer-events: auto;
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(2, 119, 189, 0.55);
    transition: background 0.2s, transform 0.2s;
}

.lake-label:hover {
    background: rgba(2, 119, 189, 0.9);
    transform: scale(1.08);
}

/* ========== 美食广场 ========== */
.food-court {
    background: linear-gradient(145deg, #ffcdd2 0%, #ef9a9a 100%);
    border: 2px solid #e57373;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 80%;
    height: 40%;
    color: #b71c1c;
    font-weight: bold;
    font-size: 0.8em;
    text-decoration: none;
    text-align: center;
    position: relative;
}

.food-court a,
a.food-court {
    text-decoration: none;
    color: inherit;
}

.food-court.active {
    cursor: pointer;
    border: 3px solid #f44336;
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.5);
    animation: pulse-glow-red 2s ease-in-out infinite;
    transition: transform 0.3s, box-shadow 0.3s;
}

.food-court.active:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 30px rgba(244, 67, 54, 0.8);
    z-index: 20;
}

@keyframes pulse-glow-red {
    0%, 100% { box-shadow: 0 4px 15px rgba(244, 67, 54, 0.5); }
    50% { box-shadow: 0 4px 22px rgba(244, 67, 54, 0.8); }
}

.food-court .enclosure-tag {
    font-size: 0.65em;
    color: #c62828;
    background: rgba(244, 67, 54, 0.15);
    padding: 2px 8px;
    border-radius: 12px;
    white-space: nowrap;
    animation: tag-bounce 1.5s ease-in-out infinite;
    margin-top: 2px;
}

.fc-icon {
    font-size: 1.5em;
    margin-bottom: 2px;
}

/* ========== 纪念品商店 ========== */
.gift-shop {
    background: linear-gradient(145deg, #e1bee7 0%, #ce93d8 100%);
    border: 2px solid #ab47bc;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 80%;
    height: 40%;
    color: #4a148c;
    font-weight: bold;
    font-size: 0.8em;
    margin-top: 8px;
}

.gs-icon {
    font-size: 1.5em;
    margin-bottom: 2px;
}

/* ========== 道路 ========== */
.park-roads {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.road {
    stroke: #d7ccc8;
    stroke-width: 12;
    stroke-linecap: round;
    opacity: 0.6;
}

.main-road {
    stroke-width: 16;
    stroke: #bcaaa4;
}

.side-road {
    stroke-dasharray: 8 4;
    opacity: 0.5;
}

/* ========== 底部 ========== */
.footer {
    text-align: center;
    padding: 20px;
    color: #33691e;
    font-size: 0.9em;
}

.footer-hint {
    margin-top: 6px;
    font-size: 0.8em;
    color: #558b2f;
    font-style: italic;
}

/* ========== 动物详情页通用样式 ========== */
.detail-page {
    background: linear-gradient(135deg, #f1f8e9 0%, #dcedc8 30%, #c5e1a5 60%, #aed581 100%);
}

.detail-header {
    background: linear-gradient(180deg, #33691e 0%, #558b2f 50%, #689f38 100%);
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    position: relative;
}

.back-btn {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    text-decoration: none;
    font-size: 1.1em;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    transition: background 0.3s;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.35);
}

.detail-header h1 {
    color: #fff;
    font-size: 2.2em;
    letter-spacing: 3px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.detail-container {
    max-width: 900px;
    margin: 30px auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Hero 区域 */
.animal-hero {
    background: #fff;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.animal-hero .hero-icon {
    font-size: 7em;
    margin-bottom: 10px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.animal-hero .hero-name-en {
    font-size: 2em;
    color: #795548;
    font-weight: bold;
    margin-bottom: 6px;
}

.animal-hero .hero-name-cn {
    font-size: 1.2em;
    color: #8d6e63;
}

/* 信息卡片 */
.info-card {
    background: #fff;
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.info-card h2 {
    color: #33691e;
    font-size: 1.4em;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 3px solid #aed581;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.info-item {
    background: #f1f8e9;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.info-item .label {
    font-size: 0.85em;
    color: #689f38;
    margin-bottom: 4px;
}

.info-item .value {
    font-size: 1.1em;
    color: #33691e;
    font-weight: bold;
}

/* 描述卡片 */
.desc-card {
    background: #fff;
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.desc-card h2 {
    color: #33691e;
    font-size: 1.4em;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 3px solid #aed581;
}

.desc-card p {
    color: #4e342e;
    line-height: 1.8;
    font-size: 1.05em;
}

/* 趣闻卡片 */
.fun-fact {
    background: linear-gradient(135deg, #fff9c4 0%, #fff176 100%);
    border: 2px solid #f9a825;
    border-radius: 20px;
    padding: 24px 28px;
    box-shadow: 0 4px 15px rgba(249, 168, 37, 0.25);
}

.fun-fact h2 {
    color: #e65100;
    font-size: 1.3em;
    margin-bottom: 12px;
}

.fun-fact p {
    color: #5d4037;
    line-height: 1.8;
    font-size: 1.05em;
}

.fun-fact .fact-icon {
    font-size: 1.5em;
    margin-right: 6px;
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .logo {
        font-size: 1.6em;
    }

    .subtitle {
        font-size: 0.85em;
    }

    .park-map {
        min-height: 500px;
        grid-template-columns: 25% 25% 25% 25%;
        grid-template-rows: 25% 25% 25% 25%;
    }

    .enclosure-icon {
        font-size: 2em;
    }

    .enclosure-name {
        font-size: 0.75em;
    }

    .enclosure-tag, .enclosure-status {
        font-size: 0.6em;
    }

    .detail-header h1 {
        font-size: 1.5em;
    }

    .back-btn {
        font-size: 0.9em;
        padding: 6px 12px;
    }

    .animal-hero .hero-icon {
        font-size: 4em;
    }

    .info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========== 徽章系统 ========== */

/* 馆页面徽章卡片 */
.badge-card {
    background: linear-gradient(135deg, #fff9c4 0%, #ffecb3 30%, #ffe082 100%);
    border: 3px solid #ffb300;
    border-radius: 20px;
    padding: 24px 28px;
    box-shadow: 0 4px 20px rgba(255, 179, 0, 0.4), 0 0 40px rgba(255, 215, 0, 0.25);
    text-align: center;
    animation: badge-appear 0.6s ease-out, badge-glow 2s ease-in-out infinite alternate;
}

.badge-card.hidden {
    display: none;
}

@keyframes badge-appear {
    0% { opacity: 0; transform: scale(0.5) rotateY(90deg); }
    60% { opacity: 1; transform: scale(1.15) rotateY(-10deg); }
    100% { opacity: 1; transform: scale(1) rotateY(0deg); }
}

@keyframes badge-glow {
    0% { box-shadow: 0 4px 20px rgba(255, 179, 0, 0.4), 0 0 40px rgba(255, 215, 0, 0.25); }
    100% { box-shadow: 0 4px 30px rgba(255, 179, 0, 0.6), 0 0 60px rgba(255, 215, 0, 0.45); }
}

.badge-earned {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.badge-icon {
    font-size: 3.5em;
    animation: badge-bounce 1s ease-in-out infinite;
}

@keyframes badge-bounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-8px) scale(1.1); }
}

.badge-title {
    font-size: 1.4em;
    font-weight: bold;
    color: #e65100;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.badge-desc {
    font-size: 1em;
    color: #5d4037;
    margin-top: 2px;
}

/* 首页徽章收集面板 */
.badge-panel-container {
    max-width: 1100px;
    margin: 0 auto 16px;
    padding: 0 20px;
}

.badge-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 0 4px;
}

.badge-panel-title {
    font-size: 1.1em;
    font-weight: bold;
    color: #33691e;
}

.badge-panel-count {
    font-size: 0.95em;
    color: #558b2f;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.6);
    padding: 3px 12px;
    border-radius: 12px;
}

.badge-panel-grid {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.mini-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 24px;
    font-size: 0.9em;
    font-weight: bold;
    transition: transform 0.3s, box-shadow 0.3s;
}

.mini-badge.badge-locked {
    background: #e0e0e0;
    color: #9e9e9e;
    border: 2px dashed #bdbdbd;
}

.mini-badge.badge-locked .mini-badge-icon {
    filter: grayscale(1);
    opacity: 0.5;
}

.mini-badge.badge-in-progress {
    background: #fff8e1;
    color: #f9a825;
    border: 2px solid #ffcc02;
}

.mini-badge.badge-earned {
    background: linear-gradient(135deg, #fff9c4 0%, #ffecb3 100%);
    color: #e65100;
    border: 2px solid #ffb300;
    box-shadow: 0 2px 12px rgba(255, 179, 0, 0.35);
    animation: mini-badge-glow 1.5s ease-in-out infinite alternate;
    cursor: default;
}

@keyframes mini-badge-glow {
    0% { box-shadow: 0 2px 10px rgba(255, 179, 0, 0.3); }
    100% { box-shadow: 0 2px 18px rgba(255, 179, 0, 0.55); }
}

.mini-badge.badge-earned:hover {
    transform: scale(1.08);
}

.mini-badge-icon {
    font-size: 1.2em;
}

.mini-badge-name {
    white-space: nowrap;
}

/* 首页馆徽章标记 */
.enclosure-badge-mark {
    position: absolute;
    top: -6px;
    left: -6px;
    font-size: 1.2em;
    z-index: 15;
    animation: badge-bounce 1.2s ease-in-out infinite;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

@media (max-width: 768px) {
    .badge-panel-grid {
        gap: 8px;
    }
    .mini-badge {
        font-size: 0.78em;
        padding: 6px 12px;
    }
    .badge-card {
        padding: 16px 20px;
    }
    .badge-icon {
        font-size: 2.5em;
    }
    .badge-title {
        font-size: 1.2em;
    }
}
