* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 牌桌同款色板（与 game.html 的 body/#1a1f2b、面板 #252b38、金 #d9a441 对齐）。
       2026-10-25 由「墨韵」浅色宣纸版改为深色牌桌版，首页/大厅/房间三处保持一致。 */
    --bg: #1a1f2b;          /* 页面底色 = 房间 body */
    --bg-deep: #141823;     /* 顶栏 / footer / 表头 = 房间 top-bar */
    --surface: #252b38;     /* 卡片 / 面板 = 房间座位 */
    --surface-2: #1f2530;   /* 次级分区底 */
    --line: #3d465a;        /* 描边 = 房间面板边框 */
    --gold: #d9a441;        /* 强调金 = 房间 play-center-label */
    --gold-light: #e8c069;
    --gold-dim: rgba(217, 164, 65, 0.22);
    --red: #f44336;         /* 房间的确认红 */
    --text: #e6eaf2;        /* 主文字 */
    --text-light: #9aa4b8;  /* 次要文字 */
    --heading: #f2f4f8;     /* 标题 */

    /* 兼容旧变量名：结构没动，只换值，避免漏改造成不可见的深底深字 */
    --primary: #141823;
    --primary-dark: #11151e;
    --primary-light: #252b38;
    --gold-ink: #9c6a2f;
    --cinnabar: #d9a441;
    --cinnabar-light: #e8c069;
    --white: #ffffff;
    --gray: #9aa4b8;
    --light-gray: #1f2530;
    --paper: #1a1f2b;
    --paper-card: #252b38;
}

body {
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    background: var(--bg);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========== Navbar ========== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(20, 24, 35, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    transition: all 0.3s;
    border-bottom: 1px solid var(--gold-dim);
}

.navbar.scrolled {
    background: rgba(20, 24, 35, 0.98);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.45);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--gold);
    display: flex;
    align-items: center;
}

.logo .logo-img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(217, 164, 65, 0.45);
    box-shadow: 0 0 8px rgba(217, 164, 65, 0.18);
}

.logo span {
    margin-left: 8px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
    align-items: center;
}

.nav-menu a {
    color: #fff;
    text-decoration: none;
    font-size: 15px;
    transition: color 0.3s;
}

.nav-menu a:hover {
    color: var(--gold);
}

.nav-play {
    background: var(--gold);
    color: #1a1f2b !important;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: bold;
    transition: all 0.3s;
}

.nav-play:hover {
    background: var(--gold-light);
    transform: scale(1.05);
}

.nav-login {
    background: transparent;
    color: var(--gold) !important;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: bold;
    border: 1px solid var(--gold);
    margin-right: 8px;
    transition: all 0.3s;
}
.nav-login:hover {
    background: rgba(217, 164, 65, 0.12);
    transform: scale(1.05);
}

/* ========== Hero Section ========== */
.hero {
    min-height: 100vh;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(217, 164, 65, 0.10) 0%, transparent 55%),
        linear-gradient(180deg, var(--bg-deep) 0%, var(--bg) 60%, #202635 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding-top: 80px;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(217, 164, 65, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(217, 164, 65, 0.06) 0%, transparent 50%);
}

.hero-content {
    text-align: center;
    z-index: 1;
    padding: 40px 20px;
}

.floating-cards {
    position: relative;
    width: 300px;
    height: 120px;
    margin: 0 auto 40px;
}

.card-fan {
    position: absolute;
    width: 50px;
    height: 80px;
    background: #fdfbf6;
    border-radius: 7px;
    border: 1px solid #d8cdb6;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
    animation: float 3s ease-in-out infinite;
}

.card-fan.c1 { left: 30px; top: 10px; animation-delay: 0s; }
.card-fan.c2 { left: 90px; top: 30px; animation-delay: 0.5s; }
.card-fan.c3 { left: 150px; top: 20px; animation-delay: 1s; }
.card-fan.c4 { left: 210px; top: 40px; animation-delay: 1.5s; }

/* 用 CSS 圆点拼出骨牌点数。注释与源码中均不使用牌类 emoji。 */
.card-fan::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #b0342a;
    box-shadow: 0 -14px 0 #2b2622, 0 14px 0 #2b2622;
}

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

.hero-title {
    margin-bottom: 20px;
}

.title-main {
    display: block;
    font-size: 64px;
    font-weight: bold;
    color: var(--gold);
    text-shadow: 0 0 30px rgba(217, 164, 65, 0.35);
    letter-spacing: 10px;
}

.title-sub {
    display: block;
    font-size: 28px;
    color: #fff;
    margin-top: 10px;
    letter-spacing: 5px;
}

.hero-desc {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 40px;
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 60px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
    font-family: inherit;
}

.btn-lg {
    padding: 18px 40px;
    font-size: 18px;
}

.btn-xl {
    padding: 22px 50px;
    font-size: 20px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: #1a1f2b;
    box-shadow: 0 5px 20px rgba(217, 164, 65, 0.30);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(217, 164, 65, 0.45);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.10);
    color: var(--text);
    border: 2px solid rgba(255, 255, 255, 0.24);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: var(--gold);
    color: var(--gold-light);
    transform: translateY(-3px);
}

.btn-outline {
    background: transparent;
    color: var(--gold);
    border: 2px solid var(--gold);
}

.btn-outline:hover {
    background: var(--gold);
    color: #1a1f2b;
}

.btn-arrow {
    transition: transform 0.3s;
}

.btn-primary:hover .btn-arrow {
    transform: translateX(5px);
}

.hero-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    background: rgba(0, 0, 0, 0.28);
    padding: 20px 40px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid var(--gold-dim);
}

.stat-item {
    text-align: center;
}

.stat-num {
    display: block;
    font-size: 32px;
    font-weight: bold;
    color: var(--gold);
}

.stat-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.stat-divider {
    width: 1px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
}

.hero-scroll {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    animation: bounce 2s infinite;
}

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

/* ========== Section Title ========== */
.section-title {
    text-align: center;
    font-size: 36px;
    color: var(--heading);
    margin-bottom: 50px;
    position: relative;
    padding-bottom: 20px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: var(--gold);
    border-radius: 2px;
}

/* ========== Features ========== */
.features {
    padding: 100px 0;
    background: var(--bg);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.feature-card {
    background: var(--surface);
    border-radius: 15px;
    padding: 40px 30px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.35);
    transition: all 0.3s;
    border: 1px solid var(--line);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
    border-color: var(--gold);
}

.feature-icon {
    font-size: 48px;
    text-align: center;
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: 24px;
    color: var(--gold-light);
    text-align: center;
    margin-bottom: 15px;
}

.feature-card > p {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 20px;
}

.feature-list {
    list-style: none;
    padding: 0;
}

.feature-list li {
    padding: 8px 0;
    text-align: center;
    color: var(--text-light);
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.feature-list li:first-child {
    border-top: none;
}

/* ========== Rules Preview ========== */
.rules-preview {
    padding: 100px 0;
    background: var(--bg-deep);
}

.rules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.rule-card {
    background: var(--surface);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s;
    border-top: 4px solid transparent;
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.rule-card:hover {
    border-top-color: var(--gold);
    transform: translateY(-5px);
}

.rule-num {
    font-size: 48px;
    font-weight: bold;
    color: rgba(217, 164, 65, 0.20);
    margin-bottom: 15px;
}

.rule-card h3 {
    font-size: 22px;
    color: var(--gold-light);
    margin-bottom: 10px;
}

.rule-card p {
    color: var(--text-light);
}

.rules-more {
    text-align: center;
}

/* ========== Ranking ========== */
.ranking {
    padding: 100px 0;
    background: var(--bg);
}

.ranking-table {
    max-width: 700px;
    margin: 0 auto;
    background: var(--surface);
    border-radius: 15px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.35);
    border: 1px solid var(--line);
    overflow: hidden;
}

.ranking-header {
    display: grid;
    grid-template-columns: 80px 1fr 120px 120px;
    background: var(--bg-deep);
    color: #fff;
    padding: 18px 20px;
    font-weight: bold;
    font-size: 15px;
    border-bottom: 1px solid var(--gold-dim);
}

.ranking-list {
    max-height: 500px;
    overflow-y: auto;
}

.ranking-item {
    display: grid;
    grid-template-columns: 80px 1fr 120px 120px;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.3s;
    align-items: center;
}

.ranking-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.ranking-item.top-1 { background: rgba(217, 164, 65, 0.12); }
.ranking-item.top-2 { background: rgba(192, 192, 192, 0.08); }
.ranking-item.top-3 { background: rgba(156, 106, 47, 0.12); }

.col-rank {
    font-weight: bold;
    color: var(--gold);
}

/* 前三名只用颜色与字重区分，不使用奖牌类 emoji */
.ranking-item.top-1 .col-rank { color: var(--gold); }
.ranking-item.top-2 .col-rank { color: #cfd6e4; }
.ranking-item.top-3 .col-rank { color: #c08a4a; }



.col-player {
    color: var(--text);
    font-weight: 500;
}

.col-score {
    color: var(--gold-light);
    font-weight: bold;
}

.col-win {
    color: var(--text-light);
}

/* 表头是深色底，列名必须用浅色。
   原先 .col-rank / .col-player / .col-score 在浅底列表里是深色，
   但同一个类也用在深色表头上，导致「排名」「玩家」等字与底同色、完全看不见。 */
.ranking-header .col-rank,
.ranking-header .col-player,
.ranking-header .col-score,
.ranking-header .col-win {
    color: #fff;
}

.ranking-loading {
    padding: 40px;
    text-align: center;
    color: var(--text-light);
}

.ranking-tip {
    text-align: center;
    /* 深底上 --text-light(#9aa4b8) 对 #1a1f2b 约 5.6:1，13px 正文达标 */
    color: var(--text-light);
    font-size: 13px;
    margin-top: 20px;
}

/* ========== CTA Section ========== */
.cta {
    padding: 80px 0;
    background:
        radial-gradient(ellipse at 50% 100%, rgba(217, 164, 65, 0.10) 0%, transparent 60%),
        linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
    text-align: center;
    border-top: 1px solid var(--gold-dim);
}

.cta h2 {
    font-size: 36px;
    color: var(--gold);
    margin-bottom: 15px;
}

.cta p {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 30px;
}

.cta .btn-primary {
    background: var(--gold);
    color: #1a1f2b;
}

/* ========== Footer ========== */
.footer {
    background: var(--bg-deep);
    color: rgba(255, 255, 255, 0.7);
    padding: 60px 0 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand .logo-sm {
    font-size: 20px;
    font-weight: bold;
    color: var(--gold);
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-brand .logo-img-sm {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(217, 164, 65, 0.32);
}

.footer-brand p {
    margin-top: 10px;
    font-size: 14px;
}

.footer-links h4,
.footer-contact h4,
.footer-share h4 {
    color: #fff;
    margin-bottom: 15px;
    font-size: 15px;
}

.footer-links a {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    margin-bottom: 8px;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--gold);
}

.share-buttons {
    display: flex;
    gap: 10px;
}

.share-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 13px;
}

.share-btn:hover {
    background: rgba(217, 164, 65, 0.2);
    border-color: var(--gold);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 13px;
}

/* ========== Hamburger Menu ========== */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 5px;
    background: none;
    border: none;
    z-index: 1001;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--gold);
    border-radius: 2px;
    transition: all 0.3s;
}

.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .hamburger { display: flex; }
    
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        max-width: 300px;
        height: 100vh;
        background: var(--primary-dark);
        flex-direction: column;
        padding: 80px 30px 30px;
        gap: 20px;
        transition: right 0.3s ease;
        z-index: 1000;
        border-left: 1px solid rgba(217, 164, 65, 0.2);
    }
    
    .nav-menu.open {
        right: 0;
    }
    
    .nav-menu a {
        font-size: 18px;
    }
    
    .nav-play {
        display: inline-block !important;
        text-align: center;
        padding: 12px 20px !important;
    }
    
    .nav-login {
        display: inline-block !important;
        text-align: center;
        padding: 12px 20px !important;
        margin-right: 0;
    }
    
    .nav-menu a:not(.nav-play):not(.nav-login) { display: block; }
    
    .title-main {
        font-size: 42px;
        letter-spacing: 5px;
    }
    
    .title-sub {
        font-size: 20px;
    }
    
    .hero-desc {
        font-size: 16px;
    }
    
    .hero-stats {
        gap: 20px;
        padding: 15px 25px;
    }
    
    .stat-num {
        font-size: 24px;
    }
    
    .floating-cards {
        transform: scale(0.7);
    }
    
    .section-title {
        font-size: 28px;
    }
    
    .features,
    .rules-preview,
    .ranking {
        padding: 60px 0;
    }
    
    .ranking-header,
    .ranking-item {
        grid-template-columns: 60px 1fr 80px 80px;
        font-size: 13px;
        padding: 12px 15px;
    }
    
    .col-win {
        display: none;
    }
    
    .ranking-header .col-win {
        display: none;
    }
    
    .footer-content {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-lg {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 15px;
    }
    
    .stat-divider {
        width: 40px;
        height: 1px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
}
