/* ============================================================
   MeowMaple Design Tokens — High-End MapleStory Retro
   復古金黃 × 深木棕 × 莫蘭迪復古藍 × 羊皮紙米黃
   ============================================================ */

:root {
    --ms-gold: #E5B842;
    --ms-gold-light: #F3D978;
    --ms-gold-deep: #C4922A;
    --ms-gold-bronze: #A9761F;
    --ms-oak: #2D1F17;
    --ms-oak-mid: #4A3428;
    --ms-oak-light: #6B4A2F;
    --ms-parchment: #F4E8C1;
    --ms-parchment-2: #E8D9A8;
    --ms-royale-blue: #3B5998;
    --ms-royale-blue-light: #6F8FC9;
    --ms-forest: #3F7D4A;
    --ms-copper: #A8552B;
    --ms-online: #3DDC84;
    --ms-text: #2A1C14;
    --ms-text-muted: #6B5748;
    --ms-danger: #B3452F;
    --ms-success: #3F7D4A;
    --ms-border-metal: linear-gradient(180deg, #F3D978, #B8862D 45%, #8A6418);
    --ms-shadow-deep: 0 12px 40px rgba(20, 12, 8, 0.45);
    /* jf open 粉圓（Google Fonts: Huninn）→ 系統備援 */
    --ms-font-body: 'Huninn', 'Microsoft JhengHei', 'PingFang TC', sans-serif;
    --ms-font-display: 'Huninn', 'Microsoft JhengHei', 'PingFang TC', sans-serif;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--ms-font-body);
    font-size: 16px;
    line-height: 1.75;
    letter-spacing: 0.02em;
    font-weight: 500;
    color: #333;
    background:
        radial-gradient(ellipse at top, rgba(45, 31, 23, 0.15), transparent 55%),
        linear-gradient(180deg, rgba(20, 13, 9, 0.35), rgba(20, 13, 9, 0.55)),
        url('../images/background.png') no-repeat center top;
    background-size: cover, cover, cover;
    background-attachment: fixed, fixed, fixed;
    background-blend-mode: normal, multiply, normal;
    min-height: 100vh;
    position: relative;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: unset;
    font-smooth: never;
}

h1, h2, h3, h4, h5, h6,
.btn,
.nav-link,
.home-panel-title,
.home-hero-title,
.home-btn,
.live-stat-value,
.live-stats-badge {
    font-family: var(--ms-font-display);
    letter-spacing: 0.04em;
}

body::before {
    /* 微弱顆粒質感，營造復古氛圍 */
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.05;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* 防止手機版出現水平滾動（右側空白） */
html, body {
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Floating Buttons Container — 由上到下：TOP → DC（客服另定位於最下） */
.floating-buttons {
    position: fixed;
    right: 30px;
    bottom: 98px; /* 60(客服) + 14(間距) + 24(底邊) */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    z-index: 1000;
}

/* Back to Top Button */
.back-to-top {
    width: 60px;
    height: 60px;
    background: linear-gradient(145deg, var(--ms-gold-light), var(--ms-gold-deep));
    color: var(--ms-oak);
    border: 2px solid var(--ms-gold-bronze);
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 15px rgba(196, 146, 42, 0.4);
    text-decoration: none;
    order: 1;
    cursor: pointer;
}

/* Discord Float Button */
.discord-float {
    width: 60px;
    height: 60px;
    background: linear-gradient(45deg, #5865f2, #7289da);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(88, 101, 242, 0.3);
    text-decoration: none;
    order: 2;
}

.back-to-top.show {
    display: flex;
}

.back-to-top:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 6px 20px rgba(196, 146, 42, 0.55);
}

.discord-float:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 6px 20px rgba(88, 101, 242, 0.4);
}

/* 客服聊天鈕：固定在最下方，與 TOP/DC 對齊成一直線 */
.chat-float-container {
    bottom: 24px !important;
    right: 30px !important;
    z-index: 1001 !important;
    gap: 12px !important;
}

.chat-float-button {
    width: 60px !important;
    height: 60px !important;
}

/* Header Styles — Deep Oak Wood + Golden Metal Border */
.header {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.12) 60%),
        repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.05) 0px, transparent 2px, transparent 22px, rgba(0, 0, 0, 0.05) 24px),
        linear-gradient(180deg, var(--ms-oak-mid) 0%, var(--ms-oak) 85%);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--ms-border-metal);
    box-shadow: 0 1px 8px rgba(197, 146, 42, 0.55);
    pointer-events: none;
}

/* ── 單層導覽列：Logo | 膠囊選單 | Online/下載/帳號 ── */
.navbar {
    padding: 0.45rem 0;
}

.nav-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-logo {
    flex-shrink: 0;
}

.nav-logo .logo-img {
    height: 48px;
    transition: transform 0.3s ease;
}

.nav-logo:hover .logo-img {
    transform: scale(1.05) rotate(5deg);
}

.nav-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-width: 0;
}

.nav-list {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(229, 184, 66, 0.25);
    border-radius: 999px;
    padding: 0.5rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 6px 18px rgba(0, 0, 0, 0.25);
}

.nav-link {
    color: var(--ms-parchment);
    font-weight: 700;
    font-size: 0.92rem;
    padding: 0.42rem 0.9rem;
    border-radius: 999px;
    transition: all 0.3s ease;
    position: relative;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    background: transparent;
    border: 1px solid transparent;
    white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
    color: var(--ms-oak);
    background: linear-gradient(180deg, var(--ms-gold-light), var(--ms-gold-deep));
    transform: translateY(-1px);
    text-shadow: none;
    border: 1px solid var(--ms-gold-bronze);
    box-shadow: 0 4px 15px rgba(197, 146, 42, 0.45);
}

.nav-actions {
    display: flex;
    gap: 0.65rem;
    align-items: center;
    flex-shrink: 0;
    margin-left: auto;
}

.nav-game-actions,
.nav-auth-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* 手機版專用導航項目在桌面版隱藏 */
.nav-mobile-only {
    display: none;
}

/* ── Online Players 燈號（頂部導覽） ── */
.ms-online-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(229, 184, 66, 0.35);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    white-space: nowrap;
}

.ms-online-pill__dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--ms-online);
    box-shadow: 0 0 0 0 rgba(61, 220, 132, 0.6);
    animation: msOnlinePulse 1.6s ease-out infinite;
    flex-shrink: 0;
}

.ms-online-pill__label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ms-gold-light);
    opacity: 0.9;
}

.ms-online-pill__value {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--ms-parchment);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

@keyframes msOnlinePulse {
    0% { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0.6); }
    70% { box-shadow: 0 0 0 7px rgba(61, 220, 132, 0); }
    100% { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0); }
}

@media (max-width: 480px) {
    .ms-online-pill__label { display: none; }
    .ms-online-pill { padding: 0.35rem 0.55rem; }
}

@media (max-width: 1100px) {
    .ms-online-pill__label { display: none; }
    .nav-link { padding: 0.4rem 0.7rem; font-size: 0.86rem; }
    .nav-list { gap: 0.15rem; padding: 0.22rem; }
}

.btn {
    padding: 0.7rem 1.5rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.25s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

/* 楓之谷金屬按鈕：hover 掃光、active 下壓感 */
.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -120%;
    width: 60%;
    height: 100%;
    background: linear-gradient(115deg, transparent, rgba(255, 255, 255, 0.45), transparent);
    transform: skewX(-20deg);
    transition: left 0.55s ease;
    pointer-events: none;
}

.btn:hover::before {
    left: 130%;
}

.btn:active {
    transform: translateY(1px) !important;
    filter: brightness(0.94);
    box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.35) !important;
}

.btn-discord {
    background: linear-gradient(180deg, #7289da, #5865f2);
    color: white;
    border: 1px solid #4752c4;
}

.btn-download {
    background: linear-gradient(180deg, var(--ms-gold-light), var(--ms-gold-deep));
    color: var(--ms-oak);
    border: 1px solid var(--ms-gold-bronze);
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.35);
}

.btn-logout {
    background: #B3452F;
    color: white;
    border: 1px solid #8C3320;
}

.btn-logout:hover {
    background: #8C3320;
    border: 1px solid #a93226;
    box-shadow: 0 8px 25px rgba(179, 69, 47, 0.3);
}

.btn-register {
    background: #3F7D4A;
    color: white;
    border: 1px solid #2F5F38;
}

.btn-register:hover {
    background: #2F5F38;
    border: 1px solid #1e8449;
    box-shadow: 0 8px 25px rgba(63, 125, 74, 0.3);
}

.btn:hover {
    transform: translateY(-3px);
}

.btn.btn-primary:hover,
.btn.btn-secondary:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

/* Mobile Menu Toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.nav-toggle:hover {
    background: rgba(229, 184, 66, 0.15);
}

.bar {
    width: 25px;
    height: 3px;
    background: var(--ms-gold-light);
    margin: 3px 0;
    transition: 0.3s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    border-radius: 2px;
}

/* Main Content */
.main-content {
    margin-top: 88px;
    position: relative;
    z-index: 1;
}

/* Banner Section */
/* Banner — 寬度與圖片對齊，徽章才不會偏出圖外 */
.banner-section {
    text-align: center;
    margin: 0 auto 3rem;
    animation: fadeInUp 1s ease;
    padding-top: 1rem;
    line-height: 0;
    position: relative;
    max-width: 1200px;
    width: calc(100% - 40px);
}

/* 金屬雙層鑲邊 + 懷舊徽章 */
.banner-img {
    display: block;
    width: 100%;
    max-width: 1200px;
    height: auto;
    margin: 0 auto;
    border-radius: 20px;
    border: 3px solid rgba(229, 184, 66, 0.55);
    box-shadow: 0 20px 55px rgba(0, 0, 0, 0.3),
                0 0 0 8px rgba(45, 31, 23, 0.28),
                inset 0 0 0 1px rgba(255, 255, 255, 0.15);
    transition: transform 0.3s ease;
}

.banner-section::after {
    content: '★ 同步谷 ★';
    position: absolute;
    bottom: 18px;
    right: 18px;
    left: auto;
    background: linear-gradient(180deg, var(--ms-gold-light), var(--ms-gold-deep));
    color: var(--ms-oak);
    font-weight: 800;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    line-height: 1;
    padding: 0.6rem 1.2rem;
    border-radius: 999px;
    border: 1px solid var(--ms-gold-bronze);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
    z-index: 3;
    white-space: nowrap;
    pointer-events: none;
}

.banner-img-mobile {
    display: none;
}

.banner-img:hover {
    transform: scale(1.02);
}

/* Live Stats Section */
.live-stats-section {
    max-width: 1200px;
    margin: -1.5rem auto 2.5rem;
    padding: 0 20px;
    animation: fadeInUp 0.5s ease;
}

.live-stats-wrapper {
    position: relative;
    padding: 1.35rem 1.5rem 1.1rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
    overflow: hidden;
}

.live-stats-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 18px;
    padding: 1px;
    background: linear-gradient(
        120deg,
        rgba(111, 143, 201, 0.55),
        rgba(232, 196, 107, 0.45),
        rgba(169, 118, 31, 0.45),
        rgba(255, 193, 7, 0.35)
    );
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0.85;
}

.live-stats-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.live-stats-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #2D1F17;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.live-stats-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #3F7D4A;
    box-shadow: 0 0 0 0 rgba(63, 125, 74, 0.55);
    animation: liveStatsPulse 1.4s ease-out infinite;
}

.live-stats-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.85rem;
}

.live-stats-grid--four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.live-stats-grid--five {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.home-page .live-stats-section {
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 0;
    position: relative;
    z-index: 2;
}

/* 首頁即時數據：木金質感數字卡（數字為主、圖示為輔） */
.home-live-stats .live-stats-wrapper {
    padding: 1.15rem 1.25rem 1rem;
    border-radius: 22px;
    background:
        linear-gradient(165deg, rgba(255, 253, 246, 0.94), rgba(244, 232, 193, 0.88));
    border: 2px solid rgba(229, 184, 66, 0.55);
    box-shadow:
        0 16px 40px rgba(45, 31, 23, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.75);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    overflow: visible;
}

.home-live-stats .live-stats-wrapper::before {
    display: none;
}

.home-live-stats .live-stats-header {
    margin-bottom: 0.95rem;
    gap: 0.65rem;
}

.home-live-stats .live-stats-badge {
    padding: 0.32rem 1rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #FFF8E7;
    background: #2D1F17;
    box-shadow: none;
    border: 1px solid rgba(229, 184, 66, 0.45);
}

.home-live-stats .live-stats-pulse {
    width: 7px;
    height: 7px;
    background: #3DDC84;
}

.home-live-stats .live-stats-grid--four,
.home-live-stats .live-stats-grid--five {
    gap: 0.9rem;
}

.home-live-stats .live-stat-item {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding: 1.05rem 1rem 1.1rem;
    border-radius: 16px;
    background: #fff;
    border: 1px solid rgba(211, 159, 119, 0.35);
    box-shadow: 0 8px 22px rgba(20, 48, 85, 0.08);
    text-align: left;
}

.home-live-stats .live-stat-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 30px rgba(20, 48, 85, 0.14);
    border-color: rgba(229, 184, 66, 0.65);
}

.home-live-stats .live-stat-icon {
    display: block;
    flex: 0 0 auto;
    align-self: flex-start;
    width: 2.75rem;
    height: 2.75rem;
    background: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
    padding: 0;
    line-height: 0;
}

.home-live-stats .live-stat-icon img {
    width: 2.75rem;
    height: 2.75rem;
    object-fit: contain;
    object-position: left center;
    display: block;
    background: none;
}

.home-live-stats .live-stat-item--opendays .live-stat-value {
    font-size: clamp(1.15rem, 1.7vw, 1.45rem);
    letter-spacing: 0;
}

.home-live-stats .live-stat-content {
    gap: 0.2rem;
}

.home-live-stats .live-stat-value {
    font-size: clamp(1.45rem, 2.2vw, 1.85rem);
    font-weight: 800;
    color: #2D1F17;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.home-live-stats .live-stat-label {
    font-size: 0.86rem;
    font-weight: 700;
    color: rgba(45, 31, 23, 0.62) !important;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
}

.home-live-stats .live-stats-updated {
    margin: 0.85rem 0 0;
    text-align: center;
    font-size: 0.75rem;
    color: rgba(45, 31, 23, 0.55);
}

@media (max-width: 1200px) {
    .home-live-stats .live-stats-grid--five {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 992px) {
    .home-live-stats .live-stats-grid--four,
    .home-live-stats .live-stats-grid--five {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .home-live-stats .live-stats-wrapper {
        padding: 1rem 0.85rem 0.85rem;
        border-radius: 16px;
    }

    .home-live-stats .live-stat-item {
        padding: 0.9rem 0.85rem;
        min-height: 0;
        align-items: stretch;
        text-align: left;
        flex-direction: column;
    }

    .home-live-stats .live-stat-content {
        align-items: flex-start;
        width: 100%;
    }

    .home-live-stats .live-stat-value {
        font-size: 1.35rem;
    }

    .home-live-stats .live-stat-label {
        font-size: 0.8rem;
        white-space: normal;
    }

    .home-live-stats .live-stat-label-full {
        display: inline;
    }

    .home-live-stats .live-stat-label-short {
        display: none;
    }
}


.live-stat-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    padding: 0.85rem 0.75rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.65);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.live-stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.live-stat-dot {
    flex-shrink: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    box-shadow: 0 0 8px currentColor;
}

.live-stat-dot--green { color: #3F7D4A; background: #3F7D4A; }
.live-stat-dot--purple { color: #A8552B; background: #A8552B; }
.live-stat-dot--blue { color: #3B5998; background: #3B5998; }
.live-stat-dot--yellow { color: #E5B842; background: #E5B842; }

.live-stat-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.live-stat-label {
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.live-stat-item--online .live-stat-label { color: #1e9e57; }
.live-stat-item--regedit .live-stat-label { color: #8e44ad; }
.live-stat-item--character .live-stat-label { color: #2e86c1; }
.live-stat-item--discord .live-stat-label { color: #5865f2; }
.live-stat-item--messages .live-stat-label { color: #d6890a; }

.live-stat-label-short {
    display: none;
}

.live-stat-value {
    font-size: clamp(1rem, 1.35vw, 1.25rem);
    font-weight: 800;
    color: #1a2a3a;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

.live-stats-updated {
    margin: 0.85rem 0 0;
    text-align: right;
    font-size: 0.78rem;
    color: #4a5c6d;
}

.live-stats-section.live-stats--loaded .live-stat-value {
    animation: liveStatsNumberPop 0.22s ease;
}

.live-stats-section.live-stats--error .live-stats-updated {
    color: #8C3320;
}

@keyframes liveStatsPulse {
    0% { box-shadow: 0 0 0 0 rgba(63, 125, 74, 0.55); }
    70% { box-shadow: 0 0 0 8px rgba(63, 125, 74, 0); }
    100% { box-shadow: 0 0 0 0 rgba(63, 125, 74, 0); }
}

@keyframes liveStatsNumberPop {
    0% { transform: scale(0.98); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

/* Highlights Section */
.highlights-section {
    max-width: 1400px;
    margin: 0 auto 4rem auto;
    padding: 0 20px;
    animation: fadeInUp 1s ease;
    position: relative;
}

/* 背景光暈裝飾 */
.highlights-section::before,
.highlights-section::after {
    content: '';
    position: absolute;
    pointer-events: none;
    width: 480px;
    height: 480px;
    filter: blur(60px);
    opacity: 0.25;
    z-index: 0;
}

.highlights-section::before {
    top: -80px;
    left: -120px;
    background: radial-gradient(circle at 30% 30%, rgba(232, 196, 107, 0.65), transparent 60%);
}

.highlights-section::after {
    bottom: -100px;
    right: -160px;
    background: radial-gradient(circle at 70% 70%, rgba(111, 143, 201, 0.6), transparent 60%);
}

.highlights-container {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: minmax(200px, auto);
    gap: 1.35rem;
    padding: 0 20px;
    position: relative;
    z-index: 1;
    align-items: stretch;
}

/* Bento 不對稱排版：大小卡交錯 */
.highlights-container .highlight-card:nth-child(1) { grid-column: 1 / 8; grid-row: 1; }
.highlights-container .highlight-card:nth-child(2) { grid-column: 8 / 13; grid-row: 1; }
.highlights-container .highlight-card:nth-child(3) { grid-column: 1 / 6; grid-row: 2; }
.highlights-container .highlight-card:nth-child(4) { grid-column: 6 / 13; grid-row: 2; }

.highlight-card {
    /* 羊皮紙 + 金邊質感 */
    background:
        linear-gradient(160deg, rgba(255, 253, 246, 0.96), rgba(244, 232, 193, 0.88)) padding-box,
        linear-gradient(135deg, rgba(229, 184, 66, 0.75), rgba(169, 118, 31, 0.55)) border-box;
    border: 2px solid transparent;
    border-radius: 22px;
    padding: 1.5rem 1.75rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1.5rem;
    text-align: left;
    transition: all 0.35s ease;
    box-shadow: 0 12px 32px rgba(45, 31, 23, 0.12),
                inset 0 1px 0 rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(8px);
    position: relative;
    overflow: hidden;
    height: 100%;
    min-height: 200px;
    animation: highlightRiseIn 0.7s ease both;
}

/* 依卡片序號微調描邊色調 */
.highlight-card:nth-child(2) {
    background:
        linear-gradient(160deg, rgba(255, 253, 246, 0.96), rgba(232, 240, 255, 0.9)) padding-box,
        linear-gradient(135deg, rgba(111, 143, 201, 0.7), rgba(59, 89, 152, 0.55)) border-box;
}

.highlight-card:nth-child(3) {
    background:
        linear-gradient(160deg, rgba(255, 253, 246, 0.96), rgba(232, 245, 232, 0.9)) padding-box,
        linear-gradient(135deg, rgba(143, 201, 143, 0.7), rgba(63, 125, 74, 0.55)) border-box;
}

.highlight-card:nth-child(4) {
    background:
        linear-gradient(160deg, rgba(255, 253, 246, 0.96), rgba(255, 244, 230, 0.9)) padding-box,
        linear-gradient(135deg, rgba(224, 164, 88, 0.75), rgba(168, 85, 43, 0.5)) border-box;
}

.highlight-card::before {
    /* 柔和內層光暈 */
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(232, 196, 107, 0.10) 0%, rgba(169, 118, 31, 0.10) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 0;
}

.highlight-card::after {
    /* 掃光特效 */
    content: '';
    position: absolute;
    top: -60%;
    left: -120%;
    width: 240%;
    height: 220%;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0) 35%, rgba(255, 255, 255, 0.35) 50%, rgba(255, 255, 255, 0) 65%);
    transform: translateX(-30%);
    transition: transform 0.9s ease;
    z-index: 0;
}

.highlight-card:hover::before {
    opacity: 1;
}

.highlight-card:hover {
    transform: translateY(-12px) scale(1.03);
    box-shadow: 0 22px 55px rgba(232, 196, 107, 0.35),
                0 12px 28px rgba(232, 196, 107, 0.25),
                inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.highlight-card:hover::before {
    opacity: 1;
}

.highlight-card:hover::after {
    transform: translateX(30%);
}

.highlight-card:nth-child(2):hover {
    box-shadow: 0 20px 50px rgba(111, 143, 201, 0.35),
                0 10px 25px rgba(111, 143, 201, 0.25),
                inset 0 1px 0 rgba(255, 255, 255, 0.9);
    border-color: rgba(111, 143, 201, 0.5);
}

.highlight-card:nth-child(3):hover {
    box-shadow: 0 20px 50px rgba(143, 201, 143, 0.35),
                0 10px 25px rgba(143, 201, 143, 0.25),
                inset 0 1px 0 rgba(255, 255, 255, 0.9);
    border-color: rgba(143, 201, 143, 0.5);
}

.highlight-card:nth-child(4):hover {
    box-shadow: 0 20px 50px rgba(224, 164, 88, 0.35),
                0 10px 25px rgba(224, 164, 88, 0.25),
                inset 0 1px 0 rgba(255, 255, 255, 0.9);
    border-color: rgba(224, 164, 88, 0.5);
}

.highlight-icon {
    width: 140px;
    height: 140px;
    flex-shrink: 0;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s ease;
    position: relative;
    z-index: 1;
    padding: 8px; /* 讓外框與圖片有留白 */
    background: linear-gradient(135deg, rgba(255,255,255,0.25), rgba(255,255,255,0.05)) padding-box,
                linear-gradient(135deg, rgba(232,196,107,0.6), rgba(169,118,31,0.6)) border-box;
    border: 2px solid transparent;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.16);
}

/* 編號徽章：強化 Bento 卡片的層級感 */
.highlight-index {
    position: absolute;
    top: 14px;
    right: 18px;
    font-size: 2.2rem;
    font-weight: 800;
    font-family: Georgia, 'Times New Roman', serif;
    color: rgba(45, 31, 23, 0.1);
    z-index: 0;
    line-height: 1;
    pointer-events: none;
}

.highlight-content {
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 1;
}

/* 圖示外層旋轉虛線環 */
.highlight-icon::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 28px;
    background: linear-gradient(135deg, rgba(255,255,255,0.25), rgba(255,255,255,0.05));
    box-shadow: inset 0 0 0 2px rgba(255,255,255,0.3);
    z-index: 0;
}

.highlight-card:nth-child(2) .highlight-icon {
    background: linear-gradient(135deg, rgba(255,255,255,0.25), rgba(255,255,255,0.05)) padding-box,
                linear-gradient(135deg, rgba(111, 143, 201, 0.6), rgba(59, 89, 152, 0.6)) border-box;
}

.highlight-card:nth-child(3) .highlight-icon {
    background: linear-gradient(135deg, rgba(255,255,255,0.25), rgba(255,255,255,0.05)) padding-box,
                linear-gradient(135deg, rgba(143, 201, 143, 0.6), rgba(63, 125, 74, 0.6)) border-box;
}

.highlight-card:nth-child(4) .highlight-icon {
    background: linear-gradient(135deg, rgba(255,255,255,0.25), rgba(255,255,255,0.05)) padding-box,
                linear-gradient(135deg, rgba(224, 164, 88, 0.6), rgba(168, 85, 43, 0.6)) border-box;
}

.highlight-image {
    width: 160px;
    height: 160px;
    border-radius: 8px;
    object-fit: cover;
    display: block;
    position: relative;
    z-index: 1;
    box-shadow: 0 8px 18px rgba(0,0,0,0.12);
    transition: transform 0.35s ease, filter 0.35s ease;
}

.highlight-card:hover .highlight-icon {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.18);
}

.highlight-card:nth-child(2):hover .highlight-icon { box-shadow: 0 18px 36px rgba(111, 143, 201, 0.35); }

.highlight-card:nth-child(3):hover .highlight-icon { box-shadow: 0 18px 36px rgba(143, 201, 143, 0.35); }

.highlight-card:nth-child(4):hover .highlight-icon { box-shadow: 0 18px 36px rgba(224, 164, 88, 0.35); }

/* 圖片在 hover 時微微放大與提亮 */
.highlight-card:hover .highlight-image {
    transform: scale(1.06);
    filter: brightness(1.05) contrast(1.02);
}

.highlight-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #2D1F17;
    margin-bottom: 0.85rem;
    background: linear-gradient(135deg, #E8C46B 0%, #A9761F 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all 0.3s ease;
}

.highlight-title::after {
    /* 標題下方分隔線（改為靠左，呼應水平卡片排版） */
    content: '';
    display: block;
    width: 48px;
    height: 4px;
    border-radius: 4px;
    margin: 0.5rem 0 0;
    background: linear-gradient(90deg, #E8C46B, #A9761F);
    opacity: 0.9;
}

.highlight-card:nth-child(2) .highlight-title {
    background: linear-gradient(135deg, #6F8FC9 0%, #3B5998 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.highlight-card:nth-child(2) .highlight-title::after {
    background: linear-gradient(90deg, #6F8FC9, #3B5998);
}

.highlight-card:nth-child(3) .highlight-title {
    background: linear-gradient(135deg, #8FC98F 0%, #3F7D4A 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.highlight-card:nth-child(3) .highlight-title::after {
    background: linear-gradient(90deg, #8FC98F, #3F7D4A);
}

.highlight-card:nth-child(4) .highlight-title {
    background: linear-gradient(135deg, #E0A458 0%, #A8552B 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.highlight-card:nth-child(4) .highlight-title::after {
    background: linear-gradient(90deg, #E0A458, #A8552B);
}

.highlight-description {
    font-size: 1.06rem;
    line-height: 1.75;
    color: #1f2937; /* 深色提升對比 */
    margin: 0;
    font-weight: 600; /* 提升字重 */
    letter-spacing: 0.1px;
    position: relative;
    z-index: 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 描述文字維持高對比的實心字色，移除漸層填色與亮度效果以提升可讀性 */

/* 進場延遲，讓卡片依序出現 */
.highlights-container .highlight-card:nth-child(1) { animation-delay: 0s; }
.highlights-container .highlight-card:nth-child(2) { animation-delay: 0.08s; }
.highlights-container .highlight-card:nth-child(3) { animation-delay: 0.16s; }
.highlights-container .highlight-card:nth-child(4) { animation-delay: 0.24s; }

@keyframes highlightRiseIn {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Award Section */
.award-section {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInUp 1s ease;
    padding: 2rem 0;
}

.award-divider {
    margin-bottom: 2rem;
}

.award-divider-img {
    max-height: 80px;
    width: auto;
}

.award-content {
    margin-bottom: 2rem;
}

.award-content-img {
    width: 100%;
    max-width: 1200px;
    border-radius: 15px;
    transition: transform 0.3s ease;
}

.award-content-img:hover {
    transform: scale(1.01);
}

/* Feature Section — 木紋鑲金邊面板 */
.feature-section {
    padding: 2.5rem 2rem 2.75rem;
    max-width: 1200px;
    margin: 0 auto 3rem;
    text-align: center;
    position: relative;
    z-index: 2;
    background:
        linear-gradient(180deg, rgba(255, 253, 246, 0.88), rgba(244, 232, 193, 0.75)),
        linear-gradient(135deg, rgba(45, 31, 23, 0.06), rgba(45, 31, 23, 0.02));
    border: 2px solid rgba(229, 184, 66, 0.48);
    border-radius: 28px;
    box-shadow: 0 18px 44px rgba(45, 31, 23, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(6px);
    isolation: isolate;
}

/* 裝飾用左右分隔線，讓區塊標題圖片不再孤立漂浮 */
.section-title {
    margin-bottom: 2.5rem;
    animation: bounceIn 1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.section-title::before,
.section-title::after {
    content: '';
    flex: 1 1 auto;
    max-width: 200px;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(197, 146, 42, 0.7), transparent);
}

.section-title picture {
    flex-shrink: 0;
    display: block;
}

.section-title img {
    max-height: 100px;
    flex-shrink: 0;
}

.feature-content {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.25rem 1.5rem;
    margin-bottom: 2.5rem;
    padding: 0 8px 1.75rem; /* 下方留白給錯位 translateY */
    align-items: start;
}

/* 磚牆式錯位：用 margin 而非 transform，避免與入場動畫衝突 */
.feature-content .feature-item:nth-child(even) {
    margin-top: 1.5rem;
}

.feature-content .feature-item:nth-child(even):hover {
    transform: translateY(-10px) scale(1.05);
}

/* 特色／相簿：永遠可見，不依賴 JS reveal（避免部署不同步導致整區隱形） */
.feature-item,
.photo-album {
    opacity: 1;
    transform: none;
    transition: transform 0.35s ease, filter 0.3s ease;
    position: relative;
    z-index: 2;
}

.feature-item.is-revealed,
.photo-album.is-revealed,
.banner-section.is-revealed {
    opacity: 1;
    transform: none;
}

.feature-item:hover {
    transform: translateY(-10px) scale(1.05);
}

.feature-item:hover img {
    filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.3));
}

.feature-item img {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.2));
}

.feature-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: nowrap;
    padding: 0 20px;
    align-items: center;
}

.feature-link {
    transition: transform 0.3s ease;
    animation: fadeInUp 1.2s ease;
}

.feature-link:hover {
    transform: translateY(-5px) rotate(3deg);
}

.feature-link:hover img {
    filter: drop-shadow(0 10px 25px rgba(0, 0, 0, 0.35));
}

.feature-link img {
    filter: drop-shadow(0 6px 15px rgba(0, 0, 0, 0.2));
}

/* Photo Gallery Section */
.gallery-section {
    padding: 2.5rem 2rem 3rem;
    max-width: 1200px;
    margin: 0 auto 2rem;
    text-align: center;
    position: relative;
    z-index: 3;
    isolation: isolate;
    background:
        linear-gradient(180deg, rgba(255, 253, 246, 0.9), rgba(244, 232, 193, 0.78));
    border: 2px solid rgba(229, 184, 66, 0.45);
    border-radius: 28px;
    box-shadow: 0 16px 40px rgba(45, 31, 23, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.gallery-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    padding: 0 20px;
    margin-top: 2rem;
}

.photo-album {
    position: relative;
}

.photo-album:nth-child(2) {
    /* 第二本相簿延遲一點再 reveal，仍由 .is-revealed 控制 */
    transition-delay: 0.12s;
}

.carousel-container {
    position: relative;
    max-width: 420px;
    margin: 0 auto;
}

.photo-frame {
    position: relative;
    width: 420px;
    height: 340px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.photo-frame::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../images/frame.png') no-repeat center;
    background-size: contain;
    pointer-events: none;
    z-index: 10;
}

.carousel {
    position: relative;
    width: 400px;
    height: 320px;
    overflow: hidden;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.carousel-slide.active {
    opacity: 1;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-nav {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dot.active {
    background: #6F8FC9;
    transform: scale(1.2);
}

/* Bottom Background Section — 僅作裝飾，不可蓋住內容 */
.bottom-background {
    position: relative;
    margin-top: 40px;
    z-index: 0;
    pointer-events: none;
    text-align: center;
    opacity: 0.85;
}

.bottom-bg-img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

/* Footer — Deep Oak with Golden Trim */
.footer {
    position: relative;
    text-align: center;
    background: linear-gradient(180deg, var(--ms-oak-mid), var(--ms-oak));
    padding: 0;
    z-index: 3;
    box-shadow: inset 0 3px 0 rgba(229, 184, 66, 0.5), inset 0 4px 10px rgba(0, 0, 0, 0.35);
    overflow: visible;
}

.footer.footer--mushmom {
    overflow: visible;
}

.footer-content {
    padding: 1.1rem 2rem;
    color: white;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.75rem 1rem;
    background: transparent;
}

.footer-left {
    justify-self: start;
    min-width: 0;
    text-align: left;
}

.footer-left p {
    margin-bottom: 0.25rem;
    font-size: 0.8rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    font-weight: 600;
    line-height: 1.2;
}

.footer-left p:last-child {
    margin-bottom: 0;
}

.footer-center {
    justify-self: center;
    min-width: 0;
    text-align: center;
}

.footer-center .footer-copy {
    margin: 0 0 0.25rem;
}

.footer-copy {
    color: rgba(255, 255, 255, 0.92);
    font-weight: 500;
    font-size: 0.8rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    line-height: 1.2;
}

.footer-disclaimer {
    margin: 0 0 0.35rem;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.78);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    line-height: 1.45;
    max-width: 28rem;
    margin-left: auto;
    margin-right: auto;
}

.footer-brand {
    font-size: 0.9rem !important;
    letter-spacing: 0.02em;
}

.footer-brand .fa-cat {
    margin-right: 0.35rem;
    color: #ffb347;
}

.footer-brand-en {
    color: rgba(255, 255, 255, 0.88);
    font-weight: 500;
}

.footer-site {
    color: rgba(255, 255, 255, 0.75);
    font-weight: 500;
    font-size: 0.75rem !important;
}

.footer-site-link {
    color: #E5B842;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.footer-site-link:hover {
    color: #F3D978;
    text-decoration: underline;
}

.footer-legal {
    margin: 0;
    font-size: 0.72rem !important;
    color: rgba(255, 255, 255, 0.7);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.footer-legal-link {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-legal-link:hover {
    color: #E5B842;
    text-decoration: underline;
}

.footer-legal-sep {
    margin: 0 0.45rem;
    color: rgba(255, 255, 255, 0.35);
}

.designer {
    background: linear-gradient(45deg, #6F8FC9, #3B5998);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: bold;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.8));
}

.footer-right {
    justify-self: end;
    min-width: 0;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.footer-link {
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    padding: 0.4rem 0.8rem;
    border-radius: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
}

.footer-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    /* 中等屏幕：改回等寬兩欄，卡片內容改直式堆疊 */
    .highlights-container {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: auto;
        gap: 1.5rem;
    }

    .highlights-container .highlight-card:nth-child(1),
    .highlights-container .highlight-card:nth-child(2),
    .highlights-container .highlight-card:nth-child(3),
    .highlights-container .highlight-card:nth-child(4) {
        grid-column: auto;
        grid-row: auto;
    }

    .highlight-card {
        flex-direction: column;
        text-align: center;
        gap: 0;
    }

    .highlight-icon {
        margin-bottom: 1.25rem;
    }

    .highlight-title::after {
        margin: 0.6rem auto 0;
    }
}

@media (max-width: 768px) {
    /* Live Stats 手機版：兩排（上 3 下 2，等寬對齊） */
    .live-stats-section {
        margin: 0 auto 1.75rem;
        padding: 0 12px;
    }

    .live-stats-wrapper {
        padding: 1rem 0.75rem 0.85rem;
        background: rgba(255, 255, 255, 0.28);
    }

    .live-stats-badge {
        font-size: 0.88rem;
        background: rgba(255, 255, 255, 0.88);
    }

    .live-stats-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 0.5rem;
    }

    .live-stats-grid--four {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .live-stat-item {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        gap: 0.35rem;
        padding: 0.65rem 0.35rem;
        min-height: 78px;
        background: rgba(255, 255, 255, 0.82);
        border-color: rgba(255, 255, 255, 0.9);
    }

    .live-stats-grid:not(.live-stats-grid--four) .live-stat-item:nth-child(1),
    .live-stats-grid:not(.live-stats-grid--four) .live-stat-item:nth-child(2),
    .live-stats-grid:not(.live-stats-grid--four) .live-stat-item:nth-child(3) {
        grid-column: span 2;
    }

    .live-stats-grid:not(.live-stats-grid--four) .live-stat-item:nth-child(4) {
        grid-column: 1 / span 3;
    }

    .live-stats-grid:not(.live-stats-grid--four) .live-stat-item:nth-child(5) {
        grid-column: 4 / span 3;
    }

    .live-stats-grid--four .live-stat-item {
        grid-column: auto;
    }

    .live-stat-dot {
        width: 9px;
        height: 9px;
    }

    .live-stat-content {
        align-items: center;
        gap: 0.2rem;
        width: 100%;
    }

    .live-stat-label {
        font-size: 0.88rem;
        font-weight: 700;
        white-space: nowrap;
    }

    .live-stat-label-full {
        display: none;
    }

    .live-stat-label-short {
        display: inline;
    }

    .live-stat-value {
        font-size: 1.05rem;
        font-weight: 800;
        color: #0f1f2e;
        line-height: 1.2;
    }

    .live-stats-updated {
        font-size: 0.72rem;
        color: #2f4054;
        margin-top: 0.7rem;
    }

    /* Highlights Section 手機版調整 */
    .highlights-section {
        margin-bottom: 3rem;
        padding: 0 15px;
    }
    
    .highlights-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        padding: 0 10px;
    }
    
    .highlight-card {
        padding: 1.25rem 0.75rem;
    }
    
    .highlight-icon {
        width: 90px;
        height: 90px;
        padding: 5px;
        border-radius: 14px;
        margin-bottom: 0.75rem;
    }
    
    .highlight-image {
        width: 75px;
        height: 75px;
        border-radius: 8px;
    }
    
    .highlight-title {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .highlight-description {
        font-size: 0.8rem;
        line-height: 1.5;
    }
    
    /* 手機版隱藏遊戲相關按鈕組，保留帳號相關按鈕 */
    .nav-game-actions {
        display: none;
    }
    
    .nav-actions {
        display: flex;
        gap: 0.75rem;
    }
    
    .nav-auth-actions {
        display: flex;
        gap: 0.75rem;
    }
    
    /* 手機版按鈕樣式調整 */
    .nav-auth-actions .btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
        border-radius: 20px;
    }
    
    /* 手機版顯示手機專用導航項目 */
    .nav-mobile-only {
        display: block;
    }
    
    .nav-menu {
        position: fixed;
        left: 0;
        right: 0;
        top: 0;
        bottom: 0;
        background: linear-gradient(180deg, rgba(45, 31, 23, 0.97), rgba(26, 17, 12, 0.98));
        backdrop-filter: blur(15px);
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: 90px 1.25rem 2rem;
        transform: translateX(-100%);
        opacity: 0;
        visibility: hidden;
        transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
        z-index: 999;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .nav-menu.active {
        transform: translateX(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-list {
        flex-direction: column;
        gap: 0.85rem;
        width: 100%;
        text-align: center;
        margin-bottom: 1rem;
    }

    .nav-item {
        width: 100%;
    }

    .nav-link {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        max-width: 360px;
        margin: 0 auto;
    }
    
    .nav-toggle {
        display: flex;
        z-index: 1002;
        position: relative;
        margin-left: auto;
    }
    
    .nav-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    
    .nav-toggle.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
    
    .gallery-container {
        grid-template-columns: 1fr;
        gap: 2rem;
        justify-items: center; /* 手機板置中每個相簿項目 */
    }
    
    .gallery-section {
        padding: 1.75rem 1.1rem 2rem;
        border-radius: 20px;
        margin-bottom: 1.5rem;
    }

    /* 確保相簿區塊本身也置中 */
    .photo-album {
        display: flex;
        justify-content: center;
    }
    
    .bottom-background {
        margin-top: -60px;
        opacity: 0.7;
    }
    
    .feature-content {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.85rem;
        padding: 0 8px 0.5rem;
        margin-bottom: 2rem;
    }

    /* 手機版取消錯位，避免窄螢幕重疊 */
    .feature-content .feature-item:nth-child(even) {
        margin-top: 0;
    }

    .feature-content .feature-item:nth-child(even):hover {
        transform: translateY(-6px) scale(1.03);
    }

    .feature-section {
        padding: 1.75rem 1.1rem 2rem;
        border-radius: 20px;
    }

    .section-title::before,
    .section-title::after {
        max-width: 60px;
    }

    .feature-links {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 1.5rem;
    }
    
    .feature-link img {
        max-width: 360px;
        height: auto;
    }
    
    .feature-item img {
        max-width: 100%;
        width: 100%;
        height: auto;
        margin: 0 auto;
        display: block;
    }
    
    .footer-content {
        display: flex;
        flex-direction: column;
        text-align: center;
        padding: 0.8rem 1rem;
        gap: 0.5rem;
    }

    .footer-left {
        width: 100%;
        text-align: center;
    }

    .footer-center {
        width: 100%;
    }
    
    .footer-right {
        width: 100%;
        justify-content: center;
        gap: 0.8rem;
    }

    /* 防止手機版出現水平滾動 */
    .nav-menu { overflow-x: hidden; pointer-events: none; }
    .nav-menu.active { pointer-events: auto; }
    .carousel-container, .photo-frame, .carousel { max-width: 100%; overflow: hidden; }
}

@media (max-width: 768px) {
    .navbar {
        padding: 0.5rem 0;
    }
    
    .nav-logo .logo-img {
        height: 50px;
        width: auto;
        max-width: 280px;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    
    .main-content {
        margin-top: 78px;
    }
    
    .floating-buttons {
        bottom: 84px;
        right: 25px;
        gap: 12px;
    }

    .chat-float-container {
        bottom: 20px !important;
        right: 25px !important;
    }
    
    .carousel-container {
        max-width: 380px;
    }
    
    .photo-frame {
        width: 380px;
        height: 307px;
        padding: 9px;
    }
    
    .carousel {
        width: 362px;
        height: 289px;
    }
}

@media (max-width: 480px) {
    /* Highlights Section 小屏幕調整 */
    .highlights-section {
        margin-bottom: 2.5rem;
        padding: 0 10px;
    }
    
    .highlights-container {
        gap: 0.5rem;
        padding: 0 5px;
    }
    
    .highlight-card {
        padding: 1rem 0.5rem;
        border-radius: 15px;
    }
    
    .highlight-icon {
        width: 80px;
        height: 80px;
        padding: 4px;
        border-radius: 12px;
        margin-bottom: 0.65rem;
    }
    
    .highlight-image {
        width: 66px;
        height: 66px;
        border-radius: 8px;
    }
    
    .highlight-title {
        font-size: 0.9rem;
        margin-bottom: 0.4rem;
    }
    
    .highlight-description {
        font-size: 0.75rem;
        line-height: 1.45;
    }
    
    .navbar {
        padding: 0.4rem 0;
    }
    
    .nav-container {
        padding: 0 15px;
    }
    
    .nav-logo .logo-img {
        height: 40px;
        width: auto;
        max-width: 220px;
    }
    
    .btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
    }
    
    /* 更小屏幕的按鈕調整 */
    .nav-actions {
        gap: 0.4rem;
    }
    
    .nav-auth-actions {
        gap: 0.5rem;
    }
    
    .nav-auth-actions .btn {
        padding: 0.4rem 0.7rem;
        font-size: 0.7rem;
    }
    
    .main-content {
        margin-top: 72px;
    }
    
    .floating-buttons {
        bottom: 72px;
        right: 16px;
        gap: 10px;
    }

    .chat-float-container {
        bottom: 16px !important;
        right: 16px !important;
    }

    .chat-float-button {
        width: 48px !important;
        height: 48px !important;
    }
    
    .back-to-top, .discord-float {
        width: 48px;
        height: 48px;
        font-size: 16px;
    }
    
    .carousel-container {
        max-width: 320px;
        margin-left: auto;
        margin-right: auto; /* 小螢幕仍確保置中 */
    }
    
    .photo-frame {
        width: 320px;
        height: 259px;
        padding: 8px;
        margin-left: auto;
        margin-right: auto; /* 小螢幕仍確保置中 */
    }
    
    .carousel {
        width: 304px;
        height: 243px;
    }
    
    .feature-content {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
        padding: 0 4px 0.25rem;
    }
    
    .feature-item img {
        max-width: 100%;
        width: 100%;
        height: auto;
        margin: 0 auto;
        display: block;
    }
    
    .feature-links {
        flex-direction: column;
        gap: 1.5rem;
        align-items: center;
    }
    
    .feature-link img {
        max-width: 360px;
        height: auto;
    }
    
    .gallery-section {
        padding: 1.35rem 0.85rem 1.5rem;
        margin-bottom: 1rem;
    }
    
    .bottom-background {
        margin-top: -40px;
    }

    /* 防止更小螢幕橫向溢出 */
    .nav-menu { overflow-x: hidden; }
    .carousel-container, .photo-frame, .carousel { max-width: 100%; overflow: hidden; }
}

/* Loading Animation */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #6F8FC9, #3B5998);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loading.hide {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Download Guide Modal */
.download-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.download-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.download-guide-modal {
    background: linear-gradient(165deg, var(--ms-oak-mid) 0%, var(--ms-oak) 100%);
    border-radius: 16px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    position: relative;
    transform: scale(0.8) translateY(-30px);
    transition: all 0.3s ease;
    box-shadow: var(--ms-shadow-deep);
    border: 2px solid var(--ms-gold-bronze);
    overflow: hidden;
}

.download-modal-overlay.show .download-guide-modal {
    transform: scale(1) translateY(0);
}

.download-guide-header {
    background: rgba(0, 0, 0, 0.2);
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(229, 184, 66, 0.35);
}

.download-guide-title {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.download-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.download-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.download-guide-content {
    padding: 2rem;
}

.download-guide-info {
    text-align: center;
    margin-bottom: 2rem;
}

.download-guide-info p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 0.8rem;
}

.download-guide-info strong {
    color: #ffd700;
    font-weight: 600;
}

.download-guide-actions {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.download-action-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.download-action-item h4 {
    color: #ffd700;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.download-action-btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 25px;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.discord-btn {
    background: linear-gradient(45deg, #7289da, #5865f2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    max-width: 200px;
    margin: 0 auto;
}

.discord-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(114, 137, 218, 0.4);
}

.game-btn {
    background: transparent;
    padding: 0;
    display: block;
    max-width: 250px;
    margin: 0 auto;
}

.download-btn-img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.game-btn:hover .download-btn-img {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(111, 143, 201, 0.4);
}

.download-note {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    margin: 0.5rem 0 0 0;
    font-style: italic;
}

/* ?��?式設�?*/
@media (max-width: 768px) {
    .download-guide-modal {
        max-width: 95%;
        margin: 1rem;
    }
    
    .download-guide-header {
        padding: 1rem 1.5rem;
    }
    
    .download-guide-title {
        font-size: 1.3rem;
    }
    
    .download-guide-content {
        padding: 1.5rem;
    }
    
    .download-action-item {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .download-guide-header {
        padding: 1rem;
    }
    
    .download-guide-title {
        font-size: 1.2rem;
    }
    
    .download-guide-content {
        padding: 1rem;
    }
    
    .download-guide-info p {
        font-size: 0.9rem;
    }
    
    /* Banner 手機版：貼齊寬度、消除上下留白 */
    .banner-section {
        padding-top: 0;
        margin-bottom: 1.5rem;
        width: 100%;
        max-width: none;
        border-radius: 0;
    }

    .banner-img-desktop {
        display: none;
    }

    .banner-img-mobile {
        display: block;
        max-width: 100%;
        border-radius: 0;
        border: none;
        box-shadow: none;
    }

    .banner-section::after {
        font-size: 0.65rem;
        padding: 0.4rem 0.85rem;
        bottom: 12px;
        right: 12px;
        letter-spacing: 0.02em;
    }

    .banner-img-mobile:hover {
        transform: none;
    }

    /* Award Section 手機版調整 */
    .award-section {
        padding: 1rem 0;
        margin-bottom: 2rem;
    }
    
    .award-divider {
        margin-bottom: 1rem;
    }
    
    .award-divider-img {
        max-height: 60px;
    }
    
    .award-content-img {
        border-radius: 10px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    }
}



@media (max-width: 360px) {
    .carousel-container {
        max-width: 290px;
    }
    
    .photo-frame {
        width: 290px;
        height: 235px;
        padding: 7px;
    }
    
    .carousel {
        width: 276px;
        height: 221px;
    }
}

/* 官方網站聲明 */
.official-notice {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    padding: 14px 20px;
    text-align: center;
    border-bottom: 3px solid #4caf50;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.15);
    position: relative;
    z-index: 100;
}

.official-notice-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.official-notice i {
    color: #2e7d32;
    font-size: 1.2rem;
}

.official-text {
    color: #1b5e20;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.official-text strong {
    font-weight: 700;
    color: #2e7d32;
}

.official-divider {
    color: #66bb6a;
    font-weight: 300;
}

.official-text a {
    color: #1976d2;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.official-text a:hover {
    color: #0d47a1;
    text-decoration: underline;
}

@media (max-width: 768px) {
    .official-notice {
        padding: 12px 15px;
    }
    
    .official-text {
        font-size: 0.85rem;
        justify-content: center;
    }
    
    .official-notice i {
        font-size: 1rem;
    }
}

/* 法律頁面（隱私權政策、使用條款） */
.legal-page {
    padding: 2rem 0 3rem;
    min-height: 60vh;
}

.legal-page .container {
    max-width: 820px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

.legal-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    color: rgba(45, 31, 23, 0.65);
}

.legal-breadcrumb a {
    color: #3B5998;
    text-decoration: none;
}

.legal-breadcrumb a:hover {
    text-decoration: underline;
}

.legal-breadcrumb .sep {
    color: rgba(45, 31, 23, 0.35);
}

.legal-title {
    font-size: 1.75rem;
    color: #2D1F17;
    margin-bottom: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legal-title i {
    color: #E8C46B;
}

.legal-meta {
    color: rgba(45, 31, 23, 0.55);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.legal-content {
    background: #fff;
    border-radius: 12px;
    padding: 1.75rem 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    line-height: 1.75;
    color: #444;
}

.legal-intro {
    font-size: 1rem;
    color: #555;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.legal-content h2 {
    font-size: 1.15rem;
    color: #2D1F17;
    margin: 1.5rem 0 0.65rem;
}

.legal-content h2:first-of-type {
    margin-top: 0;
}

.legal-content p {
    margin-bottom: 0.75rem;
}

.legal-content ul {
    margin: 0.5rem 0 1rem 1.25rem;
    padding: 0;
}

.legal-content li {
    margin-bottom: 0.45rem;
}

.legal-content a {
    color: #3B5998;
    text-decoration: none;
}

.legal-content a:hover {
    text-decoration: underline;
}

.legal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1.75rem;
}

.legal-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.legal-btn-primary {
    background: linear-gradient(135deg, #E8C46B, #A9761F);
    color: #fff;
}

.legal-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(232, 196, 107, 0.35);
    color: #fff;
}

.legal-btn-outline {
    background: #fff;
    color: #E8C46B;
    border: 2px solid #E8C46B;
}

.legal-btn-outline:hover {
    background: rgba(232, 196, 107, 0.08);
    color: #E8C46B;
}

@media (max-width: 768px) {
    .legal-content {
        padding: 1.25rem 1rem;
    }

    .legal-title {
        font-size: 1.4rem;
    }
}

/* ============================================================
   全站按鈕壓感後備樣式（未自訂 active 狀態的元件套用此效果）
   ============================================================ */
button:active,
a.btn:active,
input[type="submit"]:active,
input[type="button"]:active {
    filter: brightness(0.96);
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 行動裝置：background-attachment: fixed 可能造成捲動卡頓，改為 scroll */
@media (max-width: 768px) {
    body {
        background-attachment: scroll, scroll, scroll;
    }
}

/* =========================================================
   首頁排版 — 參考 Nexon MapleStory 官方站呈現
   https://www.nexon.com/maplestory/
   重點：天藍底、木框 Hero、金黃 Featured 框、白卡片網格、深藍全幅區塊
   ========================================================= */

/* 全站捲動背景：維持比例全寬；fixed 層 + JS 依捲動進度上下平移（含手機）
   必須清掉舊 body 深色漸層遮罩（rgba(20,13,9)）與 background.png */
body.has-site-scroll-bg,
body:has(.site-scroll-bg) {
    background: #73CAFE none !important;
    background-color: #73CAFE !important;
    background-image: none !important;
    background-blend-mode: normal !important;
    background-attachment: scroll !important;
    min-height: 100vh;
}

body.has-site-scroll-bg.page-inner,
body:has(.site-scroll-bg--inner) {
    background: #143055 none !important;
    background-color: #143055 !important;
}

body.has-site-scroll-bg::before,
body:has(.site-scroll-bg)::before {
    display: none !important;
    content: none !important;
    opacity: 0 !important;
    background: none !important;
}

.site-scroll-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    background-color: #73CAFE;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.site-scroll-bg--inner {
    background-color: #143055;
}

.site-scroll-bg__img {
    display: block;
    width: 100%;
    height: auto;
    max-width: none;
    will-change: transform;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
}

.home-page {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 1rem 20px 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 2.25rem;
    position: relative;
    z-index: 1;
    overflow: visible;
}

.home-panel-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.25rem;
    margin-bottom: 1.35rem;
    flex-wrap: wrap;
}

.home-panel-head--center {
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.home-panel-head--light .home-panel-title,
.home-panel-head--light .home-panel-desc {
    color: #F4E8C1;
}

.home-panel-head--light .home-panel-desc {
    color: rgba(244, 232, 193, 0.82);
}

.home-kicker {
    display: inline-block;
    margin-bottom: 0.45rem;
    padding: 0.28rem 0.85rem;
    border-radius: 999px;
    background: #2D1F17;
    color: #FFF8E7;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.home-panel-title {
    margin: 0 0 0.35rem;
    font-size: clamp(1.55rem, 2.6vw, 2.15rem);
    font-weight: 800;
    color: #2A2A2A;
    line-height: 1.2;
    letter-spacing: 0.02em;
}

.home-panel-desc {
    margin: 0;
    color: rgba(42, 42, 42, 0.72);
    font-size: 0.98rem;
    max-width: 42rem;
}

/* Hero：木框（官方 carousel-banner-frame #D39F77）+ 天藍底 */
.home-hero {
    margin: 0;
    /* 預留外框上方裝飾空間，避免被切到 */
    padding: clamp(56px, 7vw, 100px) 0 0;
    position: relative;
    z-index: 2;
    overflow: visible;
}

/* 貼在 home-hero-frame 外框頂邊上（右上） */
.home-hero-deco {
    position: absolute;
    right: clamp(10px, 2.5vw, 28px);
    bottom: 100%;
    z-index: 6;
    width: clamp(240px, 34vw, 440px);
    height: auto;
    max-width: 58%;
    margin-bottom: -6px; /* 微微壓在外框頂邊 */
    pointer-events: none;
    user-select: none;
    filter: drop-shadow(0 8px 16px rgba(20, 48, 85, 0.28));
}

.home-hero-frame {
    background: #73CAFE;
    border-radius: 18px;
    padding: 18px 18px 0;
    box-shadow: 0 16px 40px rgba(20, 48, 85, 0.22);
    position: relative;
    z-index: 1;
    overflow: visible;
}

.home-hero-media {
    position: relative;
    line-height: 0;
    background: #D39F77;
    border-radius: 12px;
    padding: 10px;
    box-shadow: inset 0 0 0 2px rgba(118, 53, 82, 0.18);
}

.home-hero-img {
    width: 100%;
    height: auto;
    border: none !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    max-width: none !important;
    margin: 0 !important;
}

/* 不可用 .home-hero-img { display:block } 蓋掉手機圖隱藏 */
.home-hero .banner-img-desktop {
    display: block;
}

.home-hero .banner-img-mobile {
    display: none;
}

.home-hero-badge {
    position: absolute;
    right: 22px;
    bottom: 22px;
    z-index: 2;
    background: linear-gradient(180deg, #FF9A3C, #E85D04);
    color: #fff;
    font-weight: 800;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    padding: 0.55rem 1.2rem;
    border-radius: 999px;
    border: 2px solid #fff;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
    pointer-events: none;
    white-space: nowrap;
}

.home-hero-bar {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 1.25rem;
    align-items: center;
    padding: 1.25rem 0.85rem 1.35rem;
}

.home-hero-eyebrow {
    margin: 0 0 0.3rem;
    color: #143055;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.home-hero-title {
    margin: 0 0 0.35rem;
    color: #143055;
    font-size: clamp(1.4rem, 2.3vw, 1.9rem);
    font-weight: 800;
    line-height: 1.25;
}

.home-hero-desc {
    margin: 0;
    color: rgba(20, 48, 85, 0.78);
    font-size: 0.95rem;
}

.home-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    justify-content: flex-end;
}

.home-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.78rem 1.25rem;
    border-radius: 999px;
    font-weight: 800;
    font-size: 0.92rem;
    text-decoration: none;
    border: 2px solid transparent;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap;
}

.home-btn:hover { transform: translateY(-2px); }
.home-btn--sm { padding: 0.55rem 1rem; font-size: 0.85rem; }

.home-btn--play,
.home-btn--gold {
    background: linear-gradient(180deg, #FF9A3C, #E85D04);
    color: #fff;
    border-color: #fff;
    box-shadow: 0 8px 18px rgba(232, 93, 4, 0.35);
}

.home-btn--wood {
    background: rgba(255, 255, 255, 0.92);
    color: #143055;
    border-color: rgba(20, 48, 85, 0.2);
}

.home-btn--discord {
    background: linear-gradient(180deg, #7289da, #5865f2);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.65);
}

/* Featured 金黃大框（官方 #FFB72D） */
.home-frame {
    border-radius: 22px;
    padding: 1.35rem;
    position: relative;
    z-index: 2;
    box-shadow: 0 18px 44px rgba(20, 48, 85, 0.14);
}

.home-frame--gold { background: #FFB72D; }

.home-frame--cream {
    background: linear-gradient(180deg, #FFF6E0, #FFE4A8);
    border: 2px solid rgba(211, 159, 119, 0.55);
}

.home-frame-media {
    background: #fff;
    border-radius: 16px;
    padding: 0.85rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.home-frame-media img,
.home-frame-media .award-content-img {
    display: block;
    width: 100%;
    border-radius: 12px;
}

.home-news-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.home-news-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
    min-height: 100%;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.home-news-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.14);
}

.home-news-card__media {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f3f3f3;
}

.home-news-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.home-news-card__body {
    padding: 1rem 1.05rem 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    flex: 1;
}

.home-chip {
    display: inline-flex;
    align-self: flex-start;
    padding: 0.22rem 0.65rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #fff;
}

.home-chip--gold { background: #C4922A; }
.home-chip--blue { background: #3B5998; }
.home-chip--green { background: #3F7D4A; }
.home-chip--orange { background: #B20047; }

.home-news-card .highlight-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: #222;
    line-height: 1.35;
}

.home-news-card .highlight-title::after { display: none; }

.home-news-card .highlight-description {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
    line-height: 1.55;
}

.highlights-container { display: none; }

/* 深藍全幅（官方 maple-heroes #143055） */
.home-bleed {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    position: relative;
    z-index: 2;
}

.home-bleed--navy {
    background:
        radial-gradient(ellipse at 30% 20%, rgba(115, 202, 254, 0.22), transparent 50%),
        linear-gradient(180deg, #143055 0%, #0d223d 100%);
    padding: 2.5rem 0 2.75rem;
    border-top: 3px solid rgba(255, 183, 45, 0.45);
    border-bottom: 3px solid rgba(255, 183, 45, 0.35);
}

.home-bleed-inner {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 20px;
}

.feature-section.home-bleed {
    max-width: none;
    border-radius: 0;
    box-shadow: none;
    border: none;
    backdrop-filter: none;
    background: transparent;
}

.home-feature-mosaic {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    grid-template-rows: none;
    gap: 1rem !important;
    margin: 0 0 1.5rem !important;
    padding: 0 !important;
    align-items: stretch;
}

.home-feature-item {
    margin-top: 0 !important;
    border-radius: 14px;
    overflow: hidden;
    border: 2px solid rgba(255, 183, 45, 0.35);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
    aspect-ratio: auto;
    height: auto;
}

.home-feature-mosaic .feature-item:nth-child(even) {
    margin-top: 0 !important;
}

.home-feature-item--hero {
    grid-row: auto;
    grid-column: auto;
}

.home-feature-item img {
    width: 100%;
    height: auto;
    object-fit: contain;
    object-position: center top;
    display: block;
}

.home-feature-cta {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.home-feature-cta .feature-links {
    width: 100%;
    justify-content: center;
    padding: 0;
}

.home-feature-cta .feature-register-link {
    margin: 0;
    padding: 0;
}

.gallery-section.home-frame {
    max-width: none;
    margin: 0;
}

.home-gallery-grid {
    margin-top: 0.5rem;
    gap: 1.25rem;
    padding: 0 !important;
}

/* 相簿：移除白底卡片外觀 */
.gallery-section .photo-album.home-news-card {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    overflow: visible;
    min-height: 0;
}

.gallery-section .photo-album.home-news-card:hover {
    transform: none;
    box-shadow: none;
}

.home-album-label {
    display: none !important;
}

.homepage-register-container { max-width: 1320px; }

.homepage-register-card {
    border-radius: 22px !important;
    border: 2px solid rgba(211, 159, 119, 0.55) !important;
    box-shadow: 0 18px 44px rgba(20, 48, 85, 0.14) !important;
}

@media (max-width: 1100px) {
    .home-news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 992px) {
    .home-hero-bar {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .home-hero-actions { justify-content: center; }
    .home-feature-mosaic { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

@media (max-width: 768px) {
    .home-page {
        padding: 0.5rem 12px 1.5rem;
        gap: 1.35rem;
    }
    .home-hero {
        padding-top: clamp(44px, 14vw, 72px);
    }
    .home-hero-frame {
        border-radius: 0;
        margin: 0 -12px;
        padding: 10px 10px 0;
    }
    .home-hero-deco {
        right: 8px;
        width: clamp(180px, 52vw, 280px);
        max-width: 72%;
        margin-bottom: -4px;
    }
    .home-hero .banner-img-desktop {
        display: none;
    }
    .home-hero .banner-img-mobile {
        display: block;
    }
    .home-hero-badge {
        font-size: 0.68rem;
        padding: 0.4rem 0.75rem;
        right: 14px;
        bottom: 14px;
    }
    .home-frame { padding: 1rem; border-radius: 16px; }
    .home-news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .home-feature-mosaic { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .home-panel-head { align-items: flex-start; }
    .home-panel-head--center { align-items: center; }
}
/* --- Nexon home: neutralize legacy section skins --- */
.discord-widget-wrap {
    width: 100%;
    height: clamp(560px, 75vh, 800px);
    margin-top: 0.25rem;
    border-radius: 16px;
    overflow: hidden;
    border: 2px solid rgba(211, 159, 119, 0.45);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
    background: #36393f;
}

.discord-widget-wrap widgetbot,
.discord-widget-wrap iframe {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

.home-page .award-section.home-frame,
.home-page .highlights-section.home-frame,
.home-page .gallery-section.home-frame,
.home-page .discord-section.home-frame {
    max-width: none;
    margin: 0;
    padding: 1.35rem;
    text-align: left;
    background: #FFB72D;
    border: none;
    border-radius: 22px;
    box-shadow: 0 18px 44px rgba(20, 48, 85, 0.14);
    backdrop-filter: none;
    animation: none;
}

.home-page .gallery-section.home-frame--cream,
.home-page .discord-section.home-frame--cream {
    background: linear-gradient(180deg, #FFF6E0, #FFE4A8);
    border: 2px solid rgba(211, 159, 119, 0.55);
}

.home-page .highlights-section.home-frame::before,
.home-page .highlights-section.home-frame::after {
    display: none !important;
    content: none !important;
}

.home-page .feature-section.home-bleed {
    max-width: none;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    margin-top: 0;
    margin-bottom: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    backdrop-filter: none;
    animation: none;
}

.home-page .home-feature-item:hover {
    transform: translateY(-4px) scale(1.01);
}

.home-page .home-feature-item img {
    filter: none;
}

.home-page .gallery-container.home-gallery-grid {
    gap: 1.25rem;
    margin-top: 0.5rem;
    padding: 0;
}

.home-page .gallery-section .photo-album {
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.home-page .award-content.home-frame-media {
    margin-bottom: 0;
}

.home-page .home-btn {
    text-decoration: none !important;
}

/* =========================================================
   手機版修正：漢堡鈕不溢出、隱藏捲動背景、DC 懸浮鈕位置
   ========================================================= */
@media (max-width: 768px) {
    .nav-container {
        width: 100%;
        max-width: 100%;
        padding: 0 12px;
        gap: 0.45rem;
        box-sizing: border-box;
        overflow: hidden;
    }

    .nav-logo {
        flex-shrink: 1;
        min-width: 0;
    }

    .nav-logo .logo-img {
        height: 40px !important;
        max-width: 110px !important;
    }

    /* Online 燈號改由選單內看；頂欄讓出空間給漢堡鈕 */
    .nav-actions .ms-online-pill {
        display: none !important;
    }

    .nav-actions {
        flex: 1 1 auto;
        flex-shrink: 1;
        min-width: 0;
        margin-left: 0;
        justify-content: flex-end;
        gap: 0.35rem;
        overflow: hidden;
    }

    .nav-auth-actions {
        min-width: 0;
    }

    .nav-auth-actions .btn,
    .nav-auth-actions .btn.btn-auth-combined,
    .nav-auth-actions .btn.btn-user-account {
        max-width: 100%;
        padding: 0.4rem 0.65rem !important;
        font-size: 0.72rem !important;
        white-space: nowrap;
    }

    .nav-auth-actions .btn-user-account .username {
        max-width: 4.5rem !important;
    }

    .nav-toggle {
        display: flex !important;
        flex-shrink: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        position: relative !important;
        z-index: 1002;
        padding: 6px;
    }

    /* 手機不顯示全站捲動背景圖 */
    .site-scroll-bg {
        display: none !important;
    }

    body.has-site-scroll-bg,
    body.has-site-scroll-bg.page-home,
    body.has-site-scroll-bg.page-inner,
    body:has(.site-scroll-bg) {
        background-image: none !important;
        background-color: #73CAFE !important;
    }

    body.has-site-scroll-bg.page-inner {
        background-color: #143055 !important;
    }

    /* 右側懸浮：TOP → DC 在上，客服在最下 */
    .floating-buttons {
        bottom: 76px !important;
        right: 14px !important;
        gap: 10px !important;
        flex-direction: column !important;
    }

    .back-to-top,
    .discord-float {
        width: 48px !important;
        height: 48px !important;
        font-size: 17px !important;
    }

    .chat-float-container {
        bottom: 16px !important;
        right: 14px !important;
    }

    .chat-float-button {
        width: 48px !important;
        height: 48px !important;
    }
}

@media (max-width: 480px) {
    .nav-logo .logo-img {
        height: 36px !important;
        max-width: 96px !important;
    }

    .floating-buttons {
        bottom: 70px !important;
        right: 12px !important;
        gap: 10px !important;
    }

    .chat-float-container {
        bottom: 14px !important;
        right: 12px !important;
    }

    .back-to-top,
    .discord-float,
    .chat-float-button {
        width: 44px !important;
        height: 44px !important;
        font-size: 15px !important;
    }
}
