/* ============================================================
   五抽二 - 游戏样式（翻牌版 - 简单显示/隐藏）
   ============================================================ */

/* ----- 基础重置 ----- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
    min-height: 100vh;
    padding: 20px;
    padding-top: 100px;
    margin: 0;
}

div:empty {
    display: none !important;
}

/* ----- 导航栏（与站点统一） ----- */
body > a:not([href='/xsx']):not([href='/operate']):not([href='/users']) {
    display: inline-block;
    position: fixed;
    top: 0;
    z-index: 1000;
    text-decoration: none;
    padding: 10px 6px;
    font-weight: 600;
    font-size: 0.75rem;
    color: #fff;
    background-color: rgba(52, 73, 94, 0.95);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    text-align: center;
    backdrop-filter: blur(10px);
    height: 45px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body > a:not([href='/xsx']):not([href='/operate']):not([href='/users']):hover {
    background-color: #e74c3c;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

body > a[href='/']:not([href='/xsx']):not([href='/operate']):not([href='/users']) {
    left: 0;
    width: 7%;
    min-width: 50px;
}
body > a[href='/publicShare']:not([href='/xsx']):not([href='/operate']):not([href='/users']) {
    left: 7%;
    width: 11%;
    min-width: 80px;
}
body > a[href='/article']:not([href='/xsx']):not([href='/operate']):not([href='/users']) {
    left: 18%;
    width: 7%;
    min-width: 55px;
}
body > a[href='/essay']:not([href='/xsx']):not([href='/operate']):not([href='/users']) {
    display: none !important;
}
body > a[href='/chat']:not([href='/xsx']):not([href='/operate']):not([href='/users']) {
    left: 25%;
    width: 9%;
    min-width: 65px;
}
body > a[href='/tools']:not([href='/xsx']):not([href='/operate']):not([href='/users']) {
    left: 34%;
    width: 7%;
    min-width: 55px;
}
body > a[href='/games']:not([href='/xsx']):not([href='/operate']):not([href='/users']) {
    left: 41%;
    width: 7%;
    min-width: 55px;
    background-color: #e74c3c;
}
body > a[href='/login']:not([href='/xsx']):not([href='/operate']):not([href='/users']) {
    left: 48%;
    width: 6%;
    min-width: 50px;
}
body > a[href='/signUp']:not([href='/xsx']):not([href='/operate']):not([href='/users']) {
    left: 54%;
    width: 6%;
    min-width: 50px;
}
body > a[href='/comment']:not([href='/xsx']):not([href='/operate']):not([href='/users']) {
    left: 60%;
    width: 11%;
    min-width: 80px;
}

body > a[href='/xsx'] {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1001;
    width: 55px;
    height: 45px;
    background: transparent;
    border: none;
    padding: 0;
    backdrop-filter: none;
}
body > a[href='/xsx'] img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    margin: 0;
    border-radius: 0;
    border: none;
    box-shadow: none;
}

.nav-toggle-btn {
    display: none;
    position: fixed;
    top: 5px;
    left: 10px;
    z-index: 1002;
    width: 44px;
    height: 44px;
    background: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}
.nav-toggle-btn:hover {
    background: #c0392b;
    transform: scale(1.02);
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(to right, #e74c3c, #e67e22, #f1c40f, #2ecc71);
    z-index: 1002;
}

body {
    background-image: radial-gradient(circle at 10% 20%, rgba(231, 76, 60, 0.04) 0%, transparent 20%),
        radial-gradient(circle at 90% 30%, rgba(231, 76, 60, 0.04) 0%, transparent 20%),
        radial-gradient(circle at 50% 80%, rgba(231, 76, 60, 0.04) 0%, transparent 20%);
}

/* ----- 标题 ----- */
h1 {
    margin: 30px auto 40px;
    font-size: clamp(2.2rem, 5vw, 3.2rem);
    color: #2c3e50;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    letter-spacing: 1px;
    padding-bottom: 15px;
    border-bottom: 3px solid #e74c3c;
    max-width: 90%;
    text-align: center;
    position: relative;
}

/* ----- 游戏容器 ----- */
#gameContainer {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 10px;
    position: relative;
    min-height: 400px;
}

/* ----- 游戏说明 (右上角) ----- */
#gameRules {
    position: fixed;
    top: 70px;
    right: 20px;
    z-index: 500;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 14px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(231, 76, 60, 0.15);
    max-width: 280px;
    transition: all 0.3s ease;
    overflow: hidden;
}
#gameRules .rules-header {
    padding: 12px 18px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}
#gameRules .rules-header span:last-child {
    transition: transform 0.3s ease;
}
#gameRules .rules-header span:last-child.open {
    transform: rotate(180deg);
}
#gameRules .rules-body {
    padding: 15px 18px;
    font-size: 0.9rem;
    color: #2c3e50;
    line-height: 1.7;
    max-height: 400px;
    overflow-y: auto;
    transition: max-height 0.3s ease, padding 0.3s ease;
}
#gameRules .rules-body.hidden {
    max-height: 0;
    padding: 0 18px;
    overflow: hidden;
}
#gameRules .rules-body ul {
    padding-left: 18px;
    margin: 6px 0;
}
#gameRules .rules-body ul li {
    margin-bottom: 4px;
}
#gameRules .rules-body .highlight {
    color: #e74c3c;
    font-weight: 700;
}

/* ----- 赌注和总金额 (右下角) ----- */
#betDisplay {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 500;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 14px;
    padding: 14px 22px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(231, 76, 60, 0.12);
    min-width: 160px;
    text-align: center;
    backdrop-filter: blur(4px);
    transition: all 0.3s ease;
}
#betDisplay .bet-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 1rem;
}
#betDisplay .bet-item .label {
    color: #7f8c8d;
    font-weight: 500;
}
#betDisplay .bet-item .value {
    font-weight: 700;
    font-size: 1.2rem;
}
#betDisplay .bet-item .value.bet-val {
    color: #e67e22;
}
#betDisplay .bet-item .value.total-val {
    color: #2c3e50;
}
#betDisplay .bet-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, #ddd, transparent);
    margin: 6px 0;
}

/* ----- 设置界面 ----- */
#setupScreen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 20px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
    max-width: 420px;
    margin: 0 auto;
    border-top: 4px solid #e74c3c;
}
#setupScreen .setup-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 6px;
}
#setupScreen .setup-sub {
    color: #7f8c8d;
    font-size: 0.95rem;
    margin-bottom: 24px;
}
#setupScreen .setup-row {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}
#setupScreen .setup-row label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1rem;
    min-width: 80px;
}
#setupScreen .setup-row input {
    flex: 1;
    min-width: 120px;
    padding: 10px 14px;
    border: 2px solid #e0e6ed;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f9fbfd;
    color: #2c3e50;
    outline: none;
}
#setupScreen .setup-row input:focus {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.15);
    background: #fff;
}
#setupScreen .setup-row input.error {
    border-color: #e74c3c;
    background: #fff5f5;
}
#setupScreen .btn-start {
    width: 100%;
    padding: 14px;
    margin-top: 10px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.3);
    letter-spacing: 1px;
}
#setupScreen .btn-start:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(231, 76, 60, 0.4);
}
#setupScreen .btn-start:active {
    transform: translateY(0);
}
#setupScreen .btn-start:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}
#setupScreen .error-msg {
    color: #e74c3c;
    font-size: 0.85rem;
    min-height: 20px;
}

/* ----- 游戏牌桌 ----- */
#gameTable {
    display: none;
    flex-direction: column;
    align-items: center;
    padding: 20px 10px;
}

#gameStatus {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 18px;
    min-height: 2em;
    text-align: center;
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 30px;
    backdrop-filter: blur(4px);
}
#gameStatus.win {
    color: #27ae60;
}
#gameStatus.lose {
    color: #e74c3c;
}
#gameStatus.info {
    color: #3498db;
}

#cardsContainer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    margin: 10px 0 20px 0;
    padding: 10px;
}

/* ============================================================
   卡牌样式 - 简单翻牌（显示/隐藏） 不使用3D
   ============================================================ */
.card {
    width: 100px;
    height: 140px;
    cursor: pointer;
    transition: transform 0.3s ease;
    flex-shrink: 0;
    position: relative;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    background: transparent;
}

/* 正面和背面共用尺寸 */
.card-front,
.card-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 16px;
    transition: opacity 0.3s ease;
}

/* 正面（数字面） - 默认隐藏 */
.card-front {
    background: linear-gradient(145deg, #ffffff, #f5f6fa);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 3px solid transparent;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
.card-front .card-number {
    font-size: 2.8rem;
    font-weight: 700;
    line-height: 1;
}
.card-front .card-suit {
    font-size: 1.2rem;
    opacity: 0.3;
    margin-top: 4px;
}
.card-front .corner {
    position: absolute;
    font-size: 0.7rem;
    font-weight: 600;
    color: #95a5a6;
}
.card-front .corner-tl {
    top: 6px;
    left: 10px;
}
.card-front .corner-br {
    bottom: 6px;
    right: 10px;
    transform: rotate(180deg);
}
/* 数字颜色 */
.card-front[data-value="0"] .card-number { color: #7f8c8d; }
.card-front[data-value="3"] .card-number { color: #2ecc71; }
.card-front[data-value="4"] .card-number { color: #3498db; }
.card-front[data-value="6"] .card-number { color: #f39c12; }
.card-front[data-value="8"] .card-number { color: #e74c3c; }

/* 背面（?） - 默认显示 */
.card-back {
    background: linear-gradient(135deg, #2c3e50, #1a252f);
    border: 3px solid #3d566e;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    opacity: 1;
    pointer-events: none;
}
.card-back::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}
.card-back .back-icon {
    font-size: 3.5rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.15);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    letter-spacing: 2px;
}
.card-back::after {
    content: '◆ ◆ ◆';
    position: absolute;
    bottom: 18px;
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.06);
    letter-spacing: 6px;
    white-space: nowrap;
}

/* 翻开状态：正面显示，背面隐藏 */
.card.flipped .card-front {
    opacity: 1;
}
.card.flipped .card-back {
    opacity: 0;
}

/* 卡片悬停效果（未翻转时） */
.card:not(.flipped):not(.disabled):hover {
    transform: translateY(-6px);
}
.card:not(.flipped):not(.disabled):hover .card-front {
    transform: scale(1.02);
}

/* 卡片禁用 */
.card.disabled {
    cursor: not-allowed;
    opacity: 0.7;
}
.card.disabled:hover {
    transform: none !important;
}

/* 选中高亮（结算时） */
.card.win-card .card-front {
    border-color: #27ae60;
    background: linear-gradient(145deg, #f0fff4, #ffffff);
    box-shadow: 0 8px 30px rgba(39, 174, 96, 0.25);
}
.card.lose-card .card-front {
    border-color: #e74c3c;
    background: linear-gradient(145deg, #fff5f5, #ffffff);
    box-shadow: 0 8px 30px rgba(231, 76, 60, 0.25);
}

/* ----- 结算结果 ----- */
#resultDisplay {
    margin-top: 16px;
    padding: 14px 28px;
    border-radius: 16px;
    font-size: 1.2rem;
    font-weight: 700;
    text-align: center;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(4px);
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    transition: all 0.3s ease;
}
#resultDisplay .result-win {
    color: #27ae60;
}
#resultDisplay .result-lose {
    color: #e74c3c;
}
#resultDisplay .result-detail {
    font-weight: 400;
    color: #7f8c8d;
    font-size: 0.95rem;
}

#btnRestart {
    display: none;
    margin-top: 20px;
    padding: 12px 36px;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(44, 62, 80, 0.25);
    letter-spacing: 0.5px;
}
#btnRestart:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(44, 62, 80, 0.35);
}
#btnRestart:active {
    transform: translateY(0);
}

/* ----- 游戏结束遮罩 ----- */
#gameOverOverlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    justify-content: center;
    align-items: center;
    animation: fadeInOverlay 0.5s ease;
}
#gameOverOverlay .gameover-box {
    background: #fff;
    border-radius: 24px;
    padding: 40px 50px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
    animation: scaleIn 0.5s ease;
}
#gameOverOverlay .gameover-box .icon {
    font-size: 4rem;
    margin-bottom: 10px;
}
#gameOverOverlay .gameover-box h2 {
    font-size: 2rem;
    color: #e74c3c;
    margin-bottom: 8px;
}
#gameOverOverlay .gameover-box p {
    color: #7f8c8d;
    font-size: 1.1rem;
    margin-bottom: 20px;
}
#gameOverOverlay .gameover-box .btn-restart-game {
    padding: 12px 40px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.3);
}
#gameOverOverlay .gameover-box .btn-restart-game:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(231, 76, 60, 0.4);
}

@keyframes fadeInOverlay {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.85);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ----- 工具类 ----- */
.hidden {
    display: none !important;
}

/* ----- 响应式 ----- */
@media (max-width: 768px) {
    body {
        padding: 15px;
        padding-top: 60px;
    }

    body > a[href='/essay'] {
        display: none !important;
    }
    body > a:not([href='/xsx']):not([href='/operate']):not([href='/users']) {
        animation: none !important;
        position: fixed;
        display: block;
        width: 100% !important;
        left: 0 !important;
        top: auto;
        padding: 8px 12px;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        font-size: 0.8rem;
        height: 36px;
        text-align: left;
        padding-left: 20px;
        transform: translateX(-100%);
        opacity: 0;
        visibility: hidden;
        transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s;
    }
    body.nav-collapsed > a:not([href='/xsx']):not([href='/operate']):not([href='/users']) {
        transform: translateX(0) !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    body > a[href='/']:not([href='/xsx']):not([href='/operate']):not([href='/users']) { top: 0; }
    body > a[href='/publicShare']:not([href='/xsx']):not([href='/operate']):not([href='/users']) { top: 36px; }
    body > a[href='/article']:not([href='/xsx']):not([href='/operate']):not([href='/users']) { top: 72px; }
    body > a[href='/essay']:not([href='/xsx']):not([href='/operate']):not([href='/users']) { display: none !important; }
    body > a[href='/chat']:not([href='/xsx']):not([href='/operate']):not([href='/users']) { top: 108px; }
    body > a[href='/tools']:not([href='/xsx']):not([href='/operate']):not([href='/users']) { top: 144px; }
    body > a[href='/games']:not([href='/xsx']):not([href='/operate']):not([href='/users']) { top: 180px; }
    body > a[href='/login']:not([href='/xsx']):not([href='/operate']):not([href='/users']) { top: 216px; }
    body > a[href='/signUp']:not([href='/xsx']):not([href='/operate']):not([href='/users']) { top: 252px; }
    body > a[href='/comment']:not([href='/xsx']):not([href='/operate']):not([href='/users']) { top: 288px; }

    body > a[href='/xsx'] {
        position: fixed;
        top: 0;
        right: 0;
        width: 45px;
        height: 36px;
        z-index: 1001;
    }

    .nav-toggle-btn {
        display: block !important;
    }

    h1 {
        margin-top: 60px;
        font-size: 2rem;
    }

    #gameRules {
        top: 60px;
        right: 10px;
        max-width: 220px;
    }
    #gameRules .rules-header {
        font-size: 0.8rem;
        padding: 10px 14px;
    }
    #gameRules .rules-body {
        font-size: 0.8rem;
        padding: 12px 14px;
    }

    #betDisplay {
        bottom: 16px;
        right: 16px;
        padding: 10px 16px;
        min-width: 120px;
    }
    #betDisplay .bet-item {
        font-size: 0.85rem;
    }
    #betDisplay .bet-item .value {
        font-size: 1rem;
    }

    .card {
        width: 70px;
        height: 100px;
    }
    .card-front .card-number {
        font-size: 2rem;
    }
    .card-front .card-suit {
        font-size: 0.9rem;
    }
    .card-front .corner {
        font-size: 0.55rem;
    }
    .card-front .corner-tl {
        top: 4px;
        left: 7px;
    }
    .card-front .corner-br {
        bottom: 4px;
        right: 7px;
    }
    .card-back .back-icon {
        font-size: 2.5rem;
    }
    .card-back::after {
        font-size: 0.4rem;
        bottom: 12px;
        letter-spacing: 4px;
    }

    #cardsContainer {
        gap: 10px;
        padding: 5px;
    }

    #gameStatus {
        font-size: 0.95rem;
        padding: 6px 16px;
    }

    #resultDisplay {
        font-size: 1rem;
        padding: 12px 18px;
        min-height: 50px;
    }

    #setupScreen {
        padding: 24px 16px;
        margin: 0 10px;
    }
    #setupScreen .setup-row {
        flex-direction: column;
        align-items: stretch;
    }
    #setupScreen .setup-row label {
        min-width: unset;
        font-size: 0.9rem;
    }
    #setupScreen .setup-row input {
        min-width: unset;
        width: 100%;
    }

    #gameOverOverlay .gameover-box {
        padding: 30px 24px;
    }
    #gameOverOverlay .gameover-box h2 {
        font-size: 1.6rem;
    }
}

@media (max-width: 480px) {
    body > a:not([href='/xsx']):not([href='/operate']):not([href='/users']) {
        font-size: 0.7rem;
        padding: 6px 10px;
        height: 32px;
    }
    body > a[href='/']:not([href='/xsx']):not([href='/operate']):not([href='/users']) { top: 0; }
    body > a[href='/publicShare']:not([href='/xsx']):not([href='/operate']):not([href='/users']) { top: 32px; }
    body > a[href='/article']:not([href='/xsx']):not([href='/operate']):not([href='/users']) { top: 64px; }
    body > a[href='/essay']:not([href='/xsx']):not([href='/operate']):not([href='/users']) { display: none !important; }
    body > a[href='/chat']:not([href='/xsx']):not([href='/operate']):not([href='/users']) { top: 96px; }
    body > a[href='/tools']:not([href='/xsx']):not([href='/operate']):not([href='/users']) { top: 128px; }
    body > a[href='/games']:not([href='/xsx']):not([href='/operate']):not([href='/users']) { top: 160px; }
    body > a[href='/login']:not([href='/xsx']):not([href='/operate']):not([href='/users']) { top: 192px; }
    body > a[href='/signUp']:not([href='/xsx']):not([href='/operate']):not([href='/users']) { top: 224px; }
    body > a[href='/comment']:not([href='/xsx']):not([href='/operate']):not([href='/users']) { top: 256px; }

    body > a[href='/xsx'] {
        width: 40px;
        height: 32px;
    }
    .nav-toggle-btn {
        width: 38px;
        height: 38px;
        font-size: 24px;
        top: 3px;
        left: 8px;
        display: block !important;
    }

    h1 {
        font-size: 1.6rem;
        margin-top: 50px;
    }

    .card {
        width: 56px;
        height: 82px;
    }
    .card-front .card-number {
        font-size: 1.5rem;
    }
    .card-front .card-suit {
        font-size: 0.7rem;
    }
    .card-front .corner {
        font-size: 0.45rem;
    }
    .card-front .corner-tl {
        top: 3px;
        left: 5px;
    }
    .card-front .corner-br {
        bottom: 3px;
        right: 5px;
    }
    .card-back .back-icon {
        font-size: 2rem;
    }
    .card-back::after {
        font-size: 0.35rem;
        bottom: 8px;
        letter-spacing: 3px;
        content: '◆ ◆';
    }

    #cardsContainer {
        gap: 6px;
    }

    #gameRules {
        top: 55px;
        right: 6px;
        max-width: 180px;
    }
    #gameRules .rules-header {
        font-size: 0.7rem;
        padding: 8px 12px;
    }
    #gameRules .rules-body {
        font-size: 0.7rem;
        padding: 10px 12px;
    }
    #gameRules .rules-body ul {
        padding-left: 14px;
    }

    #betDisplay {
        bottom: 10px;
        right: 10px;
        padding: 8px 12px;
        min-width: 100px;
    }
    #betDisplay .bet-item {
        font-size: 0.75rem;
        padding: 2px 0;
    }
    #betDisplay .bet-item .value {
        font-size: 0.9rem;
    }
    #betDisplay .bet-divider {
        margin: 4px 0;
    }

    #gameStatus {
        font-size: 0.85rem;
        padding: 4px 12px;
    }

    #resultDisplay {
        font-size: 0.9rem;
        padding: 10px 14px;
        min-height: 44px;
    }

    #setupScreen .setup-title {
        font-size: 1.2rem;
    }
    #setupScreen .setup-sub {
        font-size: 0.8rem;
    }
    #setupScreen .btn-start {
        font-size: 1rem;
        padding: 12px;
    }

    #gameOverOverlay .gameover-box {
        padding: 24px 18px;
    }
    #gameOverOverlay .gameover-box .icon {
        font-size: 3rem;
    }
    #gameOverOverlay .gameover-box h2 {
        font-size: 1.4rem;
    }
    #gameOverOverlay .gameover-box p {
        font-size: 0.95rem;
    }
}

/* ----- 桌面端：文章悬停显示随笔 ----- */
@media (min-width: 769px) {
    body > a[href='/essay']:not([href='/xsx']):not([href='/operate']):not([href='/users']) {
        display: none !important;
        opacity: 0;
        visibility: hidden;
        position: fixed;
        top: 45px;
        left: 18%;
        width: 7%;
        min-width: 55px;
        z-index: 999;
        background-color: rgba(52, 73, 94, 0.98);
        backdrop-filter: blur(12px);
        border-radius: 0 0 8px 8px;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        height: 40px;
        line-height: 40px;
        padding: 0 6px;
        font-size: 0.75rem;
        text-align: center;
        transition: all 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
        transform: translateY(-10px);
        pointer-events: none;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
    body > a[href='/article']:not([href='/xsx']):not([href='/operate']):not([href='/users']):hover~a[href='/essay']:not([href='/xsx']):not([href='/operate']):not([href='/users']) {
        display: inline-block !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: translateY(0) !important;
        pointer-events: auto !important;
    }
    body > a[href='/essay']:not([href='/xsx']):not([href='/operate']):not([href='/users']):hover {
        display: inline-block !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: translateY(0) !important;
        pointer-events: auto !important;
        background-color: #e67e22 !important;
    }
    body > a[href='/article']:not([href='/xsx']):not([href='/operate']):not([href='/users']):hover {
        background-color: #e67e22;
    }
}

