/* style.css */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f7f9fc;
    color: #444;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    min-height: 100vh;
}

/* ✅ 覆盖 index.html 中的内联样式，强制居中 */
.logo {
    position: static !important;
    margin: 0 auto !important;
    max-width: 150px;
    height: auto;
    display: block;
    margin-bottom: 20px;
}

h1 {
    color: #8b0000;
    font-weight: 600;
    font-size: 2.5em;
    margin-bottom: 20px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.05);
    padding-top: 20px;
    text-align: center;
}

/* ✅ 顶部导航条样式 */
.top-nav {
    width: 100vw;
    background-color: #8B0000;
    text-align: center;
    padding: 15px 0;
    margin-bottom: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.nav-item {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1em;
    margin: 0 20px;
    transition: color 0.3s ease;
}

.nav-item:hover {
    color: #f0f0f0;
    text-decoration: underline;
}

.leaderboard-container, .details-container {
    background: linear-gradient(145deg, #ffffff, #e6e6e6);
    border-radius: 20px;
    box-shadow: 10px 10px 30px rgba(0, 0, 0, 0.1), -10px -10px 30px rgba(255, 255, 255, 0.8);
    padding: 40px 30px;
    width: 90%;
    max-width: 800px;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin: 0 auto; 
}

.leaderboard-container:hover, .details-container:hover {
    transform: translateY(-5px);
    box-shadow: 15px 15px 40px rgba(0, 0, 0, 0.15), -15px -15px 40px rgba(255, 255, 255, 0.8);
}

.search-container {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#searchInput {
    width: 100%;
    max-width: 300px;
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    background-color: #f0f2f5;
    box-shadow: inset 2px 2px 5px rgba(0, 0, 0, 0.1), inset -2px -2px 5px rgba(255, 255, 255, 0.7);
    outline: none;
    font-size: 1em;
    color: #666;
    transition: box-shadow 0.3s ease;
}

#searchInput:focus {
    box-shadow: inset 2px 2px 5px rgba(0, 0, 0, 0.1), inset -2px -2px 5px rgba(255, 255, 255, 0.7), 0 0 5px #8b0000;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
}

thead th {
    font-size: 1em;
    color: #8b0000;
    padding: 15px;
    text-align: left;
    background-color: rgba(139, 0, 0, 0.05);
    border-radius: 10px;
}

tbody tr {
    background-color: #f7f9fc;
    border-radius: 15px;
    box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.05), -5px -5px 10px rgba(255, 255, 255, 0.5);
    transition: transform 0.8s ease-in-out, box-shadow 0.2s ease-in-out;
    cursor: pointer;
}

tbody tr:not(:last-child) {
    margin-bottom: 10px;
}

tbody tr:hover {
    transform: scale(1.02);
    box-shadow: 8px 8px 15px rgba(0, 0, 0, 0.1), -8px -8px 15px rgba(255, 255, 255, 0.7);
}

tbody tr td {
    padding: 15px;
    border: none;
    font-weight: 500;
    color: #444;
}

tbody tr td:first-child {
    border-top-left-radius: 15px;
    border-bottom-left-radius: 15px;
}

tbody tr td:last-child {
    border-top-right-radius: 15px;
    border-bottom-right-radius: 15px;
}

.first-place {
    background: linear-gradient(45deg, #ffd700, #ffc800);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
    animation: first-place-pulse 2s infinite alternate ease-in-out;
}

.first-place td {
    color: #8b0000;
    font-weight: bold;
    font-size: 1.1em;
    padding: 20px 15px;
}

.second-place {
    background: linear-gradient(45deg, #a90000, #8b0000);
    box-shadow: 0 4px 15px rgba(139, 0, 0, 0.4);
    color: #fff;
}

.third-place {
    background: linear-gradient(45deg, #a90000, #8b0000);
    box-shadow: 0 4px 15px rgba(139, 0, 0, 0.4);
    color: #fff;
}

.first-place td, .second-place td, .third-place td {
    background-color: transparent;
}

.second-place td, .third-place td {
    color: #fff;
}

@keyframes first-place-pulse {
    0% { box-shadow: 0 0 15px rgba(255, 215, 0, 0.8), 0 4px 15px rgba(255, 215, 0, 0.4); }
    50% { box-shadow: 0 0 25px rgba(255, 215, 0, 1), 0 4px 20px rgba(255, 215, 0, 0.6); }
    100% { box-shadow: 0 0 15px rgba(255, 215, 0, 0.8), 0 4px 15px rgba(255, 215, 0, 0.4); }
}

.highlight { animation: highlight-fade 2s ease-out forwards; }

@keyframes highlight-fade {
    0% { background-color: rgba(139, 0, 0, 0.2); }
    100% { background-color: #f7f9fc; }
}

.rank-up-effect { animation: rank-up-flash 1s ease-in-out; }

@keyframes rank-up-flash {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.rank-change {
    font-size: 0.8em;
    font-weight: bold;
    margin-left: 5px;
}

.rank-up { color: green; }
.rank-down { color: red; }

.pagination {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.pagination button {
    background: linear-gradient(145deg, #f0f2f5, #e0e2e5);
    border: none;
    border-radius: 15px;
    padding: 10px 20px;
    font-size: 1em;
    color: #8b0000;
    cursor: pointer;
    box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.1), -5px -5px 10px rgba(255, 255, 255, 0.7);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pagination button:hover {
    transform: translateY(-2px);
    box-shadow: 8px 8px 15px rgba(0, 0, 0, 0.15), -8px -8px 15px rgba(255, 255, 255, 0.9);
}

.pagination button:disabled {
    cursor: not-allowed;
    background-color: #e0e2e5;
    color: #aaa;
    box-shadow: inset 2px 2px 5px rgba(0, 0, 0, 0.1), inset -2px -2px 5px rgba(255, 255, 255, 0.7);
}

.back-button {
    display: inline-block;
    padding: 12px 25px;
    background: linear-gradient(145deg, #a90000, #8b0000);
    color: #fff;
    text-decoration: none;
    border-radius: 25px;
    margin-top: 30px;
    box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.back-button:hover {
    transform: translateY(-3px);
    box-shadow: 8px 8px 15px rgba(0, 0, 0, 0.2);
}

#notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

/* --- 动态浮动提醒样式 --- */
#dynamic-alert-container {
    position: fixed;
    bottom: 120px;
    right: 20px;
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-end;
    pointer-events: none;
    z-index: 1000;
}

.notification {
    background-color: #8b0000;
    color: white;
    padding: 10px 20px;
    margin: 5px 0;
    border-radius: 5px;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    animation: slide-in 0.5s forwards, fade-out 0.5s 2.5s forwards;
    white-space: nowrap;
}

/* 进场动画 */
@keyframes slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 出场动画 */
@keyframes slide-out {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-20px);
        opacity: 0;
    }
}

#music-button {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(145deg, #ffffff, #e6e6e6);
    box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.1), -5px -5px 10px rgba(255, 255, 255, 0.7);
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    transition: transform 0.2s ease;
}

#music-button:hover { transform: scale(1.1); }

/* ✅ WhatsApp 悬浮按钮 - 加呼吸动画 */
#buy-now {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #25d366;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1001;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: pulse 2s infinite;
}

#buy-now img {
    width: 30px;
    height: 30px;
}

#buy-now:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ✅ 页脚样式 */
.site-footer {
    width: 100%;
    background-color: #8B0000;
    color: #fff;
    text-align: left;
    padding: 20px 10px 10px;
    margin-top: 20px;
}

.footer-content {
    display: flex;
    flex-wrap: wrap; 
    justify-content: space-between;
    align-items: flex-start;
    max-width: 1000px;
    margin: 0 auto; 
}

.footer-section {
    flex: 1; 
    min-width: 150px; 
    margin: 10px 5px;
    text-align: left; /* 电脑端保持左对齐 */
}

.section-title, .company-name {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 5px;
    color: #fff;
}

.company-name {
    font-size: 1.4em;
}

.footer-section p, .footer-section ul, .footer-section li {
    margin: 0;
    padding: 0;
    list-style: none;
    line-height: 1.5;
    font-size: 1em; /* 电脑端字体调整为 1em */
}

.footer-section a {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: #f0f0f0;
    text-decoration: underline;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    padding-top: 10px;
    margin-top: 10px;
}

/* ✅ 手机端响应式样式 - 仅对小屏幕生效 */
@media (max-width: 600px) {
    .logo {
        max-width: 100px;
        margin-bottom: 15px;
    }

    .leaderboard-container {
        width: 100%; 
        max-width: 100%;
        border-radius: 0;
        padding: 15px 8px;
    }

    h1 { font-size: 1.5em; }

    table { font-size: 12px; }

    th, td {
        white-space: nowrap;
        padding: 6px 4px;
    }

    #buy-now {
        width: 50px;
        height: 50px;
        bottom: 70px;
        right: 15px;
    }

    #buy-now img {
        width: 50px;
        height: 50px;
    }
    
    /* 强制手机端页脚内容居中，并让公司信息换行 */
    .footer-content {
        flex-direction: row; 
        flex-wrap: wrap;
        justify-content: center;
        align-items: flex-start;
    }
    
    .footer-section {
        min-width: auto;
        margin: 10px 0;
        text-align: center; /* 手机端居中对齐 */
    }
    
    /* 强制公司资料独占一行 */
    .footer-section.company-info {
        flex-basis: 100%;
        margin-top: 20px;
    }
    
    /* ✅ 修复手机端空白区域 - 移除页脚顶部外边距 */
    .site-footer {
        margin-top: 0;
    }

    /* 调整手机端页脚内容字体大小 */
    .footer-section p, .footer-section ul, .footer-section li {
        font-size: 0.8em; /* 手机端字体调整为 0.8em，比之前稍大 */
    }

    .section-title, .company-name {
        font-size: 1em; 
    }
}

/* ========== 🔹 新增：积分规则 / 关于我们 / 联系我们 ========== */
#rules, #about, #contact {
    display: none;
    background: #fff;
    padding: 20px;
    margin: 20px auto;
    border-radius: 10px;
    max-width: 600px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* 点击导航时显示对应内容 */
:target#rules,
:target#about,
:target#contact {
    display: block;
}

/* 点击导航时显示对应内容 */
:target#rules,
:target#about,
:target#contact {
    display: block;
}

/* ========== 🔹 新增：悬浮礼物按钮 & 弹窗 ========== */
/* 按钮样式（图片按钮，没有圆圈） */
#gift-button {
    position: fixed;
    bottom: 160px;  /* 调高，避免和 WhatsApp 重叠 */
    right: 20px;
    cursor: pointer;
    z-index: 2100;
    animation: jump-scale 1s infinite; /* 添加跳动动画 */
}
#gift-button img {
    width: 60px;   /* 你可以调整大小 */
    height: auto;
    transition: transform 0.2s ease;
}
#gift-button img:hover {
    transform: scale(1.1);
}

/* 跳动动画 */
@keyframes jump-scale {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-10px) scale(1.1); } /* 跳动高度可调 */
}

/* 弹窗遮罩层 */
#gift-popup {
    display: none; 
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.6);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center; /* 默认电脑端垂直居中 */
}

/* 手机端调整弹窗位置 */
@media (max-width: 600px) {
    #gift-popup {
        align-items: flex-start; /* 顶部对齐 */
        padding-top: 130px;       /* 离顶部距离，可调 */
    }
}

/* 弹出的礼物图片 */
#gift-popup img {
    max-width: 90vw;
    max-height: 80vh;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* 关闭按钮样式 */
#gift-popup .close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #fff;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    font-size: 22px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    transition: background 0.3s ease, transform 0.2s ease;
    z-index: 2101;
}

#gift-popup .close-btn:hover {
    background: #f2f2f2;
    transform: scale(1.1);
}

/* 顾客信息弹窗美化 */
#customer-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
}

#customer-popup.hidden {
    display: none;
}

#customer-popup .popup-content {
    background: #fff;
    padding: 25px 20px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    max-width: 350px;
    width: 90%;
    text-align: center;
    position: relative;
    animation: popup-appear 0.3s ease forwards;
}

#customer-popup h2 {
    color: #8b0000;
    margin-bottom: 15px;
}

#customer-popup p {
    font-size: 1em;
    color: #444;
    margin-bottom: 20px;
}

#customer-popup button {
    background: #8b0000;
    color: #fff;
    border: none;
    padding: 10px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s ease;
}

#customer-popup button:hover {
    transform: scale(1.05);
}

/* 弹窗出现动画 */
@keyframes popup-appear {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* 弹窗背景 */
.popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* 弹窗显示 */
.popup:not(.hidden) {
  opacity: 1;
  pointer-events: auto;
}

/* 弹窗内容 */
.popup-content {
  background: #fff;
  padding: 25px 35px;
  border-radius: 15px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.3);
  text-align: center;
  animation: popup-fade 0.4s ease;
  min-width: 280px;
}

/* 弹窗动画 */
@keyframes popup-fade {
  from { transform: translateY(-30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* 文字排版 */
#popup-text {
  font-size: 18px;
  margin: 15px 0;
  font-weight: 500;
}
#popup-text span.name {
  font-weight: 700;
  color: #2c3e50;
}
#popup-text span.rank {
  color: #2980b9;
  font-weight: 600;
}
#popup-text span.score {
  color: #e74c3c;
  font-weight: 600;
}

/* 关闭按钮 */
.close-btn {
  background: #e74c3c;
  color: #fff;
  border: none;
  padding: 10px 22px;
  border-radius: 25px;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.2s;
}
.close-btn:hover {
  background: #c0392b;
}
/* 顾客信息弹窗美化优化 */
#customer-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    backdrop-filter: blur(6px); /* 背景虚化，更高级 */
}

#customer-popup.hidden {
    display: none;
}

#customer-popup .popup-content {
    background: linear-gradient(145deg, #ffffff, #f7f7f7);
    padding: 35px 25px;
    border-radius: 25px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.25);
    max-width: 400px;
    width: 90%;
    text-align: center;
    position: relative;
    animation: popup-bounce 0.5s ease forwards;
    border: 2px solid #8b0000; /* 红色描边，突出奖励感 */
}

/* 弹出时的轻微弹跳动画 */
@keyframes popup-bounce {
    0% { transform: scale(0.7); opacity: 0; }
    60% { transform: scale(1.05); opacity: 1; }
    100% { transform: scale(1); }
}

#customer-popup h2 {
    color: #8b0000;
    margin-bottom: 15px;
    font-size: 1.8em;
    font-weight: bold;
    text-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

#customer-popup p {
    font-size: 1.1em;
    color: #444;
    margin-bottom: 25px;
    line-height: 1.6;
}

#customer-popup button {
    background: linear-gradient(145deg, #a90000, #8b0000);
    color: #fff;
    border: none;
    padding: 12px 25px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(139,0,0,0.3);
}

#customer-popup button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(139,0,0,0.4);
}

/* 顶部小图标装饰（可选，放个奖杯/礼物图标更喜庆） */
#customer-popup .popup-content::before {
    content: "🎁";
    font-size: 2em;
    display: block;
    margin-bottom: 10px;
    animation: floaty 2s infinite ease-in-out;
}

@keyframes floaty {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}
/* 弹窗标题 */
.popup-content h2 {
  margin-top: 0;
  font-size: 22px;
  font-weight: bold;
  color: #222;
  letter-spacing: 1px;
}

/* 弹窗内容文字 */
.popup-content p {
  margin: 12px 0;
  font-size: 16px;
  line-height: 1.6;
  color: #444;
}

/* 重点提示文字（比如积分差距） */
.popup-content p strong {
  color: #e63946;  /* 红色突出 */
  font-weight: bold;
  font-size: 18px;
}