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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
        'Microsoft YaHei', sans-serif;
    background: var(--bg-gradient);
    color: #fff;
    min-height: 100vh;
    overflow: hidden;
    
    /* 默认主题：经典绿 */
    --bg-gradient: linear-gradient(135deg, #1a5f2a 0%, #0d3d18 100%);
    --table-bg: rgba(0,0,0,0.15);
    --panel-bg: rgba(0,0,0,0.2);
    --accent-color: #f0c040;
    --accent-gradient: linear-gradient(135deg, #f0c040 0%, #d4a017 100%);
    --card-shadow: 0 2px 8px rgba(0,0,0,0.3);
    --ddz-card-enter-stagger: 12;
    --ddz-hover-lift: 5px;
    --ddz-selected-lift: 16px;
}

/* 红木主题 */
body[data-theme="redwood"] {
    --bg-gradient: linear-gradient(135deg, #5c1a1a 0%, #3d0d0d 100%);
    --table-bg: rgba(0,0,0,0.2);
    --panel-bg: rgba(0,0,0,0.25);
    --accent-color: #e8a87c;
    --accent-gradient: linear-gradient(135deg, #e8a87c 0%, #c98a5e 100%);
    --card-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

/* 夜空蓝主题 */
body[data-theme="night"] {
    --bg-gradient: linear-gradient(135deg, #1a1a3d 0%, #0d0d2a 100%);
    --table-bg: rgba(255,255,255,0.05);
    --panel-bg: rgba(255,255,255,0.08);
    --accent-color: #82b1ff;
    --accent-gradient: linear-gradient(135deg, #82b1ff 0%, #448aff 100%);
    --card-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

/* 海洋主题 */
body[data-theme="ocean"] {
    --bg-gradient: linear-gradient(135deg, #0d3d4d 0%, #062a35 100%);
    --table-bg: rgba(255,255,255,0.05);
    --panel-bg: rgba(255,255,255,0.08);
    --accent-color: #4dd0e1;
    --accent-gradient: linear-gradient(135deg, #4dd0e1 0%, #00acc1 100%);
    --card-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

/* 秋日主题 */
body[data-theme="autumn"] {
    --bg-gradient: linear-gradient(135deg, #5c3a1a 0%, #3d240d 100%);
    --table-bg: rgba(0,0,0,0.15);
    --panel-bg: rgba(0,0,0,0.2);
    --accent-color: #ffb74d;
    --accent-gradient: linear-gradient(135deg, #ffb74d 0%, #f57c00 100%);
    --card-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

/* 紫晶主题 */
body[data-theme="purple"] {
    --bg-gradient: linear-gradient(135deg, #3d1a5c 0%, #240d3d 100%);
    --table-bg: rgba(255,255,255,0.05);
    --panel-bg: rgba(255,255,255,0.08);
    --accent-color: #ce93d8;
    --accent-gradient: linear-gradient(135deg, #ce93d8 0%, #ab47bc 100%);
    --card-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.hidden {
    display: none !important;
}

.chat-bubble,
.commentary-bubble,
#btn-toggle-chat,
#chat-panel,
#quick-phrases {
    display: none !important;
}

/* ===== 屏幕容器 ===== */
.screen {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== 菜单界面 ===== */
#menu-screen {
    justify-content: flex-start;
    align-items: center;
    overflow-y: auto;
    overflow-x: hidden;
    padding: clamp(18px, 3.5vh, 42px) clamp(14px, 3vw, 38px);
    scroll-padding-top: 18px;
    position: relative;
}

/* 背景装饰光晕 */
.menu-bg-decoration {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.menu-bg-decoration::before,
.menu-bg-decoration::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: bgOrbFloat 12s ease-in-out infinite;
}

.menu-bg-decoration::before {
    width: 50vw;
    height: 50vw;
    max-width: 600px;
    max-height: 600px;
    background: radial-gradient(circle, rgba(240,192,64,0.18) 0%, transparent 70%);
    top: -10%;
    left: 50%;
    transform: translateX(-50%);
    animation-delay: 0s;
}

.menu-bg-decoration::after {
    width: 40vw;
    height: 40vw;
    max-width: 500px;
    max-height: 500px;
    background: radial-gradient(circle, rgba(76,175,80,0.12) 0%, transparent 70%);
    bottom: -5%;
    left: 20%;
    animation-delay: -6s;
    animation-duration: 16s;
}

@keyframes bgOrbFloat {
    0%, 100% { transform: translate(-50%, 0) scale(1); }
    33% { transform: translate(-45%, 20px) scale(1.05); }
    66% { transform: translate(-55%, -10px) scale(0.95); }
}

.menu-container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 18px;
    max-width: 1080px;
    width: 100%;
    min-height: min-content;
    margin: 0 auto;
    padding-bottom: 24px;
}

/* ---- 标题区 ---- */
.menu-header {
    text-align: center;
    padding: clamp(8px, 2vh, 20px) 0;
}

.menu-title-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.title-icon {
    font-size: clamp(1.3rem, 2.2vw, 1.7rem);
    opacity: 0.7;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(240,192,64,0.12), rgba(240,192,64,0.03));
    border: 1px solid rgba(240,192,64,0.18);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: titleIconFloat 3s ease-in-out infinite;
    user-select: none;
    line-height: 1;
}

.title-icon--spade {
    color: #e0e0e0;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

.title-icon--heart {
    color: #ff6b6b;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
    animation-delay: -1.5s;
}

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

.game-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 900;
    text-shadow:
        0 2px 0 rgba(0,0,0,0.2),
        0 4px 20px rgba(0,0,0,0.4),
        0 0 60px rgba(240,192,64,0.15);
    margin: 0;
    letter-spacing: 2px;
    line-height: 1.1;
    background: linear-gradient(180deg, #fff 0%, #f0d080 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.game-subtitle {
    font-size: clamp(0.9rem, 1.6vw, 1.15rem);
    opacity: 0.55;
    margin: 6px 0 0;
    letter-spacing: 4px;
    text-transform: uppercase;
    font-weight: 400;
}

.title-divider {
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #f0c040, transparent);
    border-radius: 2px;
    margin: 14px auto 0;
    opacity: 0.5;
}

/* ---- 主体内容 ---- */
.menu-body {
    display: grid;
    grid-template-columns: minmax(320px, 1.1fr) minmax(300px, 0.9fr);
    gap: 22px;
    align-items: start;
}

.section-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.35;
    margin-bottom: 10px;
    padding-left: 4px;
}

/* ---- 模式卡片 ---- */
.mode-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mode-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0;
    border: none;
    border-radius: 18px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: left;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.mode-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.mode-card:hover {
    transform: translateY(-3px) scale(1.01);
}

.mode-card:active {
    transform: translateY(0) scale(0.99);
}

.mode-card__icon {
    font-size: 1.9rem;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.mode-card__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mode-card__title {
    font-size: 1.05rem;
    font-weight: 700;
}

.mode-card__desc {
    font-size: 0.78rem;
    opacity: 0.55;
    font-weight: 400;
}

.mode-card__arrow {
    font-size: 1.2rem;
    opacity: 0.4;
    transition: all 0.3s ease;
    padding-right: 4px;
}

.mode-card:hover .mode-card__arrow {
    opacity: 0.8;
    transform: translateX(4px);
}

/* 主模式 */
.mode-card--primary {
    background: linear-gradient(135deg, rgba(240,192,64,0.95) 0%, rgba(212,160,23,0.95) 100%);
    color: #2a1a00;
    padding: 20px 22px;
    box-shadow: 0 8px 32px rgba(240,192,64,0.25), inset 0 1px 0 rgba(255,255,255,0.3);
    position: relative;
}

.mode-card--primary::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255,230,120,0.5), transparent 50%, rgba(240,192,64,0.3));
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: -1;
}

.mode-card--primary:hover::after {
    opacity: 1;
}

.mode-card--primary:hover {
    box-shadow: 0 12px 40px rgba(240,192,64,0.4), inset 0 1px 0 rgba(255,255,255,0.4);
}

.mode-card--primary .mode-card__icon {
    font-size: 2.4rem;
}

.mode-card--primary .mode-card__title {
    font-size: 1.25rem;
}

.mode-card--primary .mode-card__desc {
    opacity: 0.6;
    color: #2a1a00;
}

.mode-card--primary .mode-card__arrow {
    color: #2a1a00;
}

/* 次要模式 */
.mode-card--secondary {
    background: rgba(255,255,255,0.08);
    color: #fff;
    padding: 16px 18px;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.05);
    flex: 1;
}

.mode-card--secondary:hover {
    background: rgba(255,255,255,0.14);
    border-color: rgba(255,255,255,0.2);
    box-shadow: 0 8px 28px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.1);
}

/* 幽灵模式 */
.mode-card--ghost {
    background: rgba(255,255,255,0.04);
    color: #fff;
    padding: 12px 14px;
    border: 1px solid rgba(255,255,255,0.06);
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.mode-card--ghost:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.15);
}

.mode-card--ghost .mode-card__icon {
    font-size: 1.5rem;
}

.mode-card--ghost .mode-card__title {
    font-size: 0.82rem;
    font-weight: 600;
}

/* 卡片行 */
.mode-card-row {
    display: flex;
    gap: 12px;
}

.mode-card-row--small {
    gap: 10px;
}

/* 卡片入场动画 */
.mode-card {
    opacity: 0;
    animation: modeCardEnter 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.mode-card:nth-child(1) { animation-delay: 0.05s; }
.mode-card-row:nth-child(2) .mode-card:nth-child(1) { animation-delay: 0.12s; }
.mode-card-row:nth-child(2) .mode-card:nth-child(2) { animation-delay: 0.18s; }
.mode-card-row:nth-child(3) .mode-card:nth-child(1) { animation-delay: 0.24s; }
.mode-card-row:nth-child(3) .mode-card:nth-child(2) { animation-delay: 0.30s; }
.mode-card-row:nth-child(3) .mode-card:nth-child(3) { animation-delay: 0.36s; }

@keyframes modeCardEnter {
    0% { transform: translateY(24px) scale(0.96); opacity: 0; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

/* ---- 统计面板 ---- */
.stats-panel-wrap {
    height: 100%;
}

.stats-panel {
    background: rgba(0,0,0,0.18);
    border-radius: 20px;
    padding: 20px;
    border: 1px solid rgba(255,255,255,0.06);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.05);
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* 等级条 */
.level-bar {
    margin-bottom: 16px;
    padding: 14px 16px;
    background: rgba(0,0,0,0.2);
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.05);
}

.level-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.level-badge {
    background: linear-gradient(135deg, #f0c040, #d4a017);
    color: #2a1a00;
    padding: 3px 12px;
    border-radius: 20px;
    font-weight: 800;
    font-size: 0.85rem;
    box-shadow: 0 2px 8px rgba(240,192,64,0.3);
}

.exp-text {
    font-size: 0.78rem;
    opacity: 0.6;
    font-weight: 500;
}

.exp-bar {
    height: 8px;
    background: rgba(255,255,255,0.08);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.2);
}

.exp-fill {
    height: 100%;
    background: linear-gradient(90deg, #f0c040, #ffd700, #f0c040);
    background-size: 200% 100%;
    border-radius: 4px;
    transition: width 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: expShimmer 2.5s ease-in-out infinite;
}

@keyframes expShimmer {
    0%, 100% { background-position: 200% 0; }
    50% { background-position: 0% 0; }
}

/* 统计网格 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    flex: 1;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 14px 8px;
    background: rgba(255,255,255,0.04);
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.04);
    transition: all 0.2s ease;
}

.stat-item:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.1);
    transform: translateY(-2px);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: #f0c040;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.72rem;
    opacity: 0.5;
    margin-top: 4px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* 重置按钮 */
.btn-clear-stats {
    margin-top: 14px;
    padding: 8px 16px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.5);
    font-size: 0.72rem;
    cursor: pointer;
    transition: all 0.2s;
    align-self: center;
}

.btn-clear-stats:hover {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.8);
    border-color: rgba(255,255,255,0.2);
}

/* ---- 底部 ---- */
.menu-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 4px;
}

.btn-settings-float {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.7);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.btn-settings-float:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.25);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.version-info {
    font-size: 0.75rem;
    opacity: 0.35;
    font-weight: 500;
}

.settings-panel {
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    grid-area: settings;
    max-height: min(48vh, 500px);
    overflow-y: auto;
    scrollbar-width: thin;
}

@media (max-height: 820px) and (min-width: 901px) {
    #menu-screen {
        padding-top: 16px;
        padding-bottom: 20px;
    }

    .menu-container {
        gap: 10px 18px;
    }

    .game-title {
        font-size: clamp(2rem, 4.2vw, 3.2rem);
    }

    .game-subtitle {
        margin: -6px 0 2px;
        font-size: 1rem;
    }

    .btn-primary {
        padding: 12px 18px;
        min-height: 58px;
    }

    .settings-panel {
        max-height: 42vh;
    }
}

.settings-panel label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.95rem;
}

.settings-panel select,
.settings-panel input[type="text"] {
    padding: 6px 12px;
    border-radius: 6px;
    border: none;
    background: rgba(255,255,255,0.9);
    color: #333;
    font-size: 0.9rem;
}

.settings-section-title {
    font-size: 0.78rem;
    color: var(--accent-color);
    font-weight: 800;
    text-align: left;
    opacity: 0.9;
}

/* 游戏进行中锁定的规则设置 */
.settings-panel label.setting-locked {
    opacity: 0.5;
    cursor: not-allowed;
}
.settings-panel label.setting-locked input,
.settings-panel label.setting-locked select {
    pointer-events: none;
    filter: grayscale(0.6);
}
.settings-panel label.setting-locked .setting-value-output {
    opacity: 0.5;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.setting-row {
    min-width: 0;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(255,255,255,0.06);
}

.setting-row select,
.setting-row input[type="text"] {
    width: min(150px, 52%);
}

.advanced-settings {
    padding: 10px;
    border-radius: 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
}

.advanced-settings summary {
    cursor: pointer;
    color: var(--accent-color);
    font-weight: 800;
    margin-bottom: 10px;
}

.settings-slider-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 12px;
    margin-top: 10px;
}

.setting-slider {
    align-items: stretch !important;
    flex-direction: column;
    gap: 6px !important;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(0,0,0,0.12);
}

.setting-slider span {
    color: var(--accent-color);
    font-weight: 800;
    float: right;
}

.setting-slider input[type="range"] {
    width: 100%;
    accent-color: var(--accent-color);
}

.settings-toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
}

.settings-toggles label {
    justify-content: flex-start;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.07);
    font-size: 0.82rem;
}

/* ===== 成就面板 ===== */
.overlay-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    width: 90%;
    max-width: 440px;
    max-height: 80vh;
    background: rgba(15,25,15,0.9);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: 24px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    z-index: 300;
    opacity: 1;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 24px 64px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.04);
    transition: opacity 0.25s ease-in, transform 0.25s ease-in;
    animation: overlayPanelEnter 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes overlayPanelEnter {
    0% { transform: translate(-50%, -50%) scale(0.95); opacity: 0; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.overlay-panel.panel-exit {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.96);
    pointer-events: none;
}

.overlay-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.overlay-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

/* ===== 赛季任务面板 ===== */
#season-quest-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.season-quest-modal {
    background: var(--panel-bg);
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    width: 100%;
    max-width: 520px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.season-quest-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.season-quest-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.season-quest-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.season-quest-footer {
    padding: 12px 20px 16px;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    justify-content: center;
    gap: 10px;
}

/* 赛季任务标签页 */
.sq-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
}

.sq-tab {
    flex: 1;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.03);
    color: rgba(255,255,255,0.6);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.sq-tab:hover {
    background: rgba(255,255,255,0.06);
}

.sq-tab.active {
    background: var(--accent-gradient);
    color: #1a1a1a;
    border-color: transparent;
}

/* 赛季概览 */
.sq-overview {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255,255,255,0.04);
    margin-bottom: 14px;
}

.sq-exp-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #1a1a1a;
    font-weight: 800;
    font-size: 0.85rem;
    line-height: 1;
}

.sq-exp-circle small {
    font-size: 0.6rem;
    font-weight: 600;
    opacity: 0.8;
}

.sq-overview-info {
    flex: 1;
}

.sq-overview-title {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.sq-overview-desc {
    font-size: 0.75rem;
    opacity: 0.55;
}

/* 任务项 */
.sq-quest-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sq-quest-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.04);
    transition: all 0.2s ease;
}

.sq-quest-item:hover {
    background: rgba(255,255,255,0.05);
}

.sq-quest-item.completed {
    border-color: rgba(76,175,80,0.2);
}

.sq-quest-item.claimed {
    opacity: 0.5;
}

.sq-quest-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.sq-quest-item.completed .sq-quest-icon {
    background: rgba(76,175,80,0.15);
}

.sq-quest-info {
    flex: 1;
    min-width: 0;
}

.sq-quest-name {
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sq-quest-desc {
    font-size: 0.72rem;
    opacity: 0.55;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sq-quest-progress-wrap {
    margin-top: 6px;
}

.sq-quest-progress-bar {
    height: 6px;
    border-radius: 3px;
    background: rgba(255,255,255,0.06);
    overflow: hidden;
}

.sq-quest-progress-fill {
    height: 100%;
    border-radius: 3px;
    background: var(--accent-gradient);
    transition: width 0.4s ease;
    min-width: 0;
}

.sq-quest-progress-text {
    font-size: 0.7rem;
    opacity: 0.5;
    margin-top: 2px;
    text-align: right;
}

.sq-quest-reward {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--accent-color);
    font-weight: 600;
    flex-shrink: 0;
}

.sq-quest-action {
    flex-shrink: 0;
}

.sq-quest-action button {
    padding: 6px 12px;
    border-radius: 8px;
    border: none;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sq-btn-claim {
    background: var(--accent-gradient);
    color: #1a1a1a;
}

.sq-btn-claim:hover {
    transform: scale(1.05);
}

.sq-btn-claimed {
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.4);
    cursor: default;
}

/* 任务完成提示 toast */
.quest-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    z-index: 500;
    background: rgba(30,30,30,0.92);
    border: 1px solid rgba(240,192,64,0.3);
    border-radius: 16px;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
    animation: questToastIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    min-width: 260px;
    max-width: 90vw;
}

@keyframes questToastIn {
    to { transform: translateX(-50%) translateY(0); }
}

.quest-toast-exit {
    animation: questToastOut 0.4s ease-in forwards;
}

@keyframes questToastOut {
    to {
        transform: translateX(-50%) translateY(-30px);
        opacity: 0;
    }
}

.quest-toast-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.quest-toast-body {
    flex: 1;
}

.quest-toast-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 2px;
}

.quest-toast-name {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.quest-toast-reward {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* 菜单上的小红点 */
.quest-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff4444;
    box-shadow: 0 0 0 2px var(--bg-gradient);
    animation: questBadgePulse 1.5s ease-in-out infinite;
}

@keyframes questBadgePulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.8; }
}

/* 徽章展示 */
.sq-badges-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.sq-badge-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    font-size: 0.8rem;
}

.sq-badge-emoji {
    font-size: 1.1rem;
}

.sq-badge-name {
    font-weight: 600;
}

.achievement-list {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 60vh;
    padding-right: 4px;
}

.achievement-summary {
    text-align: center;
    font-size: 0.85rem;
    opacity: 0.6;
    padding: 4px 0;
    font-weight: 500;
}

.achievement-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.04);
    transition: all 0.2s ease;
}

.achievement-item:hover {
    background: rgba(255,255,255,0.07);
    transform: translateX(2px);
}

.achievement-item.unlocked {
    background: rgba(240,192,64,0.08);
    border-color: rgba(240,192,64,0.15);
}

.achievement-item.locked {
    opacity: 0.45;
}

.ach-item-icon {
    font-size: 1.6rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(255,255,255,0.06);
    flex-shrink: 0;
}

.achievement-item.unlocked .ach-item-icon {
    background: rgba(240,192,64,0.15);
}

.ach-item-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ach-item-name {
    font-weight: 700;
    font-size: 0.9rem;
}

.ach-item-desc {
    font-size: 0.78rem;
    opacity: 0.6;
}

.ach-item-status {
    font-size: 1.1rem;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(76,175,80,0.15);
}

.achievement-item.locked .ach-item-status {
    background: rgba(255,255,255,0.06);
}

/* ===== 游戏界面 ===== */
#game-screen {
    position: relative;
}

.game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: rgba(0,0,0,0.55); /* 回退：不支持 backdrop-filter 时仍保持可读 */
    backdrop-filter: blur(8px);
    position: relative;
    z-index: 30;
}

.game-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mode-badge {
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(240,192,64,0.2);
    border: 1px solid rgba(240,192,64,0.4);
    font-size: 0.8rem;
}

#btn-sound-toggle {
    font-size: 1rem;
    padding: 4px 8px;
}

/* ===== 牌桌 ===== */
#ddz-table {
    position: relative;
    flex: 1;
    display: grid;
    grid-template-rows: 160px 1fr 220px;
    grid-template-columns: 200px 1fr 200px;
    gap: 8px;
    padding: 16px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    transition: transform 0.2s ease;
}

/* 玩家区域 */
.player-area {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px;
    border-radius: 12px;
    transition: all 0.3s;
}

.player-area.active-turn {
    background: rgba(240,192,64,0.14);
    box-shadow: 0 0 28px rgba(240,192,64,0.22), inset 0 0 12px rgba(240,192,64,0.08);
    border-color: rgba(240,192,64,0.30);
}

/* 左上对手 */
#player-top {
    grid-column: 1;
    grid-row: 1;
}

/* 右上对手 */
#player-left {
    grid-column: 3;
    grid-row: 1;
}

/* 底部人类玩家（全宽居中） */
#player-right {
    grid-column: 1 / 4;
    grid-row: 3;
    padding-bottom: 4px;
    gap: 6px;
    flex-direction: column-reverse;
}

#player-right .player-info {
    order: 3;
    margin-bottom: 0;
    margin-top: 4px;
}

#player-right .hand-front {
    order: 1;
    min-height: 140px;
    padding: 8px 20px;
}

#player-right .played-area {
    order: 2;
}

/* 桌面中央区域（跨上下两行） */
#table-center {
    grid-column: 2;
    grid-row: 1 / 3;
    align-self: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.player-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
    position: relative;
}

.thinking-indicator {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(100,100,100,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: #fff;
    transition: opacity 0.2s ease;
    pointer-events: none;
    z-index: 20;
}

.thinking-indicator::after {
    content: '...';
    animation: thinkingDots 1.2s infinite;
}

.thinking-indicator.has-hint::after {
    content: attr(data-hint);
    animation: none;
    font-size: 0.65rem;
}

.ai-hint {
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 2px;
    padding: 4px 8px;
    background: rgba(0,0,0,0.7);
    border-radius: 8px;
    transition: opacity 0.3s ease;
    z-index: 30;
    pointer-events: none;
}

.ai-hint-card {
    font-size: 0.65rem;
    padding: 1px 4px;
    background: rgba(255,255,255,0.15);
    border-radius: 3px;
    white-space: nowrap;
}

@keyframes thinkingDots {
    0% { content: '.'; }
    33% { content: '..'; }
    66% { content: '...'; }
}

.countdown-timer {
    position: absolute;
    top: -10px;
    right: -10px;
    min-width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(0,0,0,0.75);
    border: 2.5px solid rgba(240,192,64,0.75);
    color: #f0c040;
    font-size: 0.9rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    opacity: 0;
    pointer-events: none;
    z-index: 25;
    box-shadow: 0 3px 12px rgba(0,0,0,0.4);
    letter-spacing: -0.3px;
}

.countdown-timer.urgent {
    border-color: #ff9800;
    color: #ff9800;
    animation: countdownPulse 0.6s ease-in-out infinite;
    background: rgba(0,0,0,0.8);
}

.countdown-timer.critical {
    border-color: #f44336;
    color: #f44336;
    animation: countdownPulse 0.3s ease-in-out infinite;
    background: rgba(0,0,0,0.85);
}

@keyframes countdownPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.player-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4a90d9, #357abd);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    box-shadow: 0 3px 12px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.12);
}

.player-name {
    font-size: 0.88rem;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.player-tooltip {
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(8px);
    color: #fff;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    z-index: 50;
}

.player-info:hover .player-tooltip {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

.player-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(255,255,255,0.1);
}

.player-badge.landlord {
    background: #d4a017;
    color: #2a1a00;
    font-weight: 600;
}

/* 手牌区 */
.hand-front, .hand-back {
    position: relative;
    display: flex;
    justify-content: center;
    min-height: 100px;
    padding: 8px;
}

.hand-front {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    min-height: 120px;
    padding: 8px 20px;
    transition: transform 0.1s;
}

.hand-front.shake {
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

.hand-back-inner {
    display: flex;
    justify-content: center;
}

.hand-hint {
    text-align: center;
    font-size: 0.85rem;
    min-height: 20px;
    margin-bottom: 4px;
    font-weight: 600;
    color: rgba(255,255,255,0.6);
    padding: 2px 12px;
    border-radius: 10px;
    transition: all 0.2s ease;
    display: inline-block;
    width: 100%;
}

.hand-hint.valid {
    color: #c8e6c9;
    background: rgba(76,175,80,0.2);
    animation: hintPulse 0.3s ease;
}

.hand-hint.invalid {
    color: #ffcdd2;
    background: rgba(244,67,54,0.2);
    animation: hintShake 0.3s ease;
}

.hand-hint.info {
    color: #9ed2ff;
    background: rgba(100,181,246,0.16);
}

.hand-hint.smart {
    color: #d8ffdf;
    background: linear-gradient(90deg, rgba(76,175,80,0.24), rgba(33,150,243,0.20));
    border: 1px solid rgba(129,220,140,0.28);
}

@keyframes hintPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes hintShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

.hand-back {
    gap: 2px;
}

.card-count {
    position: absolute;
    bottom: -8px;
    right: 0;
    background: rgba(0,0,0,0.6);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
}

/* 出牌区 */
.played-area {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 48px;
    margin-top: 10px;
    z-index: 5;
}

#bottom-cards {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
}

#bottom-cards .label {
    font-size: 0.75rem;
    opacity: 0.7;
}

#bottom-cards .cards {
    display: flex;
    gap: 6px;
}

/* ===== 扑克牌样式 ===== */
.card {
    width: 82px;
    height: 114px;
    position: relative;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

@media (hover: hover) {
    .hand-front .card:hover {
        transform: translateY(-8px) scale(1.05);
        z-index: 10;
    }
    .hand-front .card.selected:hover {
        transform: translateY(-20px) scale(1.05);
        z-index: 10;
    }
}

.card-inner {
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, #fff 0%, #f0f0f0 100%);
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.22), inset 0 1px 0 rgba(255,255,255,0.85);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card:hover .card-inner {
    transform: translateY(-14px);
    box-shadow: 0 8px 22px rgba(0,0,0,0.28);
    z-index: 10;
}

.card.selected .card-inner {
    transform: translateY(-18px);
    box-shadow: 0 10px 26px rgba(0,0,0,0.32);
    border: 2.5px solid #f0c040;
}

.card.hint .card-inner {
    border: 2.5px solid #4caf50;
    box-shadow: 0 0 16px rgba(76,175,80,0.45);
}

/* 牌背 */
.card-back .card-inner {
    background: linear-gradient(145deg, #c41e3a 0%, #8b0000 100%);
    border: 2px solid #fff;
}

.card-back .card-inner::before {
    content: '🃏';
    font-size: 1.5rem;
    opacity: 0.5;
}

/* 花色颜色 */
.red { color: #c41e3a; }
.black { color: #1a1a1a; }

/* 角标 */
.card-corner {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
}

.card-corner .rank {
    font-size: 1.15rem;
    font-weight: 800;
}

.card-corner .suit {
    font-size: 1rem;
}

.top-left {
    top: 5px;
    left: 5px;
}

.bottom-right {
    bottom: 5px;
    right: 5px;
    transform: rotate(180deg);
}

/* 中心花色 */
.card-center {
    font-size: 2.8rem;
}

/* 王 */
.card.joker .card-inner {
    background: linear-gradient(145deg, #f8f8f8, #e8e8e8);
}

.joker-text {
    font-size: 1.4rem;
    font-weight: 800;
    writing-mode: vertical-rl;
    letter-spacing: 3px;
}

.card.joker.joker_big .joker-text {
    color: #c41e3a;
}

.card.joker.joker_small .joker-text {
    color: #1a1a1a;
}

/* ===== 控制区 ===== */
#controls-area {
    position: fixed;
    bottom: auto;
    top: calc(100% - 440px);
    left: 0;
    right: 0;
    padding: 8px 20px 10px;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 20;
    pointer-events: none;
}

#call-controls, #play-controls {
    pointer-events: auto;
}

#call-controls, #play-controls {
    display: flex;
    gap: 12px;
}

#call-controls button, #play-controls button {
    padding: 10px 24px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

#call-controls button {
    background: linear-gradient(135deg, #f0c040, #d4a017);
    color: #2a1a00;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), 0 4px 12px rgba(240,192,64,0.25);
}

#call-controls button:hover {
    background: linear-gradient(135deg, #f5ca4e, #dbab1f);
    transform: translateY(-2px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.30), 0 6px 16px rgba(240,192,64,0.35);
}

#call-controls button:active {
    transform: translateY(0) scale(0.98);
}

#call-controls button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none;
}

#play-controls button {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.22);
    position: relative;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.10), 0 3px 10px rgba(0,0,0,0.15);
}

#play-controls button:hover {
    background: rgba(255,255,255,0.28);
    transform: translateY(-2px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.15), 0 5px 14px rgba(0,0,0,0.22);
}

#play-controls button:active {
    transform: translateY(0) scale(0.98);
}

#play-controls button kbd {
    font-size: 0.68rem;
    background: rgba(0,0,0,0.35);
    padding: 2px 5px;
    border-radius: 4px;
    margin-left: 5px;
    border: 1px solid rgba(255,255,255,0.10);
}

#play-controls button#btn-play {
    background: linear-gradient(135deg, #4caf50, #388e3c);
    border: none;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.20), 0 4px 12px rgba(76,175,80,0.30);
}

#play-controls button#btn-play:hover {
    background: linear-gradient(135deg, #5cbf60, #439e46);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), 0 6px 16px rgba(76,175,80,0.40);
}

#play-controls button#btn-pass {
    background: linear-gradient(135deg, #f44336, #d32f2f);
    border: none;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.15), 0 4px 12px rgba(244,67,54,0.25);
}

#play-controls button#btn-pass:hover {
    background: linear-gradient(135deg, #f55a4e, #e0443f);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.20), 0 6px 16px rgba(244,67,54,0.35);
}

#play-controls button#btn-hint {
    background: linear-gradient(135deg, #2196f3, #1976d2);
    border: none;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.15), 0 4px 12px rgba(33,150,243,0.25);
}

#play-controls button#btn-hint:hover {
    background: linear-gradient(135deg, #42a5f5, #2088d8);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.20), 0 6px 16px rgba(33,150,243,0.35);
}

.btn-auto {
    background: linear-gradient(135deg, #9c27b0, #7b1fa2) !important;
    border: none !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.15), 0 4px 12px rgba(156,39,176,0.25) !important;
}

.btn-auto:hover {
    background: linear-gradient(135deg, #ab47bc, #8e24aa) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.20), 0 6px 16px rgba(156,39,176,0.35) !important;
}

.btn-auto.active {
    background: linear-gradient(135deg, #ff9800, #f57c00) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.20), 0 4px 12px rgba(255,152,0,0.30) !important;
}

#game-info {
    display: flex;
    gap: 20px;
    font-size: 0.88rem;
    opacity: 0.85;
    flex-wrap: wrap;
    justify-content: center;
    font-weight: 500;
}

#shortcut-hint {
    opacity: 0.5;
    font-size: 0.75rem;
    cursor: pointer;
    transition: opacity 0.2s ease;
    padding: 2px 8px;
    border-radius: 6px;
}

/* 触摸设备默认隐藏键盘快捷键提示 */
@media (hover: none) and (pointer: coarse) {
    #shortcut-hint {
        display: none;
    }
}

#shortcut-hint:hover {
    opacity: 0.9;
    background: rgba(255,255,255,0.08);
}

#last-play-type {
    display: none;
}

/* 桌面中央大倒计时 */
.center-countdown {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(0,0,0,0.65);
    border: 3px solid rgba(240,192,64,0.6);
    color: #f0c040;
    font-size: 1.8rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 40px rgba(240,192,64,0.2), 0 8px 24px rgba(0,0,0,0.4);
    transition: all 0.3s ease;
    animation: centerCdAppear 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    z-index: 30;
}

.center-countdown.hidden {
    display: none;
}

.center-countdown.urgent {
    border-color: #ff9800;
    color: #ff9800;
    box-shadow: 0 0 50px rgba(255,152,0,0.3), 0 8px 24px rgba(0,0,0,0.4);
    animation: centerCdAppear 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), countdownPulse 0.6s ease-in-out infinite;
}

.center-countdown.critical {
    border-color: #f44336;
    color: #f44336;
    box-shadow: 0 0 60px rgba(244,67,54,0.35), 0 8px 24px rgba(0,0,0,0.4);
    animation: centerCdAppear 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), countdownPulse 0.3s ease-in-out infinite;
}

@keyframes centerCdAppear {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* ===== 气泡提示 ===== */
.call-bubble, .pass-bubble {
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 18px;
    border-radius: 20px;
    background: rgba(0,0,0,0.78);
    font-size: 0.95rem;
    font-weight: 700;
    animation: bubbleIn 0.3s ease;
    z-index: 15;
    white-space: nowrap;
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 6px 20px rgba(0,0,0,0.30);
}

@keyframes bubbleIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ===== Toast ===== */
.toast-message {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 500;
    padding: 12px 28px;
    border-radius: 12px;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(8px);
    font-size: 0.95rem;
    animation: toastIn 0.3s ease;
    z-index: 2100;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* 成就解锁通知 */
.achievement-toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 500;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 24px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(212,160,23,0.9) 0%, rgba(180,130,10,0.9) 100%);
    backdrop-filter: blur(12px);
    color: #fff;
    box-shadow: 0 8px 32px rgba(212,160,23,0.4);
    animation: achPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 2100;
    min-width: 240px;
}

.achievement-toast .ach-icon {
    font-size: 2rem;
    line-height: 1;
    animation: achIconBounce 0.6s ease;
}

.achievement-toast .ach-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.achievement-toast .ach-title {
    font-size: 0.75rem;
    opacity: 0.85;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.achievement-toast .ach-name {
    font-size: 1.1rem;
    font-weight: 700;
}

.achievement-toast .ach-desc {
    font-size: 0.8rem;
    opacity: 0.8;
}

@keyframes achPop {
    from { opacity: 0; transform: translateX(-50%) translateY(-30px) scale(0.8); }
    to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

@keyframes achIconBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

/* ===== 弹窗 ===== */
#modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 1;
    transition: opacity 0.25s ease;
}
#modal-overlay.modal-exit {
    opacity: 0;
    pointer-events: none;
}

#modal-content {
    background: linear-gradient(145deg, rgba(30,45,38,0.96), rgba(16,28,22,0.98));
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.1);
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
#modal-content.modal-exit {
    opacity: 0;
    transform: scale(0.96);
}

#modal-content h2 {
    font-size: 1.8rem;
    margin-bottom: 16px;
    color: var(--accent-color);
}

#modal-content p {
    margin-bottom: 24px;
    opacity: 0.8;
}

.spring-badge {
    padding: 6px 16px;
    border-radius: 20px;
    background: linear-gradient(135deg, #ff6b9d, #c44569);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 12px;
    display: inline-block;
}

.spring-badge.anti {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
}

.multiplier-text {
    font-size: 0.85rem;
    color: #f0c040;
    margin-bottom: 8px;
}

.score-board {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.score-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 16px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
}

.score-item.landlord {
    background: rgba(240,192,64,0.1);
    border: 1px solid rgba(240,192,64,0.2);
}

.round-stats {
    margin: 16px 0;
    padding: 12px;
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    text-align: left;
}

.round-stats h4 {
    text-align: center;
    margin-bottom: 10px;
    color: #f0c040;
    font-size: 0.95rem;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.stat-row:last-child {
    border-bottom: none;
}

#modal-content button {
    margin: 8px;
    padding: 12px 32px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

#btn-next-round {
    background: linear-gradient(135deg, #f0c040, #d4a017);
    color: #2a1a00;
}

#btn-back-menu {
    background: rgba(255,255,255,0.08);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
}

#btn-back-menu:hover {
    background: rgba(255,255,255,0.14);
    border-color: rgba(255,255,255,0.2);
    transform: translateY(-1px);
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-controls .btn-small {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 10px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-size: 1rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.header-controls .btn-small:hover {
    background: rgba(255,255,255,0.14);
    border-color: rgba(255,255,255,0.2);
    transform: translateY(-1px);
}

/* ===== 通用屏幕组件 ===== */
.screen-bg-decoration {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.screen-bg-decoration::before,
.screen-bg-decoration::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.35;
}

.screen-bg-decoration::before {
    width: 60vw;
    height: 60vw;
    max-width: 700px;
    max-height: 700px;
    background: radial-gradient(circle, rgba(240,192,64,0.15) 0%, transparent 70%);
    top: -15%;
    left: 50%;
    transform: translateX(-50%);
}

.screen-bg-decoration::after {
    width: 45vw;
    height: 45vw;
    max-width: 550px;
    max-height: 550px;
    background: radial-gradient(circle, rgba(76,175,80,0.1) 0%, transparent 70%);
    bottom: -10%;
    right: 10%;
}

/* 屏幕头部 */
.screen-header {
    text-align: center;
    margin-bottom: 28px;
}

.screen-header__icon {
    font-size: 2.2rem;
    margin-bottom: 8px;
    display: inline-block;
    animation: titleIconFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
}

.screen-header__title {
    font-size: clamp(1.6rem, 3.5vw, 2.2rem);
    font-weight: 800;
    margin: 0 0 6px;
    background: linear-gradient(180deg, #fff 0%, #f0d080 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
}

.screen-header__subtitle {
    font-size: 0.9rem;
    opacity: 0.5;
    margin: 0;
    font-weight: 400;
}

/* 通用按钮 */
.screen-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 14px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.screen-btn:hover {
    transform: translateY(-2px);
}

.screen-btn:active {
    transform: translateY(0);
}

.screen-btn--primary {
    background: linear-gradient(135deg, rgba(240,192,64,0.92) 0%, rgba(212,160,23,0.92) 100%);
    color: #2a1a00;
    box-shadow: 0 6px 24px rgba(240,192,64,0.25), inset 0 1px 0 rgba(255,255,255,0.3);
}

.screen-btn--primary:hover {
    box-shadow: 0 10px 32px rgba(240,192,64,0.4), inset 0 1px 0 rgba(255,255,255,0.4);
}

.screen-btn--accent {
    background: linear-gradient(135deg, rgba(76,175,80,0.85) 0%, rgba(46,125,50,0.85) 100%);
    color: #fff;
    box-shadow: 0 6px 24px rgba(76,175,80,0.25), inset 0 1px 0 rgba(255,255,255,0.2);
}

.screen-btn--accent:hover {
    box-shadow: 0 10px 32px rgba(76,175,80,0.35), inset 0 1px 0 rgba(255,255,255,0.3);
}

.screen-btn--secondary {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.15);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.screen-btn--secondary:hover {
    background: rgba(255,255,255,0.16);
    border-color: rgba(255,255,255,0.25);
}

.screen-btn--danger {
    background: rgba(244,67,54,0.15);
    color: #ff8a80;
    border: 1px solid rgba(244,67,54,0.25);
}

.screen-btn--danger:hover {
    background: rgba(244,67,54,0.25);
    border-color: rgba(244,67,54,0.4);
}

.screen-btn--ghost {
    background: transparent;
    color: rgba(255,255,255,0.6);
    border: 1px solid rgba(255,255,255,0.1);
    font-size: 0.85rem;
    padding: 8px 16px;
}

.screen-btn--ghost:hover {
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.85);
    border-color: rgba(255,255,255,0.18);
}

.screen-btn--large {
    padding: 14px 28px;
    font-size: 1rem;
    width: 100%;
    max-width: 260px;
}

.screen-btn--back {
    margin-top: 16px;
}

/* 表单组件 */
.form-group {
    margin-bottom: 16px;
    text-align: left;
}

.form-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    opacity: 0.65;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.form-input-icon {
    position: absolute;
    left: 14px;
    font-size: 1rem;
    opacity: 0.5;
    pointer-events: none;
    z-index: 1;
}

.form-input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(0,0,0,0.2);
    color: #fff;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.form-input:focus {
    border-color: rgba(240,192,64,0.4);
    background: rgba(0,0,0,0.3);
    box-shadow: 0 0 0 3px rgba(240,192,64,0.1);
}

.form-input::placeholder {
    color: rgba(255,255,255,0.4);
}

.form-input-wrap--readonly .form-input {
    padding-right: 48px;
    padding-left: 14px;
}

.form-select {
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(0,0,0,0.25);
    color: #fff;
    font-size: 0.9rem;
    outline: none;
    cursor: pointer;
    min-width: 120px;
    transition: all 0.2s ease;
}

.form-select:focus {
    border-color: rgba(240,192,64,0.4);
    box-shadow: 0 0 0 3px rgba(240,192,64,0.1);
}

.form-select option {
    background: #1a3a1a;
    color: #fff;
}

.btn-copy {
    position: absolute;
    right: 6px;
    padding: 6px 10px;
    border: none;
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-copy:hover {
    background: rgba(255,255,255,0.2);
}

/* ===== 局域网界面 ===== */
#lan-screen, #custom-screen {
    justify-content: center;
    align-items: center;
    position: relative;
}

.lan-container, .custom-container {
    position: relative;
    z-index: 1;
    background: rgba(0,0,0,0.22);
    border-radius: 24px;
    padding: 36px 32px;
    max-width: 460px;
    width: 92%;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.06);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 16px 48px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.05);
    animation: screenContainerEnter 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes screenContainerEnter {
    0% { transform: translateY(20px) scale(0.97); opacity: 0; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

/* LAN 标签页 */
.lan-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: rgba(0,0,0,0.2);
    border-radius: 14px;
    padding: 4px;
}

.lan-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: rgba(255,255,255,0.5);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lan-tab.active {
    background: rgba(255,255,255,0.1);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.lan-tab:hover:not(.active) {
    color: rgba(255,255,255,0.75);
}

.lan-tab__icon {
    font-size: 1rem;
}

.lan-body {
    text-align: left;
}

.lan-panel {
    animation: panelFadeIn 0.3s ease forwards;
}

@keyframes panelFadeIn {
    0% { opacity: 0; transform: translateY(8px); }
    100% { opacity: 1; transform: translateY(0); }
}

.lan-status-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(255,255,255,0.04);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 16px;
}

.lan-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    flex-shrink: 0;
}

.lan-status-dot.online {
    background: #4caf50;
    box-shadow: 0 0 6px rgba(76,175,80,0.5);
}

.lan-status-dot.offline {
    background: #ff9800;
    box-shadow: 0 0 6px rgba(255,152,0,0.4);
}

.lan-status-text {
    margin: 0;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.65);
    line-height: 1.4;
}

.lan-room-info {
    margin-bottom: 16px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(255,255,255,0.04);
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.06);
}

.info-label {
    font-size: 0.8rem;
    opacity: 0.5;
    font-weight: 500;
}

.info-value {
    font-size: 0.9rem;
    font-weight: 600;
}

.info-value--code {
    font-family: 'SF Mono', Monaco, monospace;
    background: rgba(240,192,64,0.12);
    color: #f0c040;
    padding: 2px 10px;
    border-radius: 6px;
    font-size: 1rem;
    letter-spacing: 1px;
}

.lan-url-row {
    margin-bottom: 16px;
}

.lan-url-row .form-label {
    text-align: left;
}

.lan-player-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 16px 0;
    min-height: 40px;
}

.player-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.06);
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.player-list-item:hover {
    background: rgba(255,255,255,0.08);
}

.player-list-item .player-avatar-small {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(240,192,64,0.3), rgba(240,192,64,0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.player-list-item.host {
    border-color: rgba(240,192,64,0.2);
    background: rgba(240,192,64,0.06);
}

.player-list-item.host .player-role {
    font-size: 0.7rem;
    color: #f0c040;
    margin-left: auto;
}

.lan-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.lan-actions .screen-btn {
    width: 100%;
}

/* ===== 自定义模式 ===== */
.custom-body {
    text-align: left;
}

.config-group {
    margin-bottom: 20px;
    padding: 18px;
    background: rgba(255,255,255,0.04);
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.05);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.config-group__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    margin: 0 0 14px;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.config-group__icon {
    font-size: 1.1rem;
}

.config-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.config-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    transition: all 0.15s ease;
    cursor: pointer;
    min-height: 44px;
}

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

.config-item__label {
    font-size: 0.88rem;
    font-weight: 500;
    opacity: 0.85;
    flex: 1;
}

.config-item__control {
    flex-shrink: 0;
}

.config-item--toggle .config-item__control .toggle-switch-wrap {
    padding: 0;
}

.custom-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.custom-actions .screen-btn {
    width: 100%;
}

/* ===== 加载画面 ===== */
#loading-screen {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #1a5f2a 0%, #0d3d18 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.5s ease;
}

#loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-container {
    text-align: center;
}

.loading-spinner {
    font-size: 4rem;
    animation: spinCard 1.5s ease-in-out infinite;
    margin-bottom: 20px;
}

@keyframes spinCard {
    0%, 100% { transform: rotateY(0deg) scale(1); }
    50% { transform: rotateY(180deg) scale(1.2); }
}

.loading-container h2 {
    font-size: 2rem;
    margin-bottom: 8px;
    letter-spacing: 6px;
}

.loading-container p {
    opacity: 0.6;
    font-size: 0.9rem;
}

/* ===== 侧边面板 ===== */
#side-panels {
    position: fixed;
    top: 60px;
    right: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 30;
}

.btn-panel-toggle {
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: rgba(255,255,255,0.85);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.05);
}

.btn-panel-toggle:hover {
    background: rgba(0,0,0,0.5);
    border-color: rgba(255,255,255,0.2);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.08);
}

.btn-panel-toggle.active {
    background: rgba(240,192,64,0.15);
    border-color: rgba(240,192,64,0.3);
    color: #f0c040;
}

.side-panel {
    position: fixed;
    top: 60px;
    right: 120px;
    width: 280px;
    max-height: 70vh;
    overflow-y: auto;
    background: rgba(15,25,15,0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.08);
    padding: 18px;
    z-index: 25;
    animation: panelIn 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transition: opacity 0.2s ease-in, transform 0.2s ease-in;
    box-shadow: 0 16px 48px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.04);
}
.side-panel.panel-exit {
    opacity: 0;
    transform: translateX(10px);
    pointer-events: none;
}

@keyframes panelIn {
    from { opacity: 0; transform: translateX(12px) scale(0.98); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

.side-panel h4 {
    font-size: 0.85rem;
    font-weight: 700;
    margin: 0 0 14px;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tracker-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.tracker-cell {
    padding: 6px 4px;
    border-radius: 6px;
    background: rgba(255,255,255,0.05);
    text-align: center;
    font-size: 0.75rem;
    position: relative;
    transition: all 0.2s;
}

.tracker-cell.red { color: #ff8a8a; }
.tracker-cell.black { color: #ccc; }
.tracker-cell.played {
    opacity: 0.25;
    text-decoration: line-through;
}

.tracker-count {
    display: block;
    font-size: 0.65rem;
    opacity: 0.6;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 50vh;
    overflow-y: auto;
}

.history-entry {
    padding: 6px 10px;
    border-radius: 6px;
    background: rgba(255,255,255,0.05);
    font-size: 0.8rem;
    word-break: break-all;
    border-left: 3px solid transparent;
}

.history-entry.history-bomb {
    background: rgba(244,67,54,0.12);
    border-left-color: #f44336;
}

.history-entry.history-rocket {
    background: rgba(255,215,0,0.15);
    border-left-color: #ffd700;
    color: #ffe082;
}

.history-entry.history-pass {
    opacity: 0.6;
    font-style: italic;
}

.history-time {
    display: inline-block;
    min-width: 36px;
    font-size: 0.7rem;
    opacity: 0.5;
    margin-right: 6px;
    font-family: monospace;
}

.chat-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 40vh;
    overflow-y: auto;
    margin-bottom: 12px;
}

.chat-message {
    padding: 6px 10px;
    border-radius: 8px;
    background: rgba(255,255,255,0.08);
    font-size: 0.8rem;
    word-break: break-all;
}

.chat-message .chat-sender {
    font-weight: 600;
    color: #f0c040;
    margin-right: 6px;
}

.chat-input-area {
    display: flex;
    gap: 6px;
}

.chat-input-area input {
    flex: 1;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.08);
    color: #fff;
    font-size: 0.8rem;
}

.chat-input-area input::placeholder {
    color: rgba(255,255,255,0.4);
}

.chat-input-area button {
    padding: 6px 12px;
    border-radius: 6px;
    border: none;
    background: linear-gradient(135deg, #f0c040, #d4a017);
    color: #2a1a00;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

/* ===== 特效动画 ===== */
.particle {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 300;
    animation: particleFly 0.8s ease-out forwards;
}

@keyframes particleFly {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(var(--tx), var(--ty)) scale(0); opacity: 0; }
}

.shockwave {
    position: fixed;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 3px solid rgba(255, 100, 50, 0.6);
    pointer-events: none;
    z-index: 299;
    animation: shockwaveExpand 0.6s ease-out forwards;
}

@keyframes shockwaveExpand {
    0% { transform: scale(0); opacity: 1; }
    100% { transform: scale(2.5); opacity: 0; }
}

.rocket-anim {
    position: fixed;
    font-size: 2rem;
    pointer-events: none;
    z-index: 300;
    animation: rocketFly 1s ease-in forwards;
}

@keyframes rocketFly {
    0% { transform: translate(0, 0) scale(0.5) rotate(-45deg); opacity: 0; }
    20% { opacity: 1; }
    100% { transform: translate(var(--end-x), var(--end-y)) scale(1.2) rotate(-45deg); opacity: 0; }
}

.flame-particle {
    position: fixed;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(orange, red);
    pointer-events: none;
    z-index: 299;
    animation: flameFade 0.4s ease-out forwards;
}

@keyframes flameFade {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(0); opacity: 0; }
}

.floating-text {
    position: fixed;
    font-size: 1.5rem;
    font-weight: 800;
    pointer-events: none;
    z-index: 300;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
    animation: floatUp 1.2s ease-out forwards;
}

@keyframes floatUp {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(var(--float-y, -50px)); opacity: 0; }
}

.landlord-crown {
    position: fixed;
    font-size: 2.5rem;
    pointer-events: none;
    z-index: 300;
    animation: crownPop 2s ease-out forwards;
}

@keyframes crownPop {
    0% { transform: scale(0) rotate(-20deg); opacity: 0; }
    30% { transform: scale(1.3) rotate(10deg); opacity: 1; }
    60% { transform: scale(1) rotate(0deg); opacity: 1; }
    100% { transform: scale(1) translateY(-30px); opacity: 0; }
}

/* ===== 快捷短语 ===== */
.quick-phrases {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.quick-phrases button {
    padding: 5px 10px;
    border: none;
    border-radius: 14px;
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-phrases button:hover {
    background: rgba(240,192,64,0.4);
    transform: scale(1.05);
}

/* ===== AI/玩家快捷短语气泡 ===== */
.chat-bubble {
    position: absolute;
    top: -32px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.82);
    color: #fff;
    padding: 5px 14px;
    border-radius: 12px;
    font-size: 0.85rem;
    white-space: nowrap;
    z-index: 50;
    pointer-events: none;
    animation: chatPop 0.3s ease-out;
    border: 1px solid rgba(255,255,255,0.10);
    font-weight: 500;
}

@keyframes chatPop {
    0% { transform: translateX(-50%) scale(0.5); opacity: 0; }
    100% { transform: translateX(-50%) scale(1); opacity: 1; }
}

/* ===== 记牌器（增强版） ===== */
#tracker-content {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
}

.tracker-rank {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 4px;
    border-radius: 8px;
    background: rgba(255,255,255,0.08);
    transition: all 0.3s;
    cursor: default;
}

.tracker-rank-label {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.tracker-rank-count {
    font-size: 0.9rem;
    font-weight: 700;
    padding: 1px 8px;
    border-radius: 10px;
    background: rgba(76,175,80,0.3);
    color: #fff;
}

.tracker-rank.full .tracker-rank-count {
    background: rgba(76,175,80,0.3);
}

.tracker-rank.low .tracker-rank-count {
    background: rgba(255,152,0,0.4);
}

.tracker-rank.empty {
    opacity: 0.3;
}

.tracker-rank.empty .tracker-rank-count {
    background: rgba(255,255,255,0.1);
    text-decoration: line-through;
}

/* ===== 癞子牌样式 ===== */
.card.laizi {
    border: 2px solid #ffeb3b;
    box-shadow: 0 0 8px rgba(255,235,59,0.5), inset 0 0 4px rgba(255,235,59,0.3);
    animation: laiziGlow 2s ease-in-out infinite;
}

@keyframes laiziGlow {
    0%, 100% { box-shadow: 0 0 8px rgba(255,235,59,0.5), inset 0 0 4px rgba(255,235,59,0.3); }
    50% { box-shadow: 0 0 16px rgba(255,235,59,0.8), inset 0 0 8px rgba(255,235,59,0.5); }
}

.card.laizi::after {
    content: '癞';
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 0.55rem;
    color: #ffeb3b;
    background: rgba(0,0,0,0.6);
    padding: 1px 3px;
    border-radius: 3px;
    font-weight: 700;
}

/* ===== 多局赛制 ===== */
.match-round {
    font-size: 0.9rem;
    color: var(--accent-color);
    font-weight: 600;
    margin-bottom: 8px;
    padding: 4px 12px;
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
    display: inline-block;
}

.match-round.match-end {
    font-size: 1.2rem;
    color: #f0c040;
    background: rgba(240,192,64,0.15);
}

.match-scores {
    margin: 12px 0;
    padding: 12px;
    background: rgba(0,0,0,0.15);
    border-radius: 10px;
}

.match-scores h4 {
    margin-bottom: 8px;
    font-size: 0.85rem;
    opacity: 0.7;
}

.match-score-item {
    display: flex;
    justify-content: space-between;
    padding: 4px 8px;
    font-size: 0.9rem;
}

.match-score-item.first {
    color: #f0c040;
    font-weight: 700;
    background: rgba(240,192,64,0.1);
    border-radius: 6px;
}

/* ===== 锦标赛每局中间信息 ===== */
.tour-round-info {
    margin-top: 12px;
    padding: 12px;
    background: rgba(0,0,0,0.15);
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.06);
}

.tour-round-title {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
    opacity: 0.9;
}

.tour-deltas {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}

.tour-delta {
    font-size: 0.78rem;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(255,255,255,0.05);
}

.tour-delta.positive {
    color: #4caf50;
    background: rgba(76,175,80,0.1);
}

.tour-delta.negative {
    color: #ef5350;
    background: rgba(239,83,80,0.1);
}

.tour-ranks {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.tour-rank {
    font-size: 0.78rem;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(255,255,255,0.05);
}

.tour-rank.up {
    color: #4caf50;
}

.tour-rank.down {
    color: #ef5350;
}

.tour-rank.same {
    opacity: 0.6;
}

.tour-mvp {
    font-size: 0.85rem;
    color: #f0c040;
    font-weight: 600;
    padding: 4px 0;
}

/* ===== 锦标赛结算面板 ===== */
.tour-podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 12px;
    margin: 16px 0 20px;
    padding: 12px;
    background: rgba(0,0,0,0.15);
    border-radius: 12px;
}

.tour-podium-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    min-width: 80px;
    text-align: center;
}

.tour-podium-item.rank-1 {
    background: linear-gradient(135deg, rgba(240,192,64,0.2), rgba(212,160,23,0.15));
    border: 1px solid rgba(240,192,64,0.3);
    transform: scale(1.08);
    padding: 14px 18px;
}

.tour-podium-item.rank-2 {
    background: rgba(192,192,192,0.1);
    border: 1px solid rgba(192,192,192,0.2);
}

.tour-podium-item.rank-3 {
    background: rgba(205,127,50,0.1);
    border: 1px solid rgba(205,127,50,0.2);
}

.tour-podium-item.is-human {
    box-shadow: 0 0 12px rgba(240,192,64,0.2);
}

.tour-podium-rank {
    font-size: 1.6rem;
    margin-bottom: 4px;
}

.tour-podium-name {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.tour-podium-score {
    font-size: 0.8rem;
    opacity: 0.8;
}

.tour-player-summary {
    margin: 12px 0;
    padding: 14px;
    background: rgba(255,255,255,0.04);
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.06);
}

.tour-summary-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 10px;
    text-align: center;
}

.tour-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.tour-summary-grid > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px;
    background: rgba(0,0,0,0.1);
    border-radius: 8px;
}

.tour-summary-grid > div span {
    font-size: 0.72rem;
    opacity: 0.7;
}

.tour-summary-grid > div strong {
    font-size: 1rem;
    color: #f0c040;
    margin-top: 2px;
}

.tour-history {
    margin: 12px 0;
    max-height: 200px;
    overflow-y: auto;
}

.tour-history-title {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
    opacity: 0.9;
}

.tour-history-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tour-history-round {
    padding: 8px 10px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    font-size: 0.8rem;
}

.tour-history-header {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 0.82rem;
}

.tour-history-scores {
    display: flex;
    gap: 10px;
    margin-bottom: 2px;
}

.tour-history-scores .human {
    color: #f0c040;
    font-weight: 600;
}

.tour-history-meta {
    font-size: 0.75rem;
    opacity: 0.7;
    display: flex;
    gap: 10px;
}

/* ===== 锦标赛配置面板 ===== */
#tournament-setup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.25s ease;
}

#tournament-setup-overlay.hidden {
    display: none;
}

.tournament-setup-modal {
    background: linear-gradient(145deg, rgba(30,45,38,0.96), rgba(16,28,22,0.98));
    padding: 28px;
    border-radius: 20px;
    max-width: 420px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    border: 1px solid rgba(255,255,255,0.1);
    animation: modalScaleIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.tournament-setup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.tournament-setup-header h2 {
    font-size: 1.15rem;
    margin: 0;
}

.tour-config-group {
    margin-bottom: 18px;
}

.tour-config-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
    opacity: 0.85;
}

.tour-round-options {
    display: flex;
    gap: 8px;
}

.tour-round-btn {
    flex: 1;
    padding: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04);
    color: #fff;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.tour-round-btn:hover {
    background: rgba(255,255,255,0.1);
}

.tour-round-btn.active {
    background: linear-gradient(135deg, rgba(240,192,64,0.3), rgba(212,160,23,0.3));
    border-color: rgba(240,192,64,0.4);
    font-weight: 600;
}

.tour-custom-rounds {
    margin-top: 10px;
    font-size: 0.82rem;
    opacity: 0.8;
}

.tour-custom-rounds input {
    width: 60px;
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(0,0,0,0.2);
    color: #fff;
    text-align: center;
    font-size: 0.85rem;
}

.tour-select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.2);
    color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
}

.tour-desc-text {
    font-size: 0.78rem;
    line-height: 1.6;
    opacity: 0.7;
    padding: 10px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
}

.tour-stats-preview {
    margin-top: 12px;
    padding: 12px;
    background: rgba(255,255,255,0.03);
    border-radius: 10px;
    font-size: 0.8rem;
}

.tour-stats-preview-title {
    font-weight: 600;
    margin-bottom: 6px;
    opacity: 0.9;
}

.tour-stats-preview-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

.tour-stats-preview-grid > div {
    display: flex;
    justify-content: space-between;
    padding: 4px 6px;
    background: rgba(0,0,0,0.1);
    border-radius: 6px;
}

.tournament-setup-footer {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

.tournament-setup-footer .btn-primary {
    padding: 12px 32px;
    font-size: 1rem;
    border-radius: 12px;
}

/* ===== 回放界面 ===== */
#replay-screen {
    overflow-y: auto;
    position: relative;
}

#replay-container {
    padding: 32px 20px;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

.replay-container h2 {
    text-align: center;
    margin-bottom: 6px;
    font-size: clamp(1.4rem, 3vw, 1.8rem);
    font-weight: 800;
    background: linear-gradient(180deg, #fff 0%, #f0d080 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.replay-subtitle {
    text-align: center;
    opacity: 0.5;
    margin-bottom: 28px;
    font-size: 0.9rem;
    font-weight: 400;
}

.replay-empty {
    text-align: center;
    padding: 80px 20px;
    opacity: 0.4;
    font-size: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.replay-empty::before {
    content: '📹';
    font-size: 3rem;
    opacity: 0.5;
    display: block;
    margin-bottom: 8px;
}

.replay-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.replay-item {
    background: rgba(0,0,0,0.22);
    border-radius: 16px;
    padding: 18px 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    justify-content: space-between;
    border: 1px solid rgba(255,255,255,0.05);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.2s ease;
}

.replay-item:hover {
    background: rgba(0,0,0,0.3);
    border-color: rgba(255,255,255,0.1);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.replay-info {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.replay-date {
    font-size: 0.8rem;
    opacity: 0.55;
    font-weight: 500;
}

.replay-mode {
    font-size: 0.72rem;
    padding: 3px 10px;
    background: rgba(240,192,64,0.15);
    border: 1px solid rgba(240,192,64,0.2);
    border-radius: 20px;
    color: #f0c040;
    font-weight: 600;
}

.replay-result {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.replay-winner {
    font-weight: 700;
    color: #81c784;
}

.replay-mult {
    font-size: 0.8rem;
    opacity: 0.55;
}

.replay-players {
    font-size: 0.85rem;
    opacity: 0.75;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.landlord-tag {
    color: #f0c040;
    font-weight: 700;
}

.btn-replay-watch {
    padding: 8px 18px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(240,192,64,0.9) 0%, rgba(212,160,23,0.9) 100%);
    color: #2a1a00;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(240,192,64,0.2);
}

.btn-replay-watch:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 18px rgba(240,192,64,0.3);
}

/* 回放牌桌 */
.replay-board {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.replay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
}

.replay-header h3 {
    margin: 0;
}

.replay-step-info {
    display: flex;
    gap: 16px;
    align-items: center;
    font-size: 0.9rem;
}

.replay-table {
    background: rgba(0,0,0,0.15);
    border-radius: 12px;
    padding: 16px;
    min-height: 200px;
}

.replay-players-area {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.replay-player {
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    padding: 12px;
    border-left: 3px solid transparent;
    transition: all 0.3s;
}

.replay-player.landlord {
    border-left-color: #f0c040;
    background: rgba(240,192,64,0.08);
}

.replay-player.active {
    background: rgba(76,175,80,0.1);
    border-left-color: #4caf50;
}

.replay-player-name {
    font-weight: 600;
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.replay-card-count {
    font-size: 0.8rem;
    opacity: 0.6;
    font-weight: 400;
}

.replay-player-hand {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-end;
    min-height: 48px;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    padding: 4px 4px 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(240,192,64,0.55) rgba(255,255,255,0.08);
}

.replay-card {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 0 0 38px;
    width: 38px;
    height: 50px;
    margin-left: -8px;
    background: linear-gradient(145deg, #fff 0%, #f5f1e8 100%);
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 800;
    border: 1px solid rgba(0,0,0,0.14);
    position: relative;
    box-shadow: 0 5px 12px rgba(0,0,0,0.24), inset 0 1px 0 rgba(255,255,255,0.9);
    color: #222;
    line-height: 1;
}

.replay-card:first-child {
    margin-left: 0;
}

.replay-card-rank {
    position: absolute;
    top: 5px;
    left: 5px;
    font-size: 0.78rem;
}

.replay-card-suit {
    font-size: 1.25rem;
    margin-top: 8px;
}

.replay-joker-text {
    writing-mode: vertical-rl;
    letter-spacing: 0;
    font-size: 0.75rem;
    line-height: 1;
}

.replay-card.red {
    color: #d32f2f !important;
}

.replay-card.black {
    color: #222 !important;
}

.replay-bottom-area {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.replay-bottom-cards {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 54px;
}

.replay-bottom-cards .replay-card,
.replay-last-cards .replay-card {
    margin-left: -6px;
}

.replay-bottom-label {
    font-size: 0.8rem;
    opacity: 0.7;
}

.replay-last-play {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.replay-last-label {
    font-size: 0.8rem;
    opacity: 0.6;
}

.replay-last-player {
    font-weight: 600;
}

.replay-last-type {
    font-size: 0.8rem;
    color: #f0c040;
}

.replay-last-cards {
    display: flex;
    align-items: flex-end;
    min-height: 54px;
    overflow-x: auto;
    padding: 4px 2px 6px;
}

/* 回放控制栏 */
.replay-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px;
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    flex-wrap: wrap;
}

.replay-controls button {
    padding: 8px 14px;
    border: none;
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    color: #fff;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}

.replay-controls button:hover {
    background: rgba(255,255,255,0.2);
}

#replay-slider {
    flex: 1;
    min-width: 120px;
    max-width: 300px;
}

#replay-speed {
    font-size: 0.8rem !important;
    font-weight: 600;
    min-width: 40px;
}

/* 回放 meta 栏 */
.replay-meta-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: rgba(0,0,0,0.15);
    border-radius: 10px;
}

#replay-copy-report {
    padding: 6px 14px;
    border: none;
    border-radius: 8px;
    background: rgba(76,175,80,0.2);
    color: #81c784;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

#replay-copy-report:hover {
    background: rgba(76,175,80,0.35);
}

.replay-key-moments {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.replay-key-moments span {
    font-size: 0.8rem;
    opacity: 0.6;
}

.replay-moment-btn {
    padding: 4px 8px;
    border: none;
    border-radius: 6px;
    background: rgba(255,255,255,0.08);
    color: #fff;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}

.replay-moment-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.1);
}

.replay-shortcut-hint {
    text-align: center;
    font-size: 0.75rem;
    opacity: 0.35;
    padding: 4px 0;
}

/* 回放中的癞子标记 */
.replay-card.laizi {
    border: 2px solid #ff9800 !important;
    box-shadow: 0 0 8px rgba(255,152,0,0.3);
}

.laizi-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    font-size: 0.6rem;
    background: #ff9800;
    color: #000;
    padding: 1px 4px;
    border-radius: 4px;
    font-weight: 700;
    z-index: 2;
}

/* 回放中的炸弹/王炸标记 */
.replay-bomb-badge {
    font-size: 1.2rem;
    margin-left: 6px;
}

/* 春天/反春天标记 */
.replay-spring-badge {
    background: rgba(129,199,132,0.15);
    color: #81c784;
    padding: 6px 14px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
}

.replay-spring-badge.anti {
    background: rgba(239,83,80,0.15);
    color: #ef5350;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .game-title {
        font-size: 2.2rem;
    }
    
    .menu-buttons {
        gap: 12px;
    }
    
    .btn-primary {
        padding: 12px 18px;
        font-size: 1rem;
    }
    
    .btn-primary .icon {
        font-size: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .player-avatar {
        width: 36px;
        height: 36px;
        font-size: 1.2rem;
    }
    
    .player-name {
        font-size: 0.75rem;
    }
    
    .card {
        width: 52px;
        height: 74px;
    }

    #player-right .hand-front .card {
        margin-left: -34px;
    }

    .card-corner .rank {
        font-size: 0.95rem;
    }

    .card-corner .suit {
        font-size: 0.8rem;
    }

    .card-center {
        font-size: 1.8rem;
    }

    .joker-text {
        font-size: 1.1rem;
    }
    
    .hand-front {
        min-height: 90px;
        padding: 4px 8px;
    }
    
    #controls-area {
        padding: 10px 12px 16px;
    }
    
    #play-controls button {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    #call-controls button {
        padding: 8px 14px;
        font-size: 0.85rem;
    }
    
    .side-panel {
        right: 8px;
        width: 220px;
        padding: 12px;
    }
    
    .btn-panel-toggle {
        padding: 6px 10px;
        font-size: 0.75rem;
    }
    
    .game-header h2 {
        font-size: 1rem;
    }
    
    .mode-badge {
        font-size: 0.7rem;
        padding: 2px 8px;
    }
}


/* ===== 增强动画系统 ===== */

/* 屏幕震动 */
.screen-shake {
    animation: screenShake 0.4s ease-in-out;
}

@keyframes screenShake {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-4px, 3px); }
    20% { transform: translate(4px, -3px); }
    30% { transform: translate(-3px, 2px); }
    40% { transform: translate(3px, -2px); }
    50% { transform: translate(-2px, 1px); }
    60% { transform: translate(2px, -1px); }
    70% { transform: translate(-1px, 0px); }
    80% { transform: translate(1px, 0px); }
}

/* 屏幕闪光 */
.screen-flash {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1000;
    animation: screenFlash 0.3s ease-out forwards;
}

@keyframes screenFlash {
    0% { opacity: 0.6; }
    100% { opacity: 0; }
}

/* 发牌飞行 */
.deal-fly-card {
    position: fixed;
    width: 50px;
    height: 70px;
    border-radius: 6px;
    background: linear-gradient(145deg, #c41e3a, #8b0000);
    border: 2px solid rgba(255,255,255,0.3);
    pointer-events: none;
    z-index: 400;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.deal-fly-card::after {
    content: '🃏';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    opacity: 0.6;
}

/* 卡牌翻转 */
.card-flip-3d {
    transform-style: preserve-3d;
    animation: cardFlip3D 0.6s ease-in-out;
}

@keyframes cardFlip3D {
    0% { transform: rotateY(0deg) scale(1); }
    50% { transform: rotateY(90deg) scale(1.1); }
    100% { transform: rotateY(0deg) scale(1); }
}

/* 弹跳进入 */
.pop-in {
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popIn {
    0% { transform: scale(0) translate(-50%, -50%); opacity: 0; }
    60% { transform: scale(1.15) translate(-50%, -50%); opacity: 1; }
    100% { transform: scale(1) translate(-50%, -50%); opacity: 1; }
}

.pop-out {
    animation: popOut 0.25s ease-in forwards;
}

@keyframes popOut {
    0% { transform: scale(1) translate(-50%, -50%); opacity: 1; }
    100% { transform: scale(0) translate(-50%, -50%); opacity: 0; }
}

/* 脉冲光环 */
.pulse-ring {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 250;
    animation: pulseRingExpand 1s ease-out forwards;
}

@keyframes pulseRingExpand {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0.8; }
    100% { transform: translate(-50%, -50%) scale(2.5); opacity: 0; }
}

/* 彩带 */
.confetti-piece {
    position: fixed;
    pointer-events: none;
    z-index: 500;
    animation: confettiFall 2s ease-out forwards;
}

@keyframes confettiFall {
    0% { transform: translateY(0) rotate(0deg) scale(1); opacity: 1; }
    100% { transform: translateY(400px) rotate(720deg) scale(0.5); opacity: 0; }
}

/* 闪烁粒子 */
.sparkle-piece {
    position: fixed;
    pointer-events: none;
    z-index: 500;
    font-size: 1.2rem;
    animation: sparkleFly 1s ease-out forwards;
}

@keyframes sparkleFly {
    0% { transform: translate(0, 0) scale(0) rotate(0deg); opacity: 1; }
    50% { transform: translate(var(--sx), var(--sy)) scale(1.2) rotate(180deg); opacity: 1; }
    100% { transform: translate(calc(var(--sx) * 1.5), calc(var(--sy) * 1.5)) scale(0) rotate(360deg); opacity: 0; }
}

/* 光晕爆发 */
.glow-burst {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 250;
    animation: glowBurstExpand 0.8s ease-out forwards;
}

@keyframes glowBurstExpand {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0.7; }
    100% { transform: translate(-50%, -50%) scale(3); opacity: 0; }
}

/* 拖尾 */
.trail-dot {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 300;
    animation: trailFade 0.5s ease-out forwards;
}

@keyframes trailFade {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(0); opacity: 0; }
}

/* 数字跳动 */
.count-jump {
    animation: countJump 0.3s ease-out;
}

@keyframes countJump {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); color: #ffeb3b; }
    100% { transform: scale(1); }
}

/* 弹跳文字 */
.bounce-text {
    position: fixed;
    pointer-events: none;
    z-index: 400;
    font-size: 1.4rem;
    font-weight: 800;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
    animation: bounceTextAnim 1.2s ease-out forwards;
}

@keyframes bounceTextAnim {
    0% { transform: translate(-50%, 0) scale(0.3); opacity: 0; }
    40% { transform: translate(-50%, -30px) scale(1.2); opacity: 1; }
    60% { transform: translate(-50%, -20px) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -80px) scale(0.8); opacity: 0; }
}

/* 滑入 */
.slide-in-bottom {
    animation: slideInBottom 0.4s ease-out forwards;
}

.slide-in-top {
    animation: slideInTop 0.4s ease-out forwards;
}

.slide-in-left {
    animation: slideInLeft 0.4s ease-out forwards;
}

.slide-in-right {
    animation: slideInRight 0.4s ease-out forwards;
}

@keyframes slideInBottom {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes slideInTop {
    from { transform: translateY(-30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes slideInLeft {
    from { transform: translateX(-30px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInRight {
    from { transform: translateX(30px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* 旋转退出 */
.rotate-out {
    animation: rotateOutAnim 0.35s ease-in forwards;
}

@keyframes rotateOutAnim {
    0% { transform: translate(-50%, -50%) scale(1) rotate(0deg); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(0) rotate(180deg); opacity: 0; }
}

/* 波纹 */
.ripple-effect {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 200;
    animation: rippleExpand 0.8s ease-out forwards;
}

@keyframes rippleExpand {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0.5; }
    100% { transform: translate(-50%, -50%) scale(4); opacity: 0; }
}

/* 轨道旋转 */
.orbit-emoji {
    position: fixed;
    pointer-events: none;
    z-index: 300;
    font-size: 1.5rem;
    animation: orbitAnim var(--orbit-duration, 2s) linear forwards;
}

@keyframes orbitAnim {
    0% { transform: rotate(0deg) translateX(var(--orbit-radius, 60px)) rotate(0deg); opacity: 1; }
    100% { transform: rotate(360deg) translateX(var(--orbit-radius, 60px)) rotate(-360deg); opacity: 0; }
}

/* 春天特效花瓣 */
.petal {
    position: fixed;
    pointer-events: none;
    z-index: 500;
    font-size: 1.5rem;
    animation: petalFall 3s ease-in-out forwards;
}

@keyframes petalFall {
    0% { transform: translateY(-50px) rotate(0deg) translateX(0); opacity: 1; }
    25% { transform: translateY(100px) rotate(90deg) translateX(30px); opacity: 0.9; }
    50% { transform: translateY(250px) rotate(180deg) translateX(-20px); opacity: 0.7; }
    75% { transform: translateY(400px) rotate(270deg) translateX(25px); opacity: 0.4; }
    100% { transform: translateY(600px) rotate(360deg) translateX(0); opacity: 0; }
}

/* 胜利大文字 */
.win-big-text {
    position: fixed;
    top: 35%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    font-weight: 900;
    pointer-events: none;
    z-index: 600;
    text-shadow: 0 4px 20px rgba(0,0,0,0.5);
    animation: winTextAnim 2s ease-out forwards;
    white-space: nowrap;
}

@keyframes winTextAnim {
    0% { transform: translate(-50%, -50%) scale(0) rotate(-10deg); opacity: 0; }
    30% { transform: translate(-50%, -50%) scale(1.3) rotate(3deg); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1) rotate(0deg); opacity: 1; }
    80% { transform: translate(-50%, -50%) scale(1) rotate(0deg); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(0.9) rotate(0deg); opacity: 0; }
}

/* 模态框缩放进入 */
.modal-scale-in {
    animation: modalScaleIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes modalScaleIn {
    0% { transform: scale(0.7); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* 底牌揭示 */
.bottom-reveal-card {
    animation: bottomReveal 0.5s ease-out forwards;
}

@keyframes bottomReveal {
    0% { transform: rotateY(90deg) scale(0.8); opacity: 0; }
    100% { transform: rotateY(0deg) scale(1); opacity: 1; }
}

/* 托管机器人 */
.robot-icon {
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 1.2rem;
    background: rgba(0,0,0,0.7);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: robotSpin 2s linear infinite;
    z-index: 10;
}

@keyframes robotSpin {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
    100% { transform: rotate(0deg); }
}

/* 回合脉冲指示器 */
.turn-pulse::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 16px;
    border: 2px solid rgba(240,192,64,0.4);
    animation: turnPulseRing 1.5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes turnPulseRing {
    0% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.05); opacity: 0.2; }
    100% { transform: scale(1); opacity: 0.6; }
}

/* Toast 弹跳 */
.toast-bounce {
    animation: toastBounce 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes toastBounce {
    0% { transform: translateX(-50%) translateY(-30px) scale(0.8); opacity: 0; }
    60% { transform: translateX(-50%) translateY(5px) scale(1.05); opacity: 1; }
    100% { transform: translateX(-50%) translateY(0) scale(1); opacity: 1; }
}

/* 出牌区卡牌飞入 */
.card-play-flyin {
    animation: cardPlayFlyIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes cardPlayFlyIn {
    0% { transform: translate(var(--fly-from-x, 0), var(--fly-from-y, 0)) scale(0.5); opacity: 0; }
    100% { transform: translate(0, 0) scale(var(--play-scale, 0.9)); opacity: 1; }
}

/* 星星闪烁背景 */
.star-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 550;
    overflow: hidden;
}

.star-bg .star {
    position: absolute;
    font-size: 1rem;
    animation: starTwinkle 2s ease-in-out infinite;
}

@keyframes starTwinkle {
    0%, 100% { opacity: 0.2; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* 倒计时条 */
.countdown-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #f0c040, #ff5722);
    border-radius: 2px;
    animation: countdownShrink linear forwards;
}

@keyframes countdownShrink {
    from { width: 100%; }
    to { width: 0%; }
}

/* 记分牌发光 */
.score-glow {
    animation: scoreGlow 0.5s ease-out;
}

@keyframes scoreGlow {
    0% { text-shadow: 0 0 0 transparent; }
    50% { text-shadow: 0 0 20px rgba(240,192,64,0.8); }
    100% { text-shadow: 0 0 0 transparent; }
}

/* 手牌入场 */
.hand-card-enter {
    animation: handCardEnter 0.3s ease-out forwards;
}

@keyframes handCardEnter {
    0% { transform: translateY(40px) rotate(5deg); opacity: 0; }
    100% { transform: translateY(0) rotate(0deg); opacity: 1; }
}

/* 菜单按钮入场 */
.menu-btn-enter {
    animation: menuBtnEnter 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    opacity: 0;
}

@keyframes menuBtnEnter {
    0% { transform: translateY(30px) scale(0.9); opacity: 0; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

/* 加载增强 */
.loading-enhanced {
    animation: loadingPulse 1.5s ease-in-out infinite;
}

@keyframes loadingPulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
}

/* 快捷短语弹跳 */
.phrase-bounce {
    animation: phraseBounce 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes phraseBounce {
    0% { transform: scale(0.5); opacity: 0; }
    60% { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

/* ===== 暂停覆盖层 ===== */
#pause-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    flex-direction: column;
}

.pause-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.pause-card {
    position: relative;
    z-index: 1;
    background: rgba(20,30,20,0.85);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 24px;
    padding: 40px 48px;
    text-align: center;
    box-shadow: 0 24px 64px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.06);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    max-width: 340px;
    width: 90%;
    animation: pauseCardEnter 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes pauseCardEnter {
    0% { transform: translateY(20px) scale(0.95); opacity: 0; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

.pause-card__icon {
    font-size: 3rem;
    margin-bottom: 8px;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
    animation: pauseIconPulse 2s ease-in-out infinite;
}

@keyframes pauseIconPulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
}

.pause-card__title {
    font-size: 1.6rem;
    font-weight: 800;
    margin: 0 0 10px;
    background: linear-gradient(180deg, #fff 0%, #f0d080 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.pause-card__hint {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.45);
    margin: 0 0 24px;
}

.pause-kbd {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    font-family: inherit;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.6);
}

.pause-card__actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

/* ===== 帮助面板 ===== */
#help-panel {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9997;
}

.help-content {
    background: var(--panel-bg);
    border: 1px solid rgba(240,192,64,0.3);
    border-radius: 16px;
    padding: 28px 36px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.help-content h3 {
    text-align: center;
    margin-bottom: 16px;
    color: #f0c040;
}

.help-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 20px;
    margin-bottom: 20px;
}

.help-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.help-item kbd {
    min-width: 36px;
    text-align: center;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.8rem;
    font-family: monospace;
}

.help-content .btn-small {
    display: block;
    margin: 0 auto;
}

.rules-grid .help-item {
    padding: 4px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.rules-grid .help-item:last-child {
    border-bottom: none;
}

.rule-name {
    font-weight: 600;
    color: #f0c040;
    min-width: 70px;
}

.help-tip {
    text-align: center;
    font-size: 0.8rem;
    opacity: 0.7;
    margin: 8px 0 16px;
}

/* ===== 新手引导 ===== */
.tutorial-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tutorial-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
}

.tut-icon {
    font-size: 1.6rem;
    width: 36px;
    text-align: center;
    flex-shrink: 0;
}

.tutorial-step p {
    font-size: 0.85rem;
    line-height: 1.4;
    margin: 0;
}

.tutorial-step strong {
    color: #f0c040;
}

.tutorial-skip {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    opacity: 0.8;
    margin-top: 4px;
    cursor: pointer;
}

.tutorial-skip input {
    cursor: pointer;
}

/* ===== 音量滑块 ===== */
.volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0;
}

.volume-control label {
    display: block;
    font-size: 0.85rem;
    min-width: 50px;
    color: rgba(255,255,255,0.8);
}

.volume-control input[type="range"] {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
    outline: none;
}
.volume-control input[type="range"]:focus-visible {
    outline: 2px solid rgba(240,192,64,0.5);
    outline-offset: 4px;
}

.volume-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #f0c040;
    cursor: pointer;
}

.volume-control input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #f0c040;
    cursor: pointer;
    border: none;
}

.volume-value {
    font-size: 0.8rem;
    min-width: 32px;
    text-align: right;
    color: rgba(255,255,255,0.6);
}

/* ===== UI/UX polish: table presence, first-person layout, smoother feedback ===== */
:root {
    --surface-line: rgba(255,255,255,0.12);
    --surface-soft: rgba(255,255,255,0.08);
    --shadow-heavy: 0 18px 48px rgba(0,0,0,0.34);
    --shadow-card: 0 10px 24px rgba(0,0,0,0.28);
}

body {
    background:
        radial-gradient(circle at 18% 18%, rgba(240,192,64,0.16), transparent 26vw),
        radial-gradient(circle at 82% 12%, rgba(220,55,50,0.13), transparent 24vw),
        radial-gradient(circle at 50% 115%, rgba(80,190,135,0.12), transparent 36vw),
        var(--bg-gradient);
    letter-spacing: 0;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: radial-gradient(circle at center, rgba(0,0,0,0.72), transparent 78%);
    opacity: 0.55;
}

button, input, select {
    font: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 3px;
}

.game-title,
.game-subtitle {
    letter-spacing: 0;
}

#game-table {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.game-header {
    border-bottom: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 10px 30px rgba(0,0,0,0.16);
}

#ddz-table {
    grid-template-rows: 140px 1fr 430px;
    grid-template-columns: 200px 1fr 200px;
    max-width: 1280px;
    height: 100%;
    padding: 18px 18px 60px;
    isolation: isolate;
    transform: scale(var(--ddz-table-scale, 1));
}

#ddz-table::before {
    content: '';
    position: absolute;
    inset: 18px 18px 60px;
    z-index: -2;
    border-radius: 32px;
    background:
        radial-gradient(ellipse at center, rgba(255,255,255,0.08), transparent 52%),
        linear-gradient(145deg, rgba(0,0,0,0.18), rgba(255,255,255,0.035));
    border: 1px solid rgba(255,255,255,0.10);
    box-shadow: inset 0 0 90px rgba(0,0,0,0.20), var(--shadow-heavy);
}

#ddz-table::after {
    content: '';
    position: absolute;
    inset: 34px 50px 160px;
    z-index: -1;
    border-radius: 50%;
    border: 1px solid rgba(240,192,64,0.12);
    box-shadow: inset 0 0 30px rgba(240,192,64,0.06);
}

.table-aura {
    position: absolute;
    inset: 18% 18% 28%;
    z-index: -1;
    border-radius: 999px;
    background: radial-gradient(ellipse at center, rgba(240,192,64,0.16), transparent 64%);
    filter: blur(10px);
    opacity: 0.7;
    animation: none;
}

@keyframes tableBreath {
    0%, 100% { transform: scale(0.98); opacity: 0.48; }
    50% { transform: scale(1.04); opacity: 0.78; }
}

/* 左上对手 */
#player-top {
    grid-column: 1;
    grid-row: 1;
}

/* 右上对手 */
#player-left {
    grid-column: 3;
    grid-row: 1;
}

/* 底部人类玩家（全宽居中） */
#player-right {
    grid-column: 1 / 4;
    grid-row: 3;
    justify-content: flex-end;
    padding-bottom: 4px;
    gap: 6px;
}

/* 桌面中央区域（跨上下两行） */
#table-center {
    grid-column: 2;
    grid-row: 1 / 3;
    align-self: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.player-area {
    border: 1px solid transparent;
}

.player-area.active-turn {
    background:
        radial-gradient(circle at center, rgba(240,192,64,0.16), transparent 70%),
        rgba(0,0,0,0.12);
    border-color: rgba(240,192,64,0.20);
    box-shadow: 0 0 28px rgba(240,192,64,0.16), inset 0 0 18px rgba(240,192,64,0.06);
}

.player-area.low-cards .card-count {
    background: rgba(255,152,0,0.86);
    color: #1d1000;
    animation: cardCountPulse 1.1s ease-in-out infinite;
}

.player-area.danger-cards .card-count {
    background: rgba(244,67,54,0.92);
    color: #fff;
}

@keyframes cardCountPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.player-avatar {
    border: 1px solid rgba(255,255,255,0.24);
    box-shadow: 0 8px 22px rgba(0,0,0,0.28), inset 0 1px 0 rgba(255,255,255,0.22);
}

.player-badge {
    min-height: 20px;
    border: 1px solid rgba(255,255,255,0.12);
}

.player-badge.peasant {
    background: rgba(255,255,255,0.10);
    color: rgba(255,255,255,0.82);
}

.player-badge.landlord {
    background: linear-gradient(135deg, #ffde73, #d49c12);
    box-shadow: 0 0 18px rgba(240,192,64,0.28);
}

.hand-front,
.hand-back {
    filter: drop-shadow(0 12px 22px rgba(0,0,0,0.22));
}

.hand-back {
    min-height: 78px;
    align-items: center;
}

.opponent-hand-summary {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 14px;
    background: rgba(0,0,0,0.28);
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 10px 22px rgba(0,0,0,0.22);
}

.opponent-card-stack {
    position: relative;
    width: 92px;
    height: 48px;
}

body[data-opponent-cards="spread"] .opponent-card-stack {
    width: 160px;
}

body[data-opponent-cards="count"] .opponent-hand-summary {
    min-width: 74px;
    justify-content: center;
}

.mini-card-back {
    position: absolute;
    top: 0;
    left: var(--offset);
    width: 34px;
    height: 48px;
    border-radius: 6px;
    border: 2px solid rgba(255,255,255,0.82);
    background:
        repeating-linear-gradient(45deg, rgba(255,255,255,0.13) 0 4px, transparent 4px 9px),
        linear-gradient(145deg, #cf2e48 0%, #85101d 100%);
    box-shadow: 0 6px 14px rgba(0,0,0,0.26), inset 0 1px 0 rgba(255,255,255,0.18);
    transform: rotate(var(--tilt));
}

.mini-card-back::after {
    content: '';
    position: absolute;
    inset: 12px 9px;
    border-radius: 3px;
    border: 1px solid rgba(255,255,255,0.18);
}

.opponent-count-badge {
    position: static;
    min-width: 42px;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(0,0,0,0.56);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 800;
    text-align: center;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
}

#player-left .opponent-hand-summary {
    flex-direction: column;
    gap: 6px;
    padding: 9px 10px;
}

#player-left .opponent-card-stack {
    width: 72px;
    transform: rotate(-3deg);
}

body[data-opponent-cards="spread"] #player-left .opponent-card-stack {
    width: 112px;
}

#player-left .mini-card-back {
    left: var(--side-offset);
}

#player-top .played-area,
#player-left .played-area {
    margin-top: 12px;
}

#player-right .player-info {
    order: 1;
    margin-bottom: 4px;
}

#player-right .played-area {
    order: 2;
    min-height: 34px;
    margin: 0 0 2px;
    z-index: 1;
    pointer-events: none;
}

#player-right .hand-hint {
    order: 3;
}

#player-right .hand-front {
    order: 4;
    min-height: 240px;
    width: min(98vw, 1840px);
    margin-top: 8px;
    z-index: 12;
    overflow-x: clip;
    overflow-y: visible;
    cursor: pointer;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    justify-content: center;
}

#player-right .hand-front.range-selecting {
    cursor: grabbing;
}

#player-right .hand-front.selection-disabled {
    cursor: default;
    opacity: 0.78;
}

#player-right .hand-front.selection-disabled .card {
    pointer-events: auto;
    filter: saturate(0.82);
}

#player-right .hand-front .card.smart-play {
    outline: 2px solid rgba(129, 220, 140, 0.78);
    box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.16), 0 16px 30px rgba(0,0,0,0.30);
}

#player-right .hand-front .card.smart-drop {
    opacity: 0.56;
    transform: translateY(calc(-1 * var(--ddz-selected-lift, 28px) + 10px)) scale(0.96);
    filter: grayscale(0.35) saturate(0.75);
}

.played-area.has-cards {
    --table-play-overlap: var(--ddz-play-overlap, 16px);
    min-height: calc(110px * var(--ddz-played-card-scale, 1));
    min-width: 132px;
    max-width: min(88vw, 800px);
    padding: 12px 24px 14px;
    border-radius: 16px;
    background: rgba(8, 12, 28, 0.55);
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: inset 0 0 24px rgba(255,255,255,0.06), 0 12px 32px rgba(0,0,0,0.30);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    overflow-x: visible;
    overflow-y: visible;
}

.played-area .table-play-card {
    flex: 0 0 calc(72px * var(--ddz-played-card-scale, 1));
    width: calc(72px * var(--ddz-played-card-scale, 1));
    height: calc(100px * var(--ddz-played-card-scale, 1));
    margin-left: calc(-1 * var(--table-play-overlap));
    cursor: default;
    pointer-events: none;
    transform-origin: center bottom;
    will-change: transform, opacity;
    box-shadow: 0 12px 26px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.90);
}

.played-area .table-play-card:first-child {
    margin-left: 0;
}

.played-area .table-play-card .card-corner .rank {
    font-size: 1.2rem;
}

.played-area .table-play-card .card-corner .suit {
    font-size: 1.05rem;
}

.played-area .table-play-card .card-center {
    font-size: 2.8rem;
}

.played-area .table-play-card.joker .joker-text {
    font-size: 1.3rem;
}

.played-area.has-pass::after {
    content: '不出';
    padding: 8px 22px;
    border-radius: 999px;
    background: rgba(0,0,0,0.50);
    color: rgba(255,255,255,0.85);
    font-weight: 700;
    font-size: 0.95rem;
    animation: passFade 0.24s ease both;
    border: 1px solid rgba(255,255,255,0.10);
}

.low-card-reminder {
    position: absolute;
    left: 50%;
    top: 60px;
    z-index: 34;
    max-width: min(220px, 70vw);
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(18, 24, 18, 0.82);
    border: 1px solid rgba(240,192,64,0.38);
    color: #ffe28a;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
    box-shadow: 0 8px 22px rgba(0,0,0,0.24);
    pointer-events: none;
}

@keyframes passFade {
    from { opacity: 0; transform: translateY(8px) scale(0.92); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

#bottom-cards {
    border: 1px solid rgba(240,192,64,0.18);
    box-shadow: 0 10px 24px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.08);
}

#last-play-info {
    min-height: 28px;
}

#turn-indicator {
    padding: 8px 18px;
    border-radius: 999px;
    background: rgba(0,0,0,0.35);
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 4px 14px rgba(0,0,0,0.20);
    min-height: 38px;
    color: var(--accent-color);
    font-weight: 800;
    text-align: center;
    font-size: 1rem;
    letter-spacing: 0.5px;
}

.turn-indicator-pop,
.info-pop {
    animation: infoPop 0.35s ease both;
}

@keyframes infoPop {
    0% { transform: translateY(6px) scale(0.94); opacity: 0; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

.card {
    transform-origin: center bottom;
    transition: transform 0.12s ease, filter 0.12s ease;
    will-change: transform;
    z-index: var(--hand-index, 1);
}

/* 桌面端手牌尺寸 */
@media (min-width: 901px) {
    #player-right .hand-front .card {
        width: calc(144px * var(--ddz-card-scale, 1));
        height: calc(200px * var(--ddz-card-scale, 1));
        margin-left: calc(-91px * var(--ddz-card-scale, 1));
        flex-shrink: 0;
    }
    #player-right .hand-front .card:first-child {
        margin-left: 0;
    }
}

@media (min-width: 1500px) {
    #player-right .hand-front .card {
        width: calc(158px * var(--ddz-card-scale, 1));
        height: calc(220px * var(--ddz-card-scale, 1));
        margin-left: calc(-92px * var(--ddz-card-scale, 1));
    }
}

.card-inner {
    border: 1px solid rgba(0,0,0,0.10);
    background:
        linear-gradient(145deg, #ffffff 0%, #f8f6ef 44%, #ece8dd 100%);
    box-shadow:
        var(--shadow-card),
        inset 0 1px 0 rgba(255,255,255,0.95),
        inset 0 -10px 18px rgba(0,0,0,0.035);
}

.card:hover .card-inner {
    transform: none;
}

.hand-front .card:hover {
    transform: translateY(calc(-1 * var(--ddz-hover-lift, 5px))) scale(1.012);
    filter: brightness(1.04);
    z-index: 20;
}

.hand-front .card.selected,
.hand-front .card.selected:hover {
    transform: translateY(calc(-1 * var(--ddz-selected-lift, 8px))) scale(1.006);
    z-index: 0;
}

.card.selected .card-inner {
    transform: none !important;
    border: 2px solid var(--accent-color);
    box-shadow:
        0 8px 18px rgba(0,0,0,0.22),
        0 0 0 2px rgba(240,192,64,0.12),
        inset 0 1px 0 rgba(255,255,255,0.95);
}

.card.selected::before {
    content: '';
    position: absolute;
    inset: -3px -3px;
    border-radius: 12px;
    border: 1px solid rgba(240,192,64,0.38);
    pointer-events: none;
}

.card.hint .card-inner {
    border-color: #62d084;
    box-shadow: 0 0 0 4px rgba(98,208,132,0.22), 0 8px 20px rgba(76,175,80,0.20), var(--shadow-card);
}

.selection-pop {
    animation: selectionPop 0.24s ease;
}

@keyframes selectionPop {
    0% { transform: translateY(0) scale(1); }
    55% { transform: translateY(calc(-1 * var(--ddz-selected-lift, 12px) - 4px)) scale(1.035); }
    100% { transform: translateY(calc(-1 * var(--ddz-selected-lift, 12px))) scale(1.022); }
}

.replay-card {
    flex-basis: calc(38px * var(--ddz-replay-card-scale, 1));
    width: calc(38px * var(--ddz-replay-card-scale, 1));
    height: calc(50px * var(--ddz-replay-card-scale, 1));
}

body[data-show-shortcuts="false"] #shortcut-hint,
body[data-show-shortcuts="false"] kbd {
    display: none !important;
}

body[data-table-aura="false"] .table-aura,
body[data-table-aura="false"] #ddz-table::after {
    display: none;
}

body[data-chat="false"] #btn-toggle-chat,
body[data-chat="false"] #chat-panel {
    display: none !important;
}

body[data-emoji="false"] #quick-phrases {
    display: none !important;
}

body[data-card-tracker="false"] #btn-toggle-card-tracker,
body[data-card-tracker="false"] #card-tracker {
    display: none !important;
}

body[data-auto-hint="false"] #btn-hint {
    display: none !important;
}

/* 暗色模式：只应用到非 fixed 内容的容器，避免 overlay/modal/toast 被裁剪 */
body[data-dark-mode="true"] #ddz-table,
body[data-dark-mode="true"] .game-header,
body[data-dark-mode="true"] #menu-screen {
    filter: brightness(0.85) contrast(1.1);
}

body[data-high-contrast="true"] #ddz-table,
body[data-high-contrast="true"] .game-header,
body[data-high-contrast="true"] #menu-screen {
    filter: contrast(1.4);
}

body[data-colorblind-mode="true"] .card-suit-red {
    color: #0066cc !important;
}

/* 色盲类型细分 */
body[data-colorblind-type="deuteranopia"] .card-suit-red,
body[data-colorblind-type="deuteranopia"] .suit-heart,
body[data-colorblind-type="deuteranopia"] .suit-diamond {
    color: #8B6914 !important;
}
body[data-colorblind-type="tritanopia"] .card-suit-red {
    color: #cc6600 !important;
}
body[data-colorblind-type="achromatopsia"] .card-suit-red,
body[data-colorblind-type="achromatopsia"] .card-suit-black {
    color: #666 !important;
}

/* 阴影强度 */
body[data-shadow-intensity="none"] .card {
    box-shadow: none !important;
}
body[data-shadow-intensity="low"] .card {
    box-shadow: 0 1px 3px rgba(0,0,0,0.15) !important;
}
body[data-shadow-intensity="high"] .card {
    box-shadow: 0 4px 12px rgba(0,0,0,0.35) !important;
}

/* 光效强度 */
body[data-glow-intensity="none"] .card.selected {
    box-shadow: none !important;
}
body[data-glow-intensity="high"] .card.selected {
    box-shadow: 0 0 16px 4px rgba(255,215,0,0.5) !important;
}

/* 减少动画（与 motion=none 叠加） */
body[data-reduce-motion="true"] *,
body[data-reduce-motion="true"] *::before,
body[data-reduce-motion="true"] *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
}

/* 大点击区域 */
body[data-large-targets="true"] .card {
    min-width: 52px;
    min-height: 72px;
}
body[data-large-targets="true"] button,
body[data-large-targets="true"] .btn-panel-toggle {
    min-height: 40px;
    padding: 10px 16px;
}

/* 高可见度 */
body[data-high-visibility="true"] .card {
    border-width: 2px !important;
}
body[data-high-visibility="true"] .player-avatar {
    border-width: 3px !important;
}

/* 隐藏剩余牌数 */
body[data-show-remaining="false"] .opponent-count-badge {
    display: none !important;
}

/* 隐藏牌型名称 */
body[data-show-pattern-name="false"] #last-play-type {
    display: none !important;
}

/* 不高亮可出牌 */
body[data-highlight-playable="false"] .card.playable {
    filter: none !important;
}

/* 懒渲染优化 */
body[data-lazy-render="true"] .side-panel {
    will-change: auto;
}

/* 出牌排列方式 */
body[data-played-arrangement="arc"] .played-area {
    justify-content: center;
}
body[data-played-arrangement="fan"] .played-area {
    justify-content: center;
    gap: 2px;
}

/* 手牌排列方式 */
body[data-hand-arrangement="straight"] #player-right .hand-front {
    justify-content: center;
}
body[data-hand-arrangement="stack"] #player-right .hand-front {
    justify-content: center;
    gap: 4px;
}

body[data-hand-arrangement] #player-right .hand-front {
    justify-content: center;
}

body[data-density="compact"] #ddz-table {
    gap: 4px;
    padding-bottom: 104px;
}

body[data-density="compact"] #controls-area {
    padding-bottom: 10px;
    gap: 8px;
}

body[data-density="spacious"] #ddz-table {
    gap: 14px;
    padding-bottom: 142px;
}

body[data-density="spacious"] #controls-area {
    padding-bottom: 28px;
}

body[data-motion="none"] *,
body[data-motion="none"] *::before,
body[data-motion="none"] *::after {
    animation: none !important;
    transition: none !important;
}

body[data-motion="reduced"] *,
body[data-motion="reduced"] *::before,
body[data-motion="reduced"] *::after {
    animation-duration: 0.12s !important;
    transition-duration: 0.12s !important;
}

body[data-motion="fancy"] .table-aura {
    animation-duration: 3.2s;
    opacity: 0.9;
}

.card-back .card-inner {
    background:
        radial-gradient(circle at 50% 50%, rgba(255,255,255,0.16), transparent 34%),
        repeating-linear-gradient(45deg, rgba(255,255,255,0.12) 0 4px, transparent 4px 10px),
        linear-gradient(145deg, #cf2e48 0%, #86101e 100%);
    border: 2px solid rgba(255,255,255,0.82);
}

#controls-area {
    top: calc(100% - 570px);
    padding: 10px 20px 14px;
    background: transparent;
}

#call-controls,
#play-controls {
    padding: 8px;
    border-radius: 16px;
    background: rgba(0,0,0,0.5); /* 加深回退背景 */
    border: 1px solid rgba(255,255,255,0.08);
    backdrop-filter: blur(14px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.28);
}

#call-controls button,
#play-controls button {
    min-width: 92px;
    min-height: 42px;
    border-radius: 12px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 7px 16px rgba(0,0,0,0.18);
}

#call-controls button:hover,
#play-controls button:hover {
    transform: translateY(-2px);
}

#call-controls button:active,
#play-controls button:active {
    transform: translateY(0) scale(0.98);
}

#call-controls button:disabled,
#play-controls button:disabled {
    opacity: 0.38 !important;
    cursor: not-allowed;
    filter: grayscale(0.5);
}

#game-info {
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(0,0,0,0.18);
    border: 1px solid rgba(255,255,255,0.06);
}

#phase-text {
    color: var(--accent-color);
    font-weight: 700;
}

.btn-panel-toggle,
.btn-small,
.btn-primary {
    border-radius: 10px;
}

.btn-panel-toggle {
    box-shadow: 0 8px 20px rgba(0,0,0,0.20);
}

.side-panel,
.overlay-panel,
.lan-container,
.custom-container,
#modal-content,
.help-content {
    border: 1px solid rgba(255,255,255,0.10);
    box-shadow: var(--shadow-heavy);
}

.side-panel,
.overlay-panel,
.help-content {
    background-color: rgba(0,0,0,var(--ddz-panel-alpha, 0.8));
}

.toast-message {
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 12px 28px rgba(0,0,0,0.24);
}

@media (max-width: 900px) {
    #menu-screen {
        padding: 18px 12px 28px;
    }

    .menu-container {
        max-width: 560px;
        gap: 14px;
    }

    .menu-body {
        grid-template-columns: 1fr;
    }

    .game-subtitle {
        margin: -6px 0 4px;
    }

    .stats-panel {
        max-height: none;
    }

    .settings-grid,
    .settings-slider-list {
        grid-template-columns: 1fr;
    }

    .settings-panel {
        max-height: none;
    }

    #ddz-table {
        grid-template-columns: 90px 1fr 90px;
        grid-template-rows: 86px minmax(190px, 1fr) 178px;
        padding: 8px 8px 118px;
    }

    #ddz-table::before {
        inset: 8px 8px 118px;
        border-radius: 22px;
    }

    #ddz-table::after,
    .table-aura {
        display: none;
    }

    #player-top {
        grid-column: 1;
        grid-row: 1;
    }

    #player-left {
        grid-column: 3;
        grid-row: 1;
    }

    #player-right {
        grid-column: 1 / 4;
        grid-row: 3;
        justify-content: flex-end;
        padding-bottom: 4px;
        gap: 6px;
    }

    #table-center {
        grid-column: 2;
        grid-row: 1 / 3;
    }

    #controls-area {
        top: auto;
        bottom: 0;
    }

    #player-right .hand-front {
        min-height: 96px;
        padding-inline: 8px;
        margin-top: 20px;
    }

    #player-right .hand-front .card {
        margin-left: -38px;
    }

    #player-right .hand-front .card:first-child {
        margin-left: 0;
    }

    #player-right .played-area {
        min-height: 58px;
    }

    #player-top .player-info,
    #player-left .player-info {
        transform: scale(0.88);
        margin-bottom: 3px;
        gap: 2px;
    }

    #player-top .played-area,
    #player-left .played-area {
        margin-top: 6px;
    }

    #player-top .hand-back,
    #player-left .hand-back {
        min-height: 56px;
        padding: 4px;
    }

    #call-controls,
    #play-controls {
        gap: 7px;
        flex-wrap: wrap;
        justify-content: center;
    }

    #call-controls button,
    #play-controls button {
        min-width: 72px;
        min-height: 38px;
        padding: 8px 12px;
    }

    #game-info {
        max-width: calc(100vw - 16px);
        gap: 10px;
        font-size: 0.76rem;
    }
}

@media (max-width: 560px) {
    .game-subtitle {
        margin: -4px 0 2px;
    }

    .menu-container {
        gap: 12px;
    }

    .menu-title-wrap {
        gap: 8px;
    }

    .title-icon {
        font-size: 1.3rem;
    }

    .game-title {
        letter-spacing: 1px;
    }

    .mode-card--primary {
        padding: 16px 16px;
    }

    .mode-card--primary .mode-card__icon {
        font-size: 2rem;
    }

    .mode-card--primary .mode-card__title {
        font-size: 1.1rem;
    }

    .mode-card-row {
        gap: 8px;
    }

    .mode-card--secondary {
        padding: 12px 12px;
    }

    .mode-card--secondary .mode-card__icon {
        font-size: 1.5rem;
    }

    .mode-card--secondary .mode-card__title {
        font-size: 0.9rem;
    }

    .mode-card--secondary .mode-card__desc {
        font-size: 0.7rem;
    }

    .mode-card-row--small {
        gap: 6px;
    }

    .mode-card--ghost {
        padding: 10px 8px;
    }

    .mode-card--ghost .mode-card__icon {
        font-size: 1.2rem;
    }

    .mode-card--ghost .mode-card__title {
        font-size: 0.7rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .stat-item {
        padding: 10px 6px;
    }

    .stat-value {
        font-size: 1.2rem;
    }

    .game-header {
        padding: 8px 10px;
    }

    .header-right {
        gap: 6px;
    }

    #ddz-table {
        grid-template-columns: 64px 1fr 64px;
        grid-template-rows: 74px minmax(160px, 1fr) 158px;
        gap: 2px;
        padding: 8px 8px 126px;
    }

    #ddz-table::before {
        inset: 8px 8px 126px;
    }

    #controls-area {
        top: auto;
        bottom: 0;
    }

    #player-top {
        grid-column: 1;
        grid-row: 1;
    }

    #player-left {
        grid-column: 3;
        grid-row: 1;
    }

    #player-left .player-info,
    #player-top .player-info {
        transform: scale(0.85);
        margin-bottom: 2px;
        gap: 2px;
    }

    #player-top .played-area,
    #player-left .played-area {
        margin-top: 4px;
    }

    #player-top .hand-back,
    #player-left .hand-back {
        min-height: 48px;
        padding: 3px;
    }

    #player-right .player-info {
        flex-direction: row;
    }

    #player-right .hand-front {
        margin-top: 8px;
        overflow-x: auto;
        overflow-y: visible;
        touch-action: pan-x pan-y;
    }

    #player-right .hand-front .card {
        margin-left: -30px;
    }

    #player-right .hand-front .card:first-child {
        margin-left: 0;
    }

    #player-right .player-badge,
    #player-right .player-tooltip {
        display: none;
    }

    #bottom-cards {
        padding: 8px 12px;
    }

    #last-play-type,
    #turn-indicator {
        font-size: 0.76rem;
        padding: 5px 10px;
    }

    .side-panel {
        top: 104px;
        right: 8px;
        left: 8px;
        width: auto;
        max-height: 54vh;
    }

    #side-panels {
        top: 52px;
        right: 8px;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .btn-panel-toggle {
        padding: 6px 8px;
    }
}

@media (max-width: 900px) and (max-height: 500px) and (orientation: landscape) {
    #ddz-table {
        grid-template-rows: 58px minmax(72px, 1fr) 136px;
        padding: 6px 8px 88px;
    }

    #ddz-table::before {
        inset: 6px 8px 88px;
    }

    #player-right {
        gap: 2px;
        padding-bottom: 0;
    }

    #player-right .played-area {
        min-height: 16px;
        margin: 0;
    }

    #player-right .hand-front {
        min-height: 96px;
        margin-top: 0;
        overflow-x: clip;
        justify-content: center;
    }

    #player-right .hand-front .card {
        width: calc(74px * var(--ddz-card-scale, 1));
        height: calc(104px * var(--ddz-card-scale, 1));
        margin-left: calc(-50px * var(--ddz-card-scale, 1));
    }

    #controls-area {
        top: auto;
        bottom: 148px;
        padding: 6px 10px calc(10px + env(safe-area-inset-bottom));
    }

    #call-controls,
    #play-controls {
        padding: 6px;
    }

    #call-controls button,
    #play-controls button {
        min-height: 36px;
        padding: 7px 12px;
    }

    #game-info {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}


/* ===== v1.1.7 全局动画增强 ===== */

/* 选牌闪光粒子 */
.select-sparkle {
    position: fixed;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #f0c040;
    box-shadow: 0 0 6px 2px rgba(240,192,64,0.6);
    pointer-events: none;
    z-index: 9999;
    animation: selectSparkleAnim 0.5s ease-out forwards;
}

@keyframes selectSparkleAnim {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(var(--tx), var(--ty)) scale(0); opacity: 0; }
}

/* 提示牌光晕扫过 */
.hint-glow-sweep {
    position: fixed;
    border-radius: 8px;
    pointer-events: none;
    z-index: 100;
    overflow: hidden;
}

.hint-glow-sweep::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(76,175,80,0.35), transparent);
    animation: hintGlowSweepAnim 0.7s ease-out forwards;
}

@keyframes hintGlowSweepAnim {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* 回合切换光晕 */
.turn-switch-glow {
    position: fixed;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(240,192,64,0.25), transparent 70%);
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 1;
    animation: turnSwitchGlowAnim 0.8s ease-out forwards;
}

@keyframes turnSwitchGlowAnim {
    0% { width: 0; height: 0; opacity: 1; }
    100% { width: 400px; height: 400px; opacity: 0; }
}

/* 倒计时出现 */
@keyframes countdownAppear {
    0% { transform: scale(0.3); opacity: 0; }
    60% { transform: scale(1.25); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

/* 增强思考指示器 */
.thinking-indicator.thinking-enhanced::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid rgba(240,192,64,0.4);
    animation: thinkingRingRotate 1.5s linear infinite;
}

@keyframes thinkingRingRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 按钮按下反馈 */
.btn-press-anim {
    animation: btnPressAnim 0.2s ease-out;
}

@keyframes btnPressAnim {
    0% { transform: scale(1); }
    40% { transform: scale(0.92); }
    100% { transform: scale(1); }
}

/* 连击文字 */
.combo-text {
    position: fixed;
    font-size: 1.6rem;
    font-weight: 800;
    color: #ff9800;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5), 0 0 20px rgba(255,152,0,0.4);
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    animation: comboTextAnim 1.5s ease-out forwards;
}

@keyframes comboTextAnim {
    0% { transform: translate(-50%, -50%) scale(0.3); opacity: 0; }
    20% { transform: translate(-50%, -50%) scale(1.3); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1.1) translateY(-20px); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1) translateY(-60px); opacity: 0; }
}

/* 得分弹出 */
.score-popup {
    position: fixed;
    font-size: 1.4rem;
    font-weight: 700;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    animation: scorePopupAnim 1.2s ease-out forwards;
}

@keyframes scorePopupAnim {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    30% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1) translateY(-50px); opacity: 0; }
}

/* 背景浮动粒子 */
.bg-particle {
    position: fixed;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: rgba(240,192,64,0.25);
    box-shadow: 0 0 6px 1px rgba(240,192,64,0.15);
    pointer-events: none;
    z-index: 0;
    animation: bgParticleFloat linear infinite;
}

@keyframes bgParticleFloat {
    0% { transform: translateY(0) translateX(0); opacity: 0; }
    10% { opacity: 0.6; }
    90% { opacity: 0.6; }
    100% { transform: translateY(-100vh) translateX(30px); opacity: 0; }
}

/* 模态框内容切换 */
@keyframes modalContentSwitch {
    0% { transform: scale(0.95); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

/* 头像脉冲 */
.avatar-pulse-anim {
    animation: avatarPulseAnim 0.6s ease-out;
}

@keyframes avatarPulseAnim {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(240,192,64,0.5); }
    50% { transform: scale(1.15); box-shadow: 0 0 0 12px rgba(240,192,64,0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(240,192,64,0); }
}

/* 卡牌取消选中 */
.card-deselect-anim {
    animation: cardDeselectAnim 0.2s ease-out;
}

@keyframes cardDeselectAnim {
    0% { transform: translateY(-18px); }
    100% { transform: translateY(0); }
}

/* 快捷短语飞行 */
.phrase-fly {
    position: fixed;
    font-size: 1.2rem;
    pointer-events: none;
    z-index: 9999;
    animation: phraseFlyAnim 0.6s ease-out forwards;
}

@keyframes phraseFlyAnim {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(var(--to-x), var(--to-y)) scale(0.5); opacity: 0; }
}

/* 徽章弹跳 */
.badge-bounce-anim {
    animation: badgeBounceAnim 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes badgeBounceAnim {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}

/* 托管状态脉冲 */
.auto-pulse-on {
    position: fixed;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(156,39,176,0.3), transparent 70%);
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 5;
    animation: autoPulseAnim 0.7s ease-out forwards;
}

.auto-pulse-off {
    position: fixed;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(76,175,80,0.3), transparent 70%);
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 5;
    animation: autoPulseAnim 0.7s ease-out forwards;
}

@keyframes autoPulseAnim {
    0% { width: 0; height: 0; opacity: 1; }
    100% { width: 120px; height: 120px; opacity: 0; }
}

/* 金色雨 */
.gold-rain-drop {
    position: fixed;
    pointer-events: none;
    z-index: 9998;
    color: #ffd700;
    animation: goldRainFall linear forwards;
}

@keyframes goldRainFall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(360deg); opacity: 0; }
}

/* 新记录横幅 */
.new-record-banner {
    position: fixed;
    top: 15%;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 32px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(255,215,0,0.9), rgba(255,140,0,0.9));
    color: #2a1a00;
    font-size: 1.2rem;
    font-weight: 700;
    box-shadow: 0 8px 32px rgba(255,152,0,0.4);
    pointer-events: none;
    z-index: 10000;
    animation: newRecordBannerAnim 2.5s ease-in-out forwards;
}

@keyframes newRecordBannerAnim {
    0% { transform: translateX(-50%) translateY(-40px) scale(0.8); opacity: 0; }
    15% { transform: translateX(-50%) translateY(0) scale(1.05); opacity: 1; }
    20% { transform: translateX(-50%) translateY(0) scale(1); opacity: 1; }
    85% { transform: translateX(-50%) translateY(0) scale(1); opacity: 1; }
    100% { transform: translateX(-50%) translateY(-20px) scale(0.95); opacity: 0; }
}

/* 手牌hover增强光效 */
.hand-front .card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent 60%);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.hand-front .card:hover::after {
    opacity: 1;
}

/* 玩家区域active-turn增强脉冲 */
.player-area.active-turn .player-avatar {
    animation: none;
}

@keyframes activeTurnAvatar {
    0%, 100% { box-shadow: 0 3px 12px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.15), 0 0 0 0 rgba(240,192,64,0.3); }
    50% { box-shadow: 0 3px 12px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.15), 0 0 16px 4px rgba(240,192,64,0.2); }
}

/* 叫分按钮hover光效 */
#call-controls button:hover,
#play-controls button:hover {
    position: relative;
    overflow: hidden;
}

#call-controls button:hover::after,
#play-controls button:hover::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.12), transparent 60%);
    pointer-events: none;
}

/* 倒计时urgent增强 */
.countdown-timer.urgent {
    animation: countdownPulse 0.6s ease-in-out infinite, countdownGlow 0.6s ease-in-out infinite;
}

.countdown-timer.critical {
    animation: countdownPulse 0.3s ease-in-out infinite, countdownGlow 0.3s ease-in-out infinite;
}

@keyframes countdownGlow {
    0%, 100% { box-shadow: 0 3px 12px rgba(0,0,0,0.4); }
    50% { box-shadow: 0 3px 12px rgba(0,0,0,0.4), 0 0 20px 4px rgba(240,192,64,0.25); }
}

/* 卡牌提示增强闪烁 */
.card.hint .card-inner::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 10px;
    border: 2px solid rgba(76,175,80,0.4);
    animation: hintBorderPulse 1.2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes hintBorderPulse {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.02); }
}

/* 不出气泡增强 */
.played-area.has-pass::after {
    animation: passFade 0.5s ease both, passGlow 2s ease-in-out infinite 0.5s;
}

@keyframes passGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
    50% { box-shadow: 0 0 12px 2px rgba(255,255,255,0.08); }
}

/* 聊天气泡增强 */
.chat-bubble {
    animation: chatPop 0.3s ease-out, chatFloat 3s ease-in-out infinite 0.3s;
}

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

/* 记牌器更新闪烁 */
.tracker-cell.highlight {
    animation: trackerHighlight 0.6s ease-out;
}

@keyframes trackerHighlight {
    0% { background: rgba(240,192,64,0.4); }
    100% { background: transparent; }
}

/* 侧边面板滑入增强 */
.side-panel {
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.35s ease;
}

/* 成就解锁增强 */
.achievement-toast {
    animation: achPop 0.5s ease, achGlow 2s ease-in-out infinite 0.5s;
}

@keyframes achGlow {
    0%, 100% { box-shadow: 0 8px 32px rgba(0,0,0,0.3); }
    50% { box-shadow: 0 8px 32px rgba(0,0,0,0.3), 0 0 20px 4px rgba(240,192,64,0.15); }
}

/* 菜单按钮hover增强 */
.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 24px rgba(240,192,64,0.25), inset 0 1px 0 rgba(255,255,255,0.2);
}

.btn-primary:active {
    transform: translateY(-1px) scale(0.98);
    transition-duration: 0.1s;
}

/* 游戏标题呼吸 */
.game-title {
    animation: titleBreath 4s ease-in-out infinite;
}

@keyframes titleBreath {
    0%, 100% { text-shadow: 0 4px 20px rgba(0,0,0,0.4); }
    50% { text-shadow: 0 4px 30px rgba(0,0,0,0.5), 0 0 40px rgba(240,192,64,0.08); }
}

/* 对手牌堆hover显示 */
.opponent-card-stack {
    transition: transform 0.2s ease, filter 0.2s ease;
}

.opponent-hand-summary:hover .opponent-card-stack {
    transform: scale(1.05) rotate(0deg);
    filter: brightness(1.1);
}

/* 底牌区域hover */
#bottom-cards:hover {
    transform: scale(1.03);
    transition: transform 0.3s ease;
}

/* 历史记录项hover（实际使用 .history-entry） */
.history-entry {
    transition: background 0.2s ease, transform 0.2s ease;
}

.history-entry:hover {
    background: rgba(255,255,255,0.06);
    transform: translateX(4px);
}

/* 设置项hover */
.setting-row {
    transition: background 0.2s ease, transform 0.2s ease;
}

.setting-row:hover {
    background: rgba(255,255,255,0.04);
    transform: translateX(2px);
}

/* 统计数字hover */
.stat-value {
    transition: transform 0.2s ease, color 0.2s ease;
}

.stat-value:hover {
    transform: scale(1.1);
    color: var(--accent-color);
}

/* 等级条动画 */
.level-progress-fill {
    transition: width 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* 主题切换过渡 */
body {
    transition: background 0.5s ease;
}

/* 卡牌背面hover */
.card-back:hover .card-inner {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}

/* 拖拽选牌时的光标反馈 */
.hand-front.range-selecting {
    cursor: grabbing;
}

.hand-front.range-selecting .card {
    transition: transform 0.1s ease;
}

/* 智能提示高亮过渡 */
.card.smart-play {
    transition: outline 0.2s ease, box-shadow 0.2s ease;
}

/* 已打出卡牌区域hover */
.played-area.has-cards:hover {
    transform: scale(1.02);
    transition: transform 0.3s ease;
}

/* 音效按钮hover */
#btn-sound-toggle:hover {
    transform: scale(1.15) rotate(10deg);
    transition: transform 0.2s ease;
}

/* 暂停遮罩增强 */
#pause-overlay {
    backdrop-filter: blur(8px);
    animation: pauseFadeIn 0.3s ease;
}

@keyframes pauseFadeIn {
    0% { opacity: 0; backdrop-filter: blur(0); }
    100% { opacity: 1; backdrop-filter: blur(8px); }
}

/* 帮助面板增强 */
#help-panel {
    animation: helpSlideIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes helpSlideIn {
    0% { transform: translate(-50%, -50%) scale(0.9); opacity: 0; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* 回合指示器呼吸 */
#turn-indicator {
    animation: turnBreath 3s ease-in-out infinite;
}

@keyframes turnBreath {
    0%, 100% { box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 4px 14px rgba(0,0,0,0.20); }
    50% { box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 4px 14px rgba(0,0,0,0.20), 0 0 16px 2px rgba(240,192,64,0.1); }
}

/* 上家牌型提示呼吸 */
#last-play-type {
    animation: lastTypeBreath 3s ease-in-out infinite 1s;
}

@keyframes lastTypeBreath {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
    50% { box-shadow: 0 0 8px 1px rgba(255,255,255,0.06); }
}

/* 玩家tooltip出现 */
.player-tooltip {
    animation: tooltipFadeIn 0.2s ease;
}

@keyframes tooltipFadeIn {
    0% { opacity: 0; transform: translateY(4px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* 记牌器面板滑入 */
#card-tracker {
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
}

/* 出牌历史面板滑入 */
#play-history {
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
}

/* 聊天面板滑入 */
#chat-panel {
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
}

/* 玩家badge地主发光 */
.player-badge.landlord {
    animation: landlordBadgeGlow 2s ease-in-out infinite;
}

@keyframes landlordBadgeGlow {
    0%, 100% { box-shadow: 0 0 18px rgba(240,192,64,0.28); }
    50% { box-shadow: 0 0 24px 4px rgba(240,192,64,0.4); }
}

/* 低牌量警告闪烁 */
.player-area.low-cards .player-avatar {
    animation: lowCardsWarn 1.5s ease-in-out infinite;
}

@keyframes lowCardsWarn {
    0%, 100% { box-shadow: 0 3px 12px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.15); }
    50% { box-shadow: 0 3px 12px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.15), 0 0 12px 2px rgba(255,152,0,0.3); }
}

/* 危险牌量红色闪烁 */
.player-area.danger-cards .player-avatar {
    animation: dangerCardsWarn 1s ease-in-out infinite;
}

@keyframes dangerCardsWarn {
    0%, 100% { box-shadow: 0 3px 12px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.15); }
    50% { box-shadow: 0 3px 12px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.15), 0 0 16px 3px rgba(244,67,54,0.35); }
}

/* 托管按钮激活脉冲 */
.btn-auto.active {
    animation: autoActivePulse 2s ease-in-out infinite;
}

@keyframes autoActivePulse {
    0%, 100% { box-shadow: inset 0 1px 0 rgba(255,255,255,0.20), 0 4px 12px rgba(255,152,0,0.30); }
    50% { box-shadow: inset 0 1px 0 rgba(255,255,255,0.20), 0 4px 12px rgba(255,152,0,0.30), 0 0 16px 4px rgba(255,152,0,0.2); }
}

/* 菜单模式卡片hover */
.mode-card {
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.mode-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 32px rgba(0,0,0,0.25);
    border-color: rgba(240,192,64,0.3);
}

.mode-card:active {
    transform: translateY(-2px) scale(0.98);
    transition-duration: 0.1s;
}

/* 设置滑块thumb发光 */
input[type="range"]::-webkit-slider-thumb {
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

input[type="range"]:hover::-webkit-slider-thumb {
    box-shadow: 0 0 0 6px rgba(240,192,64,0.2);
    transform: scale(1.15);
}

input[type="range"]:active::-webkit-slider-thumb {
    transform: scale(1.25);
    box-shadow: 0 0 0 8px rgba(240,192,64,0.3);
}

/* 复选框自定义动画 */
input[type="checkbox"] {
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

input[type="checkbox"]:checked {
    transform: scale(1.1);
}

input[type="checkbox"]:active {
    transform: scale(0.9);
}

/* 下拉选择hover */
select:hover {
    border-color: rgba(240,192,64,0.4);
    box-shadow: 0 0 0 3px rgba(240,192,64,0.1);
    transition: all 0.2s ease;
}

/* Toast增强 */
.toast-notification {
    animation: toastEnhanced 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes toastEnhanced {
    0% { transform: translateX(-50%) translateY(20px) scale(0.9); opacity: 0; }
    60% { transform: translateX(-50%) translateY(-4px) scale(1.02); opacity: 1; }
    100% { transform: translateX(-50%) translateY(0) scale(1); opacity: 1; }
}

/* 胜利弹窗增强 */
#modal-overlay.show {
    animation: modalShowEnhanced 0.4s ease;
}

@keyframes modalShowEnhanced {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

#modal-content.show {
    animation: modalContentShowEnhanced 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalContentShowEnhanced {
    0% { transform: translate(-50%, -50%) scale(0.8) rotateX(10deg); opacity: 0; }
    100% { transform: translate(-50%, -50%) scale(1) rotateX(0); opacity: 1; }
}

/* 分享按钮复制成功反馈 */
.btn-copy-success {
    animation: copySuccessAnim 0.5s ease;
}

@keyframes copySuccessAnim {
    0% { transform: scale(1); }
    30% { transform: scale(1.2); background: #4caf50; }
    100% { transform: scale(1); }
}

/* 观战模式切换手牌淡入 */
.hand-front.enter-watch {
    animation: handEnterWatch 0.4s ease;
}

@keyframes handEnterWatch {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* 经验条增长光效 */
.xp-gain-glow {
    animation: xpGainGlow 1s ease-out;
}

@keyframes xpGainGlow {
    0% { box-shadow: 0 0 0 0 rgba(240,192,64,0.5); }
    100% { box-shadow: 0 0 20px 4px rgba(240,192,64,0); }
}

/* 新手引导步骤指示器 */
.tutorial-step-dot {
    transition: transform 0.2s ease, background 0.2s ease;
}

.tutorial-step-dot.active {
    transform: scale(1.3);
    background: var(--accent-color);
}

/* 游戏速度切换过渡 */
body[data-speed] #ddz-table {
    transition: opacity 0.3s ease;
}

/* 密度切换过渡 */
body[data-density] .card {
    transition: margin 0.3s ease;
}

/* 对手卡牌展开/堆叠切换 */
body[data-opponent-cards] .opponent-card-stack {
    transition: width 0.3s ease, transform 0.3s ease;
}

/* 表情包hover */
.emoji-btn:hover {
    transform: scale(1.25) rotate(5deg);
    transition: transform 0.15s ease;
}

/* 快捷短语发送按钮 */
.quick-phrase-btn:hover {
    transform: translateX(4px);
    background: rgba(240,192,64,0.15);
    transition: all 0.2s ease;
}

/* 排行榜条目 */
.leaderboard-item {
    transition: background 0.2s ease, transform 0.2s ease;
}

.leaderboard-item:hover {
    background: rgba(255,255,255,0.05);
    transform: translateX(4px);
}

.leaderboard-item.top3 .rank {
    animation: top3RankGlow 2s ease-in-out infinite;
}

@keyframes top3RankGlow {
    0%, 100% { text-shadow: 0 0 0 transparent; }
    50% { text-shadow: 0 0 8px rgba(240,192,64,0.4); }
}

/* ========== 教程系统样式 ========== */

#tutorial-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

#tutorial-fullscreen.hidden {
    display: none !important;
}

.tutorial-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(10,20,40,0.96) 0%, rgba(5,15,30,0.98) 100%);
    backdrop-filter: blur(12px);
}

.tutorial-container {
    position: relative;
    display: flex;
    width: 92vw;
    max-width: 1200px;
    height: 88vh;
    max-height: 800px;
    background: rgba(20,30,50,0.85);
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 24px 80px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.05);
    overflow: hidden;
}

/* 左侧导航 */
.tutorial-nav {
    width: 220px;
    min-width: 220px;
    background: rgba(0,0,0,0.25);
    border-right: 1px solid rgba(255,255,255,0.06);
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tutorial-nav h3 {
    font-size: 1.05rem;
    color: var(--accent-color);
    margin: 0 0 8px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.tutorial-chapters {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    overflow-y: auto;
}

.tutorial-chapters li {
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.88rem;
    color: rgba(255,255,255,0.65);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tutorial-chapters li:hover {
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.9);
}

.tutorial-chapters li.active {
    background: rgba(240,192,64,0.12);
    color: #f0c040;
    font-weight: 600;
}

.tutorial-chapters li.completed {
    color: rgba(100,220,120,0.8);
}

.tut-chap-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    font-size: 0.75rem;
    flex-shrink: 0;
}

.tutorial-chapters li.active .tut-chap-num {
    background: rgba(240,192,64,0.25);
}

.tutorial-progress {
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.tutorial-progress-track {
    height: 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
    overflow: hidden;
}

.tutorial-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-color), #f0c040);
    border-radius: 3px;
    transition: width 0.4s ease;
}

.tutorial-progress-text {
    text-align: center;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.4);
    margin-top: 6px;
}

/* 主内容区 */
.tutorial-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tutorial-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.tutorial-header-text h2 {
    font-size: 1.3rem;
    color: #fff;
    margin: 0;
}

.tutorial-header-text p {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.5);
    margin: 4px 0 0;
}

.tutorial-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.7);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tutorial-close:hover {
    background: rgba(244,67,54,0.2);
    border-color: rgba(244,67,54,0.4);
    color: #f44336;
}

.tutorial-body {
    flex: 1;
    padding: 24px 28px;
    overflow-y: auto;
    color: rgba(255,255,255,0.85);
    font-size: 0.95rem;
    line-height: 1.7;
}

.tutorial-body::-webkit-scrollbar {
    width: 6px;
}

.tutorial-body::-webkit-scrollbar-track {
    background: transparent;
}

.tutorial-body::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
}

.tutorial-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    border-top: 1px solid rgba(255,255,255,0.06);
    gap: 16px;
}

.tutorial-prev,
.tutorial-next {
    padding: 10px 22px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.85);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tutorial-prev:hover:not(:disabled),
.tutorial-next:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.25);
}

.tutorial-prev:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.tutorial-next {
    background: linear-gradient(135deg, var(--accent-color), rgba(240,192,64,0.8));
    border-color: transparent;
    color: #fff;
    font-weight: 600;
}

.tutorial-next:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
}

.tutorial-dots {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.tut-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    transition: all 0.3s ease;
}

.tut-dot.active {
    background: var(--accent-color);
    transform: scale(1.3);
    box-shadow: 0 0 8px rgba(26,95,42,0.4);
}

.tut-dot.completed {
    background: rgba(100,220,120,0.6);
}

/* 章节进入动画 */
.tut-body-enter {
    animation: tutBodyEnter 0.4s ease-out;
}

@keyframes tutBodyEnter {
    0% { opacity: 0; transform: translateY(12px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* ========== 第1章：欢迎 ========== */
.tut-welcome {
    text-align: center;
    padding: 20px 0;
}

.tut-welcome-emoji {
    font-size: 4rem;
    margin-bottom: 12px;
    animation: tutWelcomeBounce 2s ease-in-out infinite;
}

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

.tut-welcome-title {
    font-size: 2.4rem;
    color: #f0c040;
    margin: 0 0 8px;
    text-shadow: 0 2px 16px rgba(240,192,64,0.3);
}

.tut-welcome-desc {
    font-size: 1.05rem;
    color: rgba(255,255,255,0.6);
    margin-bottom: 32px;
}

.tut-roles-showcase {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-bottom: 32px;
}

.tut-role-card {
    background: rgba(255,255,255,0.05);
    border-radius: 16px;
    padding: 24px 28px;
    border: 1px solid rgba(255,255,255,0.08);
    text-align: center;
    min-width: 160px;
    transition: all 0.3s ease;
}

.tut-role-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255,255,255,0.15);
}

.tut-role-landlord {
    border-color: rgba(240,192,64,0.2);
}

.tut-role-landlord:hover {
    box-shadow: 0 8px 32px rgba(240,192,64,0.1);
}

.tut-role-peasant {
    border-color: rgba(100,200,100,0.2);
}

.tut-role-peasant:hover {
    box-shadow: 0 8px 32px rgba(100,200,100,0.1);
}

.tut-role-icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
}

.tut-role-name {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.tut-role-landlord .tut-role-name { color: #f0c040; }
.tut-role-peasant .tut-role-name { color: #64c864; }

.tut-role-desc {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.5);
}

.tut-vs {
    font-size: 1.5rem;
    font-weight: 800;
    color: rgba(255,255,255,0.3);
}

.tut-welcome-tip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(240,192,64,0.08);
    border: 1px solid rgba(240,192,64,0.15);
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 0.85rem;
    color: rgba(240,192,64,0.8);
}

.tut-tip-icon {
    font-size: 1.1rem;
}

/* ========== 第2章：牌型 ========== */
.tut-patterns {
    padding: 8px 0;
}

.tut-intro {
    text-align: center;
    color: rgba(255,255,255,0.5);
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.tut-pattern-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.tut-pattern-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 16px 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
}

.tut-pattern-card:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(240,192,64,0.3);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.tut-pattern-icon {
    font-size: 1.8rem;
    margin-bottom: 6px;
}

.tut-pattern-name {
    font-weight: 600;
    font-size: 0.92rem;
    margin-bottom: 2px;
}

.tut-pattern-desc {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.45);
    margin-bottom: 4px;
}

.tut-pattern-example {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.35);
}

.tut-pattern-detail {
    background: rgba(0,0,0,0.3);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(255,255,255,0.08);
    animation: tutDetailAppear 0.3s ease;
}

@keyframes tutDetailAppear {
    0% { opacity: 0; transform: translateY(8px); }
    100% { opacity: 1; transform: translateY(0); }
}

.tut-detail-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: #f0c040;
    margin-bottom: 8px;
}

.tut-detail-valid {
    color: rgba(100,220,120,0.8);
    margin-bottom: 8px;
}

.tut-detail-example {
    color: rgba(255,255,255,0.7);
    margin-bottom: 8px;
}

.tut-detail-compare {
    color: rgba(255,255,255,0.5);
    font-size: 0.9rem;
}

/* ========== 第3章：大小比较 ========== */
.tut-ranking {
    padding: 8px 0;
}

.tut-rank-section {
    margin-bottom: 28px;
}

.tut-rank-section h4 {
    font-size: 1.05rem;
    color: rgba(255,255,255,0.8);
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.tut-pyramid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.tut-pyramid-level {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    border-radius: 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    cursor: pointer;
    transition: all 0.25s ease;
    min-width: 320px;
    justify-content: center;
}

.tut-pyramid-level:hover {
    background: rgba(255,255,255,0.08);
    transform: scale(1.03);
}

.tut-pyramid-pop {
    animation: tutPyramidPop 0.4s ease;
}

@keyframes tutPyramidPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

.tut-level-1 { border-color: rgba(240,192,64,0.25); background: rgba(240,192,64,0.06); }
.tut-level-2 { border-color: rgba(244,67,54,0.2); background: rgba(244,67,54,0.04); }
.tut-level-3 { border-color: rgba(100,150,255,0.2); background: rgba(100,150,255,0.04); }

.tut-pyramid-icon { font-size: 1.5rem; }
.tut-pyramid-desc { font-size: 0.8rem; color: rgba(255,255,255,0.5); }

.tut-rank-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
}

.tut-rank-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.tut-rank-card {
    width: 36px;
    height: 48px;
    background: linear-gradient(135deg, #fff, #e8e8e8);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: #333;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.tut-rank-card.joker {
    background: linear-gradient(135deg, #f0c040, #e0a020);
    color: #fff;
}

.tut-rank-arrow {
    color: rgba(255,255,255,0.2);
    font-size: 0.8rem;
}

.tut-rank-crown {
    font-size: 1rem;
}

.tut-rank-note {
    text-align: center;
    color: rgba(255,255,255,0.4);
    font-size: 0.85rem;
    margin-top: 12px;
}

/* 测验 */
.tut-quiz {
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    padding: 20px;
}

.tut-quiz-question {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    text-align: center;
}

.tut-quiz-options {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.tut-quiz-option {
    background: rgba(255,255,255,0.06);
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 20px 28px;
    cursor: pointer;
    text-align: center;
    color: rgba(255,255,255,0.85);
    transition: all 0.25s ease;
    min-width: 140px;
}

.tut-quiz-option:hover {
    border-color: rgba(240,192,64,0.4);
    background: rgba(240,192,64,0.06);
    transform: translateY(-2px);
}

.tut-mini-cards {
    font-size: 1.6rem;
    margin-bottom: 8px;
}

.tut-quiz-result {
    margin-top: 16px;
    text-align: center;
    padding: 12px;
    border-radius: 8px;
    animation: tutResultPop 0.3s ease;
}

@keyframes tutResultPop {
    0% { transform: scale(0.9); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.tut-quiz-correct {
    color: rgba(100,220,120,0.9);
    font-weight: 600;
}

.tut-quiz-wrong {
    color: rgba(244,100,100,0.9);
    font-weight: 600;
}

/* ========== 第4章：发牌 ========== */
.tut-dealing {
    padding: 8px 0;
}

.tut-deal-stage {
    background: rgba(0,0,0,0.2);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    min-height: 200px;
}

.tut-deck-area {
    text-align: center;
    margin-bottom: 20px;
}

.tut-deck {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.tut-deck-card {
    font-size: 3rem;
}

.tut-deck-count {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.4);
}

.tut-deal-players {
    display: flex;
    justify-content: space-around;
    gap: 16px;
    margin-bottom: 20px;
}

.tut-deal-player {
    text-align: center;
    flex: 1;
}

.tut-deal-avatar {
    font-size: 1.8rem;
    margin-bottom: 4px;
}

.tut-deal-name {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
    margin-bottom: 8px;
}

.tut-deal-hand {
    min-height: 50px;
}

.tut-deal-card-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    justify-content: center;
    min-height: 30px;
}

.tut-deal-mini {
    font-size: 1.2rem;
    animation: tutDealMiniAppear 0.2s ease;
}

@keyframes tutDealMiniAppear {
    0% { opacity: 0; transform: translateY(-8px) scale(0.8); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.tut-deal-count {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.4);
    margin-top: 4px;
}

.tut-bottom-cards-area {
    text-align: center;
    padding-top: 12px;
    border-top: 1px dashed rgba(255,255,255,0.1);
}

.tut-bottom-label {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.4);
    margin-bottom: 8px;
}

.tut-bottom-cards {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.tut-bottom-card {
    font-size: 2rem;
    animation: tutBottomAppear 0.3s ease;
}

@keyframes tutBottomAppear {
    0% { opacity: 0; transform: rotateY(90deg); }
    100% { opacity: 1; transform: rotateY(0); }
}

.tut-deal-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tut-info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: rgba(255,255,255,0.04);
    border-radius: 8px;
    font-size: 0.9rem;
}

.tut-info-icon {
    font-size: 1.2rem;
}

/* ========== 第5章：叫分 ========== */
.tut-calling {
    padding: 8px 0;
}

.tut-call-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.tut-tab-btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.tut-tab-btn.active {
    background: rgba(240,192,64,0.12);
    border-color: rgba(240,192,64,0.3);
    color: #f0c040;
    font-weight: 600;
}

.tut-tab-btn:hover:not(.active) {
    background: rgba(255,255,255,0.08);
}

.tut-call-content {
    position: relative;
}

.tut-call-mode {
    display: none;
}

.tut-call-mode.active {
    display: block;
    animation: tutModeSwitch 0.3s ease;
}

@keyframes tutModeSwitch {
    0% { opacity: 0; transform: translateX(10px); }
    100% { opacity: 1; transform: translateX(0); }
}

.tut-call-demo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tut-call-player {
    text-align: center;
    padding: 16px;
    background: rgba(255,255,255,0.04);
    border-radius: 12px;
    min-width: 100px;
}

.tut-call-avatar {
    font-size: 1.8rem;
    margin-bottom: 4px;
}

.tut-call-name {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
    margin-bottom: 8px;
}

.tut-call-action {
    padding: 8px 14px;
    background: rgba(255,255,255,0.06);
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.tut-call-highlight {
    background: rgba(240,192,64,0.2) !important;
    color: #f0c040;
    transform: scale(1.1);
    box-shadow: 0 0 16px rgba(240,192,64,0.2);
}

.tut-action-call {
    background: rgba(100,200,100,0.15);
    color: rgba(100,220,120,0.9);
}

.tut-action-grab {
    background: rgba(244,67,54,0.15);
    color: rgba(244,100,100,0.9);
}

.tut-call-arrow {
    color: rgba(255,255,255,0.2);
    font-size: 1.2rem;
}

.tut-call-result {
    text-align: center;
    padding: 16px;
    background: rgba(240,192,64,0.08);
    border-radius: 12px;
    margin-bottom: 20px;
    opacity: 0;
    transform: translateY(8px);
    transition: all 0.4s ease;
}

.tut-call-show {
    opacity: 1;
    transform: translateY(0);
}

.tut-call-winner {
    font-size: 1.1rem;
    font-weight: 700;
    color: #f0c040;
}

.tut-call-rules {
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    padding: 16px 20px;
}

.tut-call-rules h5 {
    margin: 0 0 10px;
    color: rgba(255,255,255,0.8);
}

.tut-call-rules ul {
    margin: 0;
    padding-left: 18px;
    color: rgba(255,255,255,0.6);
    font-size: 0.88rem;
    line-height: 1.8;
}

/* ========== 第6章：出牌 ========== */
.tut-playing {
    padding: 8px 0;
}

.tut-play-scenario {
    background: rgba(0,0,0,0.25);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    min-height: 240px;
}

.tut-play-table {
    display: grid;
    grid-template-areas:
        ". top ."
        "left center right";
    grid-template-columns: 1fr 2fr 1fr;
    gap: 16px;
    align-items: center;
    min-height: 200px;
}

.tut-play-top { grid-area: top; text-align: center; }
.tut-play-left { grid-area: left; text-align: center; }
.tut-play-right { grid-area: right; text-align: center; }
.tut-play-center-info { grid-area: center; text-align: center; }

.tut-play-avatar {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
    margin-bottom: 8px;
}

.tut-play-cards {
    display: flex;
    gap: 4px;
    justify-content: center;
    min-height: 50px;
    align-items: center;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.tut-play-active {
    background: rgba(240,192,64,0.1);
    box-shadow: 0 0 16px rgba(240,192,64,0.1);
}

.tut-pcard {
    width: 28px;
    height: 40px;
    background: linear-gradient(135deg, #fff, #e8e8e8);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: #333;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.tut-play-type {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.4);
    margin-top: 4px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tut-play-pass {
    color: rgba(255,255,255,0.3);
    font-style: italic;
}

.tut-pass-text {
    font-size: 0.9rem;
}

.tut-play-turn {
    font-size: 0.9rem;
    color: rgba(240,192,64,0.8);
    font-weight: 600;
    padding: 8px 16px;
    background: rgba(240,192,64,0.08);
    border-radius: 20px;
    display: inline-block;
}

.tut-play-rules {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.tut-rule-card {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(255,255,255,0.04);
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.06);
}

.tut-rule-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(240,192,64,0.15);
    color: #f0c040;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.tut-rule-text {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.7);
    line-height: 1.5;
}

.tut-rule-text strong {
    color: rgba(255,255,255,0.9);
}

/* ========== 第7章：得分 ========== */
.tut-scoring {
    padding: 8px 0;
}

.tut-score-sections {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}

.tut-score-card {
    text-align: center;
    padding: 20px 16px;
    background: rgba(255,255,255,0.04);
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.08);
    transition: all 0.3s ease;
}

.tut-score-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255,255,255,0.15);
}

.tut-spring:hover { border-color: rgba(255,150,200,0.3); }
.tut-anti-spring:hover { border-color: rgba(100,200,100,0.3); }
.tut-bomb:hover { border-color: rgba(244,67,54,0.3); }

.tut-score-icon {
    font-size: 2.2rem;
    margin-bottom: 8px;
}

.tut-score-card h4 {
    margin: 0 0 6px;
    font-size: 1rem;
}

.tut-score-card p {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.55);
    margin: 0 0 10px;
    line-height: 1.5;
}

.tut-score-multiplier {
    font-size: 1.3rem;
    font-weight: 700;
    color: #f0c040;
    margin-bottom: 6px;
}

.tut-score-example {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.35);
}

.tut-score-formula {
    background: rgba(0,0,0,0.2);
    border-radius: 14px;
    padding: 20px 24px;
}

.tut-score-formula h4 {
    margin: 0 0 14px;
    color: rgba(255,255,255,0.8);
}

.tut-formula-box {
    background: rgba(255,255,255,0.04);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
    overflow-x: auto;
}

.tut-formula-line {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    font-size: 0.9rem;
}

.tut-formula-item {
    padding: 6px 12px;
    background: rgba(100,150,255,0.1);
    border-radius: 6px;
    color: rgba(150,180,255,0.9);
    white-space: nowrap;
}

.tut-formula-result {
    padding: 6px 14px;
    background: rgba(240,192,64,0.15);
    border-radius: 6px;
    color: #f0c040;
    font-weight: 700;
    white-space: nowrap;
}

.tut-example-title {
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    margin-bottom: 8px;
}

.tut-example-calc {
    background: rgba(255,255,255,0.04);
    border-radius: 8px;
    padding: 14px 18px;
    font-size: 0.9rem;
    line-height: 1.8;
    color: rgba(255,255,255,0.7);
}

.tut-example-eq {
    font-size: 1.1rem;
    color: #f0c040;
    margin: 4px 0;
}

.tut-example-dist {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed rgba(255,255,255,0.1);
    font-size: 0.85rem;
    color: rgba(255,255,255,0.55);
}

/* ========== 第8章：实战 ========== */
.tut-practice {
    padding: 8px 0;
}

.tut-practice-stage {
    background: rgba(0,0,0,0.2);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    min-height: 200px;
    text-align: center;
}

.tut-practice-msg {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.6);
    padding: 40px 0;
}

.tut-practice-table {
    display: grid;
    grid-template-areas:
        ". top ."
        "left center right";
    grid-template-columns: 1fr 2fr 1fr;
    gap: 12px;
    align-items: start;
}

.tut-prac-player {
    text-align: center;
    padding: 12px;
    background: rgba(255,255,255,0.04);
    border-radius: 12px;
}

.tut-prac-top { grid-area: top; }
.tut-prac-left { grid-area: left; }
.tut-prac-right { grid-area: right; }
.tut-prac-center { grid-area: center; }

.tut-prac-avatar {
    font-size: 1.6rem;
    margin-bottom: 4px;
}

.tut-prac-name {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.6);
    margin-bottom: 6px;
}

.tut-prac-cards {
    font-size: 0.9rem;
    letter-spacing: -2px;
    color: rgba(255,255,255,0.4);
}

.tut-prac-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 12px;
}

.tut-prac-bottom-cards {
    text-align: center;
}

.tut-prac-label {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.35);
    margin-bottom: 4px;
}

.tut-prac-bcards {
    font-size: 1.5rem;
    letter-spacing: 4px;
}

.tut-prac-played {
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.tut-prac-comment {
    padding: 8px 16px;
    background: rgba(240,192,64,0.08);
    border-radius: 20px;
    font-size: 0.88rem;
    color: rgba(240,192,64,0.9);
    font-weight: 500;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tut-practice-controls {
    text-align: center;
    margin-bottom: 16px;
}

.tut-practice-tips {
    text-align: center;
}

.tut-practice-tip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: rgba(100,150,255,0.08);
    border-radius: 8px;
    font-size: 0.85rem;
    color: rgba(150,180,255,0.8);
}

.tut-complete {
    text-align: center;
    padding: 32px;
    animation: tutCompleteAppear 0.5s ease;
}

@keyframes tutCompleteAppear {
    0% { opacity: 0; transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}

.tut-complete-icon {
    font-size: 3.5rem;
    margin-bottom: 12px;
    animation: tutCompleteBounce 1s ease infinite;
}

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

.tut-complete h3 {
    font-size: 1.4rem;
    color: #f0c040;
    margin: 0 0 8px;
}

.tut-complete p {
    color: rgba(255,255,255,0.6);
    margin-bottom: 20px;
}

/* 通用操作按钮 */
.tut-action-btn {
    padding: 12px 28px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.85);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.25s ease;
}

.tut-action-btn:hover:not(:disabled) {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.25);
    transform: translateY(-2px);
}

.tut-action-btn:disabled {
    opacity: 0.4;
    cursor: wait;
}

.tut-btn-primary {
    background: linear-gradient(135deg, var(--accent-color), rgba(240,192,64,0.8));
    border-color: transparent;
    color: #fff;
    font-weight: 600;
}

.tut-btn-primary:hover {
    filter: brightness(1.15);
}

/* 响应式 */
@media (max-width: 768px) {
    .tutorial-container {
        flex-direction: column;
        width: 96vw;
        height: 92vh;
    }
    .tutorial-nav {
        width: 100%;
        min-width: auto;
        max-height: 120px;
        padding: 12px;
    }
    .tutorial-chapters {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 4px;
    }
    .tutorial-chapters li {
        padding: 6px 10px;
        font-size: 0.78rem;
    }
    .tut-chap-num {
        display: none;
    }
    .tutorial-progress {
        display: none;
    }
    .tutorial-body {
        padding: 16px;
    }
    .tut-pattern-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .tut-roles-showcase {
        flex-direction: column;
    }
    .tut-vs {
        transform: rotate(90deg);
    }
    .tut-score-sections {
        grid-template-columns: 1fr;
    }
    .tut-play-rules {
        grid-template-columns: 1fr;
    }
    .tut-rank-bar {
        gap: 4px;
    }
    .tut-rank-card {
        width: 28px;
        height: 38px;
        font-size: 0.7rem;
    }
    .tut-rank-arrow {
        display: none;
    }
    .tut-practice-table {
        grid-template-columns: 1fr;
        grid-template-areas:
            "top"
            "center"
            "left"
            "right";
    }
}

@media (prefers-reduced-motion: reduce) {
    .tut-welcome-emoji,
    .tut-complete-icon,
    .tut-body-enter,
    .tut-detail-appear,
    .tut-mode-switch {
        animation: none !important;
    }
}


/* ========== 首次进入引导选择对话框 ========== */

#welcome-guide-overlay {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
}

#welcome-guide-overlay.hidden {
    display: none !important;
}

.welcome-guide-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(8,16,32,0.96) 0%, rgba(4,10,20,0.98) 100%);
    backdrop-filter: blur(16px);
}

.welcome-guide-modal {
    position: relative;
    text-align: center;
    padding: 48px 40px 36px;
    background: rgba(20,35,60,0.9);
    border-radius: 24px;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 32px 100px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.08);
    max-width: 480px;
    width: 90vw;
    animation: welcomeGuideAppear 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes welcomeGuideAppear {
    0% { opacity: 0; transform: translateY(40px) scale(0.92); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.welcome-guide-emoji {
    font-size: 4.5rem;
    margin-bottom: 16px;
    animation: welcomeEmojiFloat 3s ease-in-out infinite;
}

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

.welcome-guide-title {
    font-size: 2rem;
    color: #fff;
    margin: 0 0 8px;
    font-weight: 700;
    letter-spacing: 2px;
}

.welcome-guide-desc {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.45);
    margin-bottom: 32px;
}

.welcome-guide-choices {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 24px;
}

.welcome-guide-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 18px 24px;
    border-radius: 16px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-family: inherit;
    width: 100%;
}

.welcome-guide-btn:hover {
    transform: translateY(-3px) scale(1.02);
}

.welcome-guide-btn:active {
    transform: translateY(-1px) scale(0.98);
}

.welcome-guide-btn-primary {
    background: linear-gradient(135deg, rgba(26,95,42,0.9), rgba(20,75,32,0.95));
    border-color: rgba(100,220,120,0.3);
    color: #fff;
    box-shadow: 0 8px 32px rgba(26,95,42,0.3);
}

.welcome-guide-btn-primary:hover {
    box-shadow: 0 12px 40px rgba(26,95,42,0.4);
    border-color: rgba(100,220,120,0.5);
}

.welcome-guide-btn-secondary {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.7);
}

.welcome-guide-btn-secondary:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
}

.wgb-icon {
    font-size: 2rem;
}

.wgb-text {
    font-size: 1.15rem;
    font-weight: 700;
}

.wgb-sub {
    font-size: 0.78rem;
    opacity: 0.6;
    font-weight: 400;
}

.welcome-guide-skip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.4);
    cursor: pointer;
}

.welcome-guide-skip input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-color);
    cursor: pointer;
}

/* 卡牌装饰背景 */
.welcome-guide-modal::before {
    content: '🂡';
    position: absolute;
    top: -20px;
    left: -20px;
    font-size: 5rem;
    opacity: 0.04;
    transform: rotate(-15deg);
    pointer-events: none;
}

.welcome-guide-modal::after {
    content: '🃏';
    position: absolute;
    bottom: -16px;
    right: -16px;
    font-size: 4rem;
    opacity: 0.04;
    transform: rotate(20deg);
    pointer-events: none;
}


/* ========== 第9章：记牌与读牌 ========== */

.tut-memory {
    padding: 8px 0;
}

.tut-mem-section {
    margin-bottom: 28px;
}

.tut-mem-section h4 {
    font-size: 1.05rem;
    color: rgba(255,255,255,0.85);
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.tut-mem-desc {
    color: rgba(255,255,255,0.65);
    line-height: 1.7;
}

.tut-mem-desc strong {
    color: rgba(255,255,255,0.9);
}

.tut-key-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.tut-key-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    transition: all 0.25s ease;
}

.tut-key-card:hover {
    transform: translateY(-3px);
    border-color: rgba(240,192,64,0.2);
}

.tut-kc-icon {
    font-size: 2rem;
    margin-bottom: 6px;
}

.tut-kc-name {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 4px;
    color: rgba(255,255,255,0.85);
}

.tut-kc-desc {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.45);
    line-height: 1.5;
}

.tut-priority-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tut-priority-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255,255,255,0.03);
    border-radius: 10px;
    border-left: 3px solid rgba(240,192,64, calc(1 - var(--p) * 0.15));
}

.tut-pri-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(240,192,64,0.15);
    color: #f0c040;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.tut-tips-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.tut-tip-card {
    background: rgba(100,150,255,0.06);
    border: 1px solid rgba(100,150,255,0.12);
    border-radius: 12px;
    padding: 16px;
}

.tut-tip-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: rgba(150,180,255,0.9);
    margin-bottom: 6px;
}

.tut-tip-body {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.55);
    line-height: 1.5;
}

.tut-mem-note {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: rgba(240,192,64,0.06);
    border: 1px solid rgba(240,192,64,0.12);
    border-radius: 10px;
    font-size: 0.88rem;
    color: rgba(240,192,64,0.7);
}

/* ========== 第10章：进阶技巧 ========== */

.tut-advanced {
    padding: 8px 0;
}

.tut-adv-section {
    margin-bottom: 28px;
}

.tut-adv-section h4 {
    font-size: 1.05rem;
    color: rgba(255,255,255,0.85);
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.tut-adv-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.tut-adv-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    transition: all 0.25s ease;
}

.tut-adv-card:hover {
    transform: translateY(-3px);
    border-color: rgba(240,192,64,0.2);
}

.tut-adv-icon {
    font-size: 1.8rem;
    margin-bottom: 6px;
}

.tut-adv-name {
    font-weight: 700;
    font-size: 0.92rem;
    margin-bottom: 4px;
}

.tut-adv-desc {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.45);
    line-height: 1.5;
}

.tut-adv-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tut-adv-list li {
    padding: 12px 16px;
    background: rgba(255,255,255,0.03);
    border-radius: 10px;
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
    line-height: 1.6;
}

.tut-adv-list li strong {
    color: rgba(255,255,255,0.9);
}

.tut-mistakes {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tut-mistake {
    display: flex;
    gap: 14px;
    padding: 16px;
    background: rgba(244,67,54,0.04);
    border: 1px solid rgba(244,67,54,0.1);
    border-radius: 12px;
    transition: all 0.25s ease;
}

.tut-mistake:hover {
    background: rgba(244,67,54,0.06);
    border-color: rgba(244,67,54,0.15);
}

.tut-mk-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
}

.tut-mk-content {
    flex: 1;
}

.tut-mk-title {
    font-weight: 700;
    color: rgba(244,120,120,0.9);
    margin-bottom: 6px;
    font-size: 0.92rem;
}

.tut-mk-fix {
    color: rgba(255,255,255,0.6);
    font-size: 0.85rem;
    line-height: 1.6;
}

.tut-mk-fix strong {
    color: rgba(100,220,120,0.9);
}

.tut-adv-complete {
    text-align: center;
    padding: 28px;
    background: rgba(240,192,64,0.06);
    border: 1px solid rgba(240,192,64,0.12);
    border-radius: 16px;
    margin-top: 20px;
}

.tut-adv-trophy {
    font-size: 3rem;
    margin-bottom: 8px;
    animation: tutTrophyPulse 2s ease-in-out infinite;
}

@keyframes tutTrophyPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.tut-adv-complete p {
    color: rgba(255,255,255,0.7);
    margin: 4px 0;
}

/* 牌型过滤器 */
.tut-pattern-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    justify-content: center;
}

.tut-filter-btn {
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.55);
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tut-filter-btn.active {
    background: rgba(240,192,64,0.15);
    border-color: rgba(240,192,64,0.3);
    color: #f0c040;
    font-weight: 600;
}

.tut-filter-btn:hover:not(.active) {
    background: rgba(255,255,255,0.08);
}

.tut-pattern-note {
    margin-top: 16px;
}

.tut-note-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(244,180,60,0.06);
    border: 1px solid rgba(244,180,60,0.12);
    border-radius: 10px;
    font-size: 0.88rem;
    color: rgba(244,180,60,0.8);
}

.tut-note-box strong {
    color: rgba(244,180,60,0.95);
}


/* ==========================================================
   设置面板全面 UI/UX 改进 v1.2.0
   ========================================================== */

/* ---- Overlay & Modal ---- */
#settings-overlay {
    position: fixed;
    inset: 0;
    z-index: 250;
    background: rgba(0,0,0,0.65); /* 加深回退背景 */
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 400;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
#settings-overlay:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}
#settings-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.settings-modal {
    width: min(92vw, 720px);
    max-height: min(88vh, 680px);
    background: linear-gradient(160deg, rgba(30,50,40,0.97), rgba(15,30,22,0.98));
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 28px 80px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(24px) scale(0.96);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                opacity 0.3s ease;
}
#settings-overlay:not(.hidden) .settings-modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
    gap: 12px;
}
.settings-header h2 {
    font-size: 1.15rem;
    font-weight: 800;
    color: #f0c040;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    letter-spacing: 0.5px;
}
.settings-header h2::before {
    content: '⚙️';
    font-size: 1.05em;
    filter: drop-shadow(0 0 6px rgba(240,192,64,0.35));
}

#btn-close-settings {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.7);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
#btn-close-settings:hover {
    background: rgba(244,67,54,0.15);
    color: #f44336;
    border-color: rgba(244,67,54,0.3);
    transform: rotate(90deg);
}
#btn-close-settings:active {
    transform: rotate(90deg) scale(0.92);
}

/* ---- Search Bar ---- */
.settings-search-wrap {
    padding: 0 22px 12px;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.settings-search {
    position: relative;
    display: flex;
    align-items: center;
}
.settings-search-icon {
    position: absolute;
    left: 12px;
    font-size: 0.95rem;
    opacity: 0.45;
    pointer-events: none;
    transition: opacity 0.2s;
}
.settings-search input {
    width: 100%;
    padding: 9px 12px 9px 36px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,0.25);
    color: #fff;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s ease;
}
.settings-search input::placeholder {
    color: rgba(255,255,255,0.6); /* 提升对比度，确保可读 */
}
.settings-search input:focus {
    border-color: rgba(240,192,64,0.4);
    background: rgba(0,0,0,0.35);
    box-shadow: 0 0 0 3px rgba(240,192,64,0.08);
}
.settings-search:has(input:focus) .settings-search-icon {
    opacity: 0.8;
}
.settings-search-clear {
    position: absolute;
    right: 10px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.5);
    font-size: 0.75rem;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.settings-search:has(input:not(:placeholder-shown)) .settings-search-clear,
.settings-search.has-value .settings-search-clear {
    display: flex;
}
.settings-search-clear:hover {
    background: rgba(244,67,54,0.25);
    color: #f44336;
}
.settings-search-match-count {
    font-size: 0.75rem;
    color: var(--accent-color);
    margin-left: 8px;
    opacity: 0.85;
    white-space: nowrap;
}

/* ---- Settings Panel Scroll Area ---- */
.settings-panel {
    padding: 16px 22px 22px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(240,192,64,0.25) transparent;
    flex: 1;
    gap: 6px;
    max-height: none !important;
}
.settings-panel::-webkit-scrollbar {
    width: 5px;
}
.settings-panel::-webkit-scrollbar-track {
    background: transparent;
}
.settings-panel::-webkit-scrollbar-thumb {
    background: rgba(240,192,64,0.2);
    border-radius: 10px;
}
.settings-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(240,192,64,0.35);
}

/* ---- Section Titles ---- */
.settings-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    padding: 14px 0 8px;
    margin-top: 4px;
    position: relative;
}
.settings-section-title::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 14px;
    background: var(--accent-color);
    border-radius: 2px;
    opacity: 0.7;
}
.settings-section-title:first-child {
    padding-top: 0;
    margin-top: 0;
}

/* ---- Section Icons ---- */
.settings-section-title[data-icon="basic"]::after { content: '👤'; margin-left: auto; font-size: 0.9rem; opacity: 0.4; }
.settings-section-title[data-icon="audio"]::after { content: '🔊'; margin-left: auto; font-size: 0.9rem; opacity: 0.4; }
.settings-section-title[data-icon="rules"]::after { content: '⚖️'; margin-left: auto; font-size: 0.9rem; opacity: 0.4; }
.settings-section-title[data-icon="variants"]::after { content: '🎲'; margin-left: auto; font-size: 0.9rem; opacity: 0.4; }
.settings-section-title[data-icon="ai"]::after { content: '🤖'; margin-left: auto; font-size: 0.9rem; opacity: 0.4; }
.settings-section-title[data-icon="visual"]::after { content: '👁️'; margin-left: auto; font-size: 0.9rem; opacity: 0.4; }
.settings-section-title[data-icon="layout"]::after { content: '📐'; margin-left: auto; font-size: 0.9rem; opacity: 0.4; }
.settings-section-title[data-icon="animation"]::after { content: '✨'; margin-left: auto; font-size: 0.9rem; opacity: 0.4; }
.settings-section-title[data-icon="interaction"]::after { content: '🖱️'; margin-left: auto; font-size: 0.9rem; opacity: 0.4; }
.settings-section-title[data-icon="assist"]::after { content: '💡'; margin-left: auto; font-size: 0.9rem; opacity: 0.4; }
.settings-section-title[data-icon="panels"]::after { content: '📋'; margin-left: auto; font-size: 0.9rem; opacity: 0.4; }
.settings-section-title[data-icon="accessibility"]::after { content: '♿'; margin-left: auto; font-size: 0.9rem; opacity: 0.4; }
.settings-section-title[data-icon="network"]::after { content: '🌐'; margin-left: auto; font-size: 0.9rem; opacity: 0.4; }
.settings-section-title[data-icon="performance"]::after { content: '⚡'; margin-left: auto; font-size: 0.9rem; opacity: 0.4; }
.settings-section-title[data-icon="advanced"]::after { content: '🔧'; margin-left: auto; font-size: 0.9rem; opacity: 0.4; }

/* ---- Settings Grid ---- */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.04);
    font-size: 0.88rem;
    transition: all 0.2s ease;
    min-width: 0;
}
.setting-row:hover {
    background: rgba(255,255,255,0.07);
    border-color: rgba(255,255,255,0.1);
}
.setting-row select,
.setting-row input[type="text"] {
    padding: 5px 10px;
    border-radius: 7px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.3);
    color: #fff;
    font-size: 0.85rem;
    outline: none;
    transition: all 0.2s;
    width: min(140px, 50%);
    cursor: pointer;
}
.setting-row select:focus-visible,
.setting-row input[type="text"]:focus-visible {
    outline: 2px solid rgba(240,192,64,0.5);
    outline-offset: 2px;
}
.setting-row select:hover,
.setting-row input[type="text"]:hover {
    border-color: rgba(240,192,64,0.3);
}
.setting-row select:focus,
.setting-row input[type="text"]:focus {
    border-color: rgba(240,192,64,0.5);
    box-shadow: 0 0 0 2px rgba(240,192,64,0.1);
}
.setting-row select option {
    background: #1e2e24;
    color: #fff;
}

/* Locked state */
.settings-panel label.setting-locked {
    opacity: 0.4;
    cursor: not-allowed;
}
.settings-panel label.setting-locked .toggle-switch-track,
.settings-panel label.setting-locked select,
.settings-panel label.setting-locked input {
    pointer-events: none;
    filter: grayscale(0.7);
}
.settings-panel label.setting-locked .setting-value-output {
    opacity: 0.4;
}

/* ---- Toggle Switch ---- */
.toggle-switch-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    padding: 5px 0;
}
.toggle-switch-wrap input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-switch-track {
    width: 40px;
    height: 22px;
    border-radius: 11px;
    background: rgba(255,255,255,0.12);
    position: relative;
    transition: background 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    cursor: pointer;
}
.toggle-switch-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.toggle-switch-wrap input:checked + .toggle-switch-track {
    background: rgba(76,175,80,0.7);
}
.toggle-switch-wrap input:checked + .toggle-switch-track::after {
    transform: translateX(18px);
}
.toggle-switch-wrap:active .toggle-switch-track::after {
    width: 22px;
}
.toggle-switch-wrap input:checked:active + .toggle-switch-track::after {
    transform: translateX(14px);
}
.toggle-switch-label {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.85);
    transition: color 0.2s;
}
.toggle-switch-wrap:hover .toggle-switch-label {
    color: #fff;
}

/* Toggle switch disabled */
.toggle-switch-wrap.setting-locked {
    cursor: not-allowed;
    pointer-events: none;
}
.toggle-switch-wrap.setting-locked .toggle-switch-track {
    background: rgba(255,255,255,0.06);
}

/* ---- Toggle Grid ---- */
.settings-toggles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, max-content));
    gap: 4px 6px;
    margin: 6px 0 4px;
}
.settings-toggles .toggle-switch-wrap {
    padding: 7px 10px;
    border-radius: 8px;
    background: rgba(255,255,255,0.03);
    border: 1px solid transparent;
    transition: all 0.2s;
}
.settings-toggles .toggle-switch-wrap:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.06);
}
.settings-toggles .toggle-switch-label {
    font-size: 0.82rem;
}

/* ---- Volume Controls ---- */
.volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
}
.volume-control label {
    font-size: 0.82rem;
    min-width: 44px;
    color: rgba(255,255,255,0.7);
    font-weight: 600;
}
.volume-value {
    font-size: 0.78rem;
    color: var(--accent-color);
    font-weight: 700;
    min-width: 38px;
    text-align: right;
}

/* ---- Custom Range Slider ---- */
input[type="range"].settings-slider-input {
    -webkit-appearance: none;
    appearance: none;
    height: 5px;
    border-radius: 3px;
    background: rgba(255,255,255,0.1);
    outline: none;
    cursor: pointer;
    flex: 1;
    transition: background 0.2s;
}
input[type="range"].settings-slider-input:focus-visible {
    outline: 2px solid rgba(240,192,64,0.5);
    outline-offset: 4px;
}
input[type="range"].settings-slider-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(145deg, #f0c040, #d4a017);
    box-shadow: 0 1px 6px rgba(240,192,64,0.4), 0 0 0 2px rgba(240,192,64,0.15);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: -5.5px;
}
input[type="range"].settings-slider-input::-webkit-slider-thumb:hover {
    transform: scale(1.25);
    box-shadow: 0 2px 10px rgba(240,192,64,0.5), 0 0 0 3px rgba(240,192,64,0.2);
}
input[type="range"].settings-slider-input::-webkit-slider-thumb:active {
    transform: scale(1.1);
}
input[type="range"].settings-slider-input::-webkit-slider-runnable-track {
    height: 5px;
    border-radius: 3px;
}
input[type="range"].settings-slider-input::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(145deg, #f0c040, #d4a017);
    box-shadow: 0 1px 6px rgba(240,192,64,0.4);
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}
input[type="range"].settings-slider-input::-moz-range-thumb:hover {
    transform: scale(1.25);
}
input[type="range"].settings-slider-input::-moz-range-track {
    height: 5px;
    border-radius: 3px;
    background: rgba(255,255,255,0.1);
}

/* ---- Slider List ---- */
.settings-slider-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 14px;
    margin-top: 6px;
}
.setting-slider {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(0,0,0,0.15);
    border: 1px solid rgba(255,255,255,0.04);
    transition: all 0.2s;
}
.setting-slider:hover {
    background: rgba(0,0,0,0.2);
    border-color: rgba(255,255,255,0.08);
}
.setting-slider .slider-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.8);
}
.setting-slider .slider-label-row .setting-value-output {
    color: var(--accent-color);
    font-weight: 700;
    font-size: 0.78rem;
}

/* ---- Advanced Settings (Details/Summary) ---- */
.advanced-settings {
    border-radius: 12px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    overflow: hidden;
    transition: all 0.3s ease;
}
.advanced-settings + .advanced-settings {
    margin-top: 6px;
}
.advanced-settings[open] {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.1);
}
.advanced-settings summary {
    cursor: pointer;
    color: rgba(255,255,255,0.75);
    font-weight: 700;
    font-size: 0.85rem;
    padding: 11px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    user-select: none;
    transition: all 0.2s;
}
.advanced-settings summary::-webkit-details-marker {
    display: none;
}
.advanced-settings summary::before {
    content: '▶';
    font-size: 0.6rem;
    opacity: 0.5;
    transition: transform 0.25s ease;
    display: inline-block;
    width: 14px;
    text-align: center;
}
.advanced-settings[open] summary::before {
    transform: rotate(90deg);
}
.advanced-settings summary:hover {
    color: var(--accent-color);
    background: rgba(255,255,255,0.03);
}
.advanced-settings[open] summary {
    color: var(--accent-color);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.advanced-settings > *:not(summary) {
    padding: 10px 14px 14px;
    animation: settingsExpand 0.25s ease forwards;
}
@keyframes settingsExpand {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.settings-fairness-note {
    font-size: 0.75rem;
    color: rgba(244,180,60,0.6);
    margin-top: 8px;
    padding: 6px 10px;
    background: rgba(244,180,60,0.04);
    border-radius: 6px;
    border-left: 2px solid rgba(244,180,60,0.3);
}

/* ---- Reset Buttons ---- */
.settings-reset-row {
    display: flex;
    gap: 10px;
    padding: 4px 0;
}
.settings-reset-row .btn-small {
    flex: 1;
    padding: 8px 14px;
    font-size: 0.8rem;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.75);
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
}
.settings-reset-row .btn-small:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
    transform: translateY(-1px);
}
.settings-reset-row .btn-small.danger {
    color: rgba(244,67,54,0.85);
    border-color: rgba(244,67,54,0.2);
}
.settings-reset-row .btn-small.danger:hover {
    background: rgba(244,67,54,0.1);
    border-color: rgba(244,67,54,0.35);
}

/* ---- Setting Change Feedback ---- */
.setting-changed {
    animation: settingPulse 0.5s ease;
}
@keyframes settingPulse {
    0%   { box-shadow: inset 0 0 0 0 rgba(240,192,64,0); }
    30%  { box-shadow: inset 0 0 0 2px rgba(240,192,64,0.3); }
    100% { box-shadow: inset 0 0 0 0 rgba(240,192,64,0); }
}

/* ---- Search Highlight ---- */
.setting-search-match {
    background: rgba(240,192,64,0.1) !important;
    border-color: rgba(240,192,64,0.25) !important;
    animation: searchMatchPulse 1s ease;
}
@keyframes searchMatchPulse {
    0%   { box-shadow: 0 0 0 0 rgba(240,192,64,0.3); }
    50%  { box-shadow: 0 0 12px 2px rgba(240,192,64,0.15); }
    100% { box-shadow: 0 0 0 0 rgba(240,192,64,0); }
}
.settings-panel .setting-hidden {
    display: none !important;
}

/* ---- Tooltip ---- */
.setting-tooltip {
    position: relative;
}
.setting-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: rgba(20,30,25,0.95);
    color: rgba(255,255,255,0.85);
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.72rem;
    white-space: normal;
    max-width: min(280px, 80vw);
    pointer-events: none;
    opacity: 0;
    transition: all 0.2s ease;
    z-index: 10;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.setting-tooltip:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ==========================================================
   设置面板响应式
   ========================================================== */
@media (max-width: 640px) {
    .settings-modal {
        width: 100vw;
        max-height: 92vh;
        border-radius: 16px 16px 0 0;
        position: fixed;
        bottom: 0;
        top: auto;
        transform: translateY(100%);
    }
    #settings-overlay:not(.hidden) .settings-modal {
        transform: translateY(0);
    }
    .settings-header {
        padding: 14px 16px 10px;
    }
    .settings-header h2 {
        font-size: 1.05rem;
    }
    .settings-search-wrap {
        padding: 0 16px 10px;
    }
    .settings-panel {
        padding: 12px 16px 20px;
    }
    .settings-grid {
        grid-template-columns: 1fr;
    }
    .settings-slider-list {
        grid-template-columns: 1fr;
    }
    .settings-toggles {
        grid-template-columns: 1fr;
    }
    .settings-section-title {
        font-size: 0.68rem;
    }
    .setting-row {
        font-size: 0.85rem;
    }
    .setting-row select,
    .setting-row input[type="text"] {
        width: min(130px, 48%);
    }
    .advanced-settings summary {
        font-size: 0.82rem;
        padding: 10px 12px;
    }
    .advanced-settings > *:not(summary) {
        padding: 8px 12px 12px;
    }
    .settings-reset-row {
        flex-direction: column;
    }
}

@media (max-width: 640px) and (max-height: 700px) {
    .settings-modal {
        max-height: 96vh;
        border-radius: 12px 12px 0 0;
    }
}

@media (min-width: 641px) and (max-width: 900px) {
    .settings-modal {
        width: min(94vw, 640px);
    }
    .settings-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .settings-slider-list {
        grid-template-columns: 1fr 1fr;
    }
}

/* 减少动画 */
@media (prefers-reduced-motion: reduce) {
    #settings-overlay,
    .settings-modal,
    .toggle-switch-track,
    .toggle-switch-track::after,
    .setting-row,
    .advanced-settings,
    .advanced-settings summary::before {
        transition: none !important;
        animation: none !important;
    }
    .advanced-settings > *:not(summary) {
        animation: none !important;
    }
}

/* 高对比度 */
body[data-high-contrast="true"] .toggle-switch-track {
    border: 1px solid rgba(255,255,255,0.3);
}
body[data-high-contrast="true"] .toggle-switch-track::after {
    border: 1px solid rgba(0,0,0,0.5);
}
body[data-high-contrast="true"] .setting-row,
body[data-high-contrast="true"] .setting-slider,
body[data-high-contrast="true"] .advanced-settings {
    border-color: rgba(255,255,255,0.2);
}


/* ===== v1.2.1 UI修复新增样式 ===== */

/* -- 内联样式替代类 -- */
.settings-grid--spaced { margin-top: 8px; }
.settings-grid--spaced-sm { margin-top: 6px; }
.settings-toggles--spaced { margin-top: 8px; }

.debug-counter {
    display: none;
    position: fixed;
    left: 4px;
    background: rgba(0,0,0,0.5);
    font-family: monospace;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    z-index: 9999;
}
.debug-counter--fps {
    top: 4px;
    color: #0f0;
}
.debug-counter--mem {
    top: 24px;
    color: #0ff;
}

.btn-back {
    margin-top: 12px;
}
.btn-back--fixed {
    position: fixed;
    top: max(12px, env(safe-area-inset-top));
    left: max(12px, env(safe-area-inset-left));
    z-index: 100;
    margin-top: 0;
    padding: 8px 16px;
    border-radius: 10px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: rgba(255,255,255,0.8);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-back--fixed:hover {
    background: rgba(0,0,0,0.45);
    border-color: rgba(255,255,255,0.18);
    color: #fff;
    transform: translateY(-1px);
}
.btn-danger {
    color: #f44336 !important;
}

/* -- 安全区适配 -- */
body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    overscroll-behavior: none;
}

#controls-area {
    padding-bottom: calc(24px + env(safe-area-inset-bottom)) !important;
}

.settings-modal {
    padding-bottom: env(safe-area-inset-bottom);
}

/* -- 竖屏警告（手机竖屏时提示横屏） -- */
@media (orientation: portrait) and (max-width: 600px) {
    #game-screen::before {
        content: "📱 请横屏游玩以获得最佳体验";
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.92);
        z-index: 99999;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.2rem;
        text-align: center;
        padding: 20px;
        color: #fff;
        backdrop-filter: blur(8px);
    }
}

/* -- 小屏手机适配（380px以下） -- */
@media (max-width: 380px) {
    .card {
        width: 40px !important;
        height: 56px !important;
    }
    .card-corner .rank {
        font-size: 0.8rem;
    }
    .card-corner .suit {
        font-size: 0.65rem;
    }
    .card-center {
        font-size: 1.4rem;
    }
    .joker-text {
        font-size: 0.9rem;
    }
    #player-right .hand-front .card {
        margin-left: -28px !important;
    }
    #player-right .hand-front .card:first-child {
        margin-left: 0 !important;
    }
    #call-controls button,
    #play-controls button {
        min-width: 60px;
        min-height: 44px;
        padding: 6px 8px;
        font-size: 0.82rem;
    }
    .game-title {
        font-size: 1.6rem !important;
    }
    .game-subtitle {
        font-size: 0.85rem !important;
    }
    .menu-container {
        grid-template-columns: 1fr !important;
        padding: 16px 12px !important;
    }
}

/* -- 文本截断工具类 -- */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* -- 玩家名称截断 -- */
.player-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* -- 游戏标题截断 -- */
.game-header h2 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: min(200px, 40vw);
}

/* -- 空状态样式 -- */
.empty-state {
    text-align: center;
    padding: 24px 16px;
    color: rgba(255,255,255,0.5);
    font-size: 0.9rem;
}
.empty-state-icon {
    font-size: 2rem;
    margin-bottom: 8px;
    opacity: 0.4;
}

/* -- 按钮状态补充 -- */
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-small:focus-visible,
.btn-panel-toggle:focus-visible,
.btn-replay-watch:focus-visible,
.tut-action-btn:focus-visible {
    outline: 2px solid rgba(240,192,64,0.6);
    outline-offset: 3px;
}

.btn-primary:disabled,
.btn-secondary:disabled,
.btn-small:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(0.6);
}

/* -- 触摸目标最小尺寸（移动端） -- */
@media (max-width: 900px) {
    #call-controls button,
    #play-controls button {
        min-height: 44px;
        min-width: 76px;
    }
    .btn-panel-toggle {
        min-height: 44px;
        min-width: 44px;
    }
    .tracker-cell {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .settings-panel select,
    .settings-panel input[type="text"] {
        min-height: 36px;
    }
}

/* -- 100dvh 替代 100vh（Safari动态工具栏兼容） -- */
.screen {
    height: 100dvh;
}

/* -- 虚拟键盘弹出时设置面板不被压扁 -- */
@media (max-width: 640px) {
    #settings-overlay:not(.hidden) {
        align-items: flex-start;
        padding-top: env(safe-area-inset-top);
    }
    .settings-modal {
        max-height: calc(92vh - env(safe-area-inset-bottom));
    }
}

/* -- 字体缩放保护 -- */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* -- 平板断点优化 -- */
@media (min-width: 769px) and (max-width: 1024px) {
    .card {
        width: 60px;
        height: 84px;
    }
    #ddz-table {
        grid-template-columns: 120px 1fr 120px !important;
    }
    .player-avatar {
        width: 44px;
        height: 44px;
    }
}

/* -- 竖屏时菜单不受影响 -- */
@media (orientation: portrait) and (max-width: 600px) {
    #menu-screen::before,
    #settings-overlay::before,
    #replay-screen::before {
        display: none !important;
    }
}

/* -- 历史面板操作按钮 -- */
.history-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}
.history-actions .btn-small {
    flex: 1;
}

/* ===== Commentary System ===== */
.commentary-bubble {
    font-size: 1.4rem;
    font-weight: 700;
    padding: 10px 24px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(0,0,0,0.75), rgba(30,30,30,0.85));
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #f0c040;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6), 0 0 20px rgba(240,192,64,0.3);
    border: 1px solid rgba(240,192,64,0.25);
    box-shadow: 0 8px 32px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.08);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease-out;
    will-change: transform, opacity;
    letter-spacing: 0.5px;
}

/* 炸弹 - 红色火焰 */
.commentary-bomb {
    color: #ff6644;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6), 0 0 24px rgba(255,100,50,0.5);
    border-color: rgba(255,100,50,0.35);
    background: linear-gradient(135deg, rgba(40,10,5,0.85), rgba(60,15,8,0.9));
    animation: commentaryShake 0.4s ease-in-out;
}

/* 火箭 - 金色辉煌 */
.commentary-rocket {
    color: #ffd700;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6), 0 0 28px rgba(255,215,0,0.6);
    border-color: rgba(255,215,0,0.4);
    background: linear-gradient(135deg, rgba(40,30,0,0.85), rgba(60,45,0,0.9));
    animation: commentaryGlow 0.6s ease-in-out;
}

/* 春天 - 粉色樱花 */
.commentary-spring {
    color: #ffb7c5;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6), 0 0 24px rgba(255,180,200,0.4);
    border-color: rgba(255,180,200,0.35);
    background: linear-gradient(135deg, rgba(40,15,25,0.85), rgba(60,20,35,0.9));
}

/* 反春天 - 冰蓝 */
.commentary-antiSpring {
    color: #88ccff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6), 0 0 24px rgba(130,200,255,0.4);
    border-color: rgba(130,200,255,0.35);
    background: linear-gradient(135deg, rgba(5,20,40,0.85), rgba(8,30,60,0.9));
}

/* 连击 - 火焰脉冲 */
.commentary-combo {
    color: #ff8844;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6), 0 0 28px rgba(255,130,50,0.6);
    border-color: rgba(255,130,50,0.4);
    background: linear-gradient(135deg, rgba(40,15,5,0.85), rgba(60,20,8,0.9));
    animation: commentaryPulse 0.5s ease-in-out 2;
}

/* 顺子 - 蓝色流动 */
.commentary-straight {
    color: #66ccff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6), 0 0 20px rgba(100,200,255,0.3);
    border-color: rgba(100,200,255,0.3);
}

/* 飞机 - 紫色 */
.commentary-plane {
    color: #cc99ff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6), 0 0 20px rgba(200,150,255,0.3);
    border-color: rgba(200,150,255,0.3);
}

/* 紧张时刻 - 橙色 */
.commentary-tense {
    color: #ffaa44;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6), 0 0 24px rgba(255,170,50,0.4);
    border-color: rgba(255,170,50,0.35);
    animation: commentaryPulse 0.8s ease-in-out infinite;
}

/* 叫地主 - 金色 */
.commentary-callLandlord {
    color: #f0c040;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6), 0 0 20px rgba(240,192,64,0.4);
}

/* 胜利 - 彩虹 */
.commentary-win {
    color: #ffd700;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6), 0 0 28px rgba(255,215,0,0.6);
    border-color: rgba(255,215,0,0.4);
    background: linear-gradient(135deg, rgba(40,30,0,0.85), rgba(60,45,0,0.9));
    animation: commentaryGlow 0.8s ease-in-out;
}

/* 失败 - 灰色 */
.commentary-lose {
    color: #aaaaaa;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6);
    border-color: rgba(150,150,150,0.25);
    background: linear-gradient(135deg, rgba(20,20,20,0.85), rgba(35,35,35,0.9));
}

/* 过牌 - 淡色 */
.commentary-pass {
    color: #aabbcc;
    text-shadow: 0 2px 6px rgba(0,0,0,0.5);
    font-size: 1.1rem;
    padding: 8px 18px;
}

/* 单张 - 俏皮 */
.commentary-single {
    color: #aaddaa;
    text-shadow: 0 2px 6px rgba(0,0,0,0.5);
    font-size: 1.1rem;
    padding: 8px 18px;
}

/* 对子 - 粉色 */
.commentary-pair {
    color: #ff99cc;
    text-shadow: 0 2px 6px rgba(0,0,0,0.5);
    font-size: 1.1rem;
    padding: 8px 18px;
}

/* 普通出牌 - 淡雅 */
.commentary-play {
    color: #e0d0a0;
    text-shadow: 0 2px 6px rgba(0,0,0,0.5);
    font-size: 1.1rem;
    padding: 8px 18px;
}

/* 关闭评论时隐藏所有气泡 */
body[data-commentary="false"] .commentary-bubble {
    display: none !important;
}

@keyframes commentaryShake {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    20% { transform: translate(-52%, -50%) scale(1.05); }
    40% { transform: translate(-48%, -50%) scale(1.05); }
    60% { transform: translate(-51%, -50%) scale(1.02); }
    80% { transform: translate(-49%, -50%) scale(1.02); }
}

@keyframes commentaryGlow {
    0%, 100% { box-shadow: 0 8px 32px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.08), 0 0 0 rgba(240,192,64,0); }
    50% { box-shadow: 0 8px 32px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.08), 0 0 30px rgba(240,192,64,0.3); }
}

@keyframes commentaryPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.08); }
}

@media (max-width: 560px) {
    .commentary-bubble {
        font-size: 1rem;
        padding: 6px 14px;
    }
}

/* ===== Changelog / Announcement Modal ===== */
#changelog-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.changelog-modal {
    background: linear-gradient(135deg, rgba(20,35,20,0.95), rgba(10,25,10,0.98));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.06);
    width: 100%;
    max-width: 520px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: #e8e8e8;
}

.changelog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.changelog-header h2 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: #f0c040;
    text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.changelog-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.changelog-current {
    margin-bottom: 20px;
}

.changelog-current h3 {
    margin: 8px 0 12px;
    font-size: 1.05rem;
    color: #ffd700;
}

.changelog-current ul,
.changelog-version ul {
    margin: 0;
    padding-left: 18px;
    line-height: 1.7;
    font-size: 0.9rem;
    color: #c8d4c8;
}

.changelog-current li,
.changelog-version li {
    margin-bottom: 4px;
}

.changelog-version-badge {
    display: inline-block;
    background: linear-gradient(135deg, rgba(212,160,23,0.25), rgba(180,130,10,0.2));
    border: 1px solid rgba(212,160,23,0.35);
    color: #f0c040;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 20px;
    letter-spacing: 0.5px;
}

.changelog-history {
    border-top: 1px solid rgba(255,255,255,0.06);
    padding-top: 12px;
}

.changelog-history summary {
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: #a8b8a8;
    padding: 8px 0;
    user-select: none;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.changelog-history summary::-webkit-details-marker { display: none; }

.changelog-history-content {
    padding-top: 8px;
}

.changelog-version {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.changelog-version:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.changelog-version h4 {
    margin: 6px 0 8px;
    font-size: 0.95rem;
    color: #d4c8a8;
}

.changelog-footer {
    padding: 14px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    justify-content: center;
}

.changelog-footer .btn-primary {
    background: linear-gradient(135deg, #d4a017, #b8860b);
    border: none;
    color: #1a1a1a;
    font-weight: 700;
    padding: 10px 28px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 4px 16px rgba(212,160,23,0.3);
}

.changelog-footer .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(212,160,23,0.4);
}

/* 菜单底部按钮布局 */
.menu-footer-left {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-changelog-float {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.04));
    border: 1px solid rgba(255,255,255,0.1);
    color: #c8d4c8;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
}

.btn-changelog-float:hover {
    background: linear-gradient(135deg, rgba(255,255,255,0.14), rgba(255,255,255,0.08));
    border-color: rgba(255,255,255,0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

@media (max-width: 560px) {
    .changelog-modal {
        max-height: 90vh;
        border-radius: 12px;
    }
    .changelog-body {
        padding: 14px;
    }
    .changelog-current ul,
    .changelog-version ul {
        font-size: 0.85rem;
    }
    .btn-changelog-float span:last-child {
        display: none;
    }
}

/* ===== Play Style Analyzer ===== */
#play-style-overlay {
    position: fixed;
    inset: 0;
    z-index: 2001;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.play-style-modal {
    background: linear-gradient(135deg, rgba(20,35,20,0.95), rgba(10,25,10,0.98));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.06);
    width: 100%;
    max-width: 560px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: #e8e8e8;
}

.play-style-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}

.play-style-header h2 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: #f0c040;
    text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.play-style-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* 空状态 */
.play-style-empty {
    text-align: center;
    padding: 40px 20px;
}

.play-style-empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.7;
}

.play-style-empty p {
    color: #c8d4c8;
    font-size: 1rem;
    margin: 0 0 8px;
}

.play-style-empty-hint {
    color: rgba(200,212,200,0.5);
    font-size: 0.85rem;
}

/* 主内容区 */
.play-style-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 英雄区：组合标签 + 雷达图 */
.play-style-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.play-style-combo-badge {
    text-align: center;
    padding: 12px 24px;
    background: linear-gradient(135deg, rgba(212,160,23,0.15), rgba(180,130,10,0.1));
    border: 1px solid rgba(212,160,23,0.25);
    border-radius: 12px;
    max-width: 100%;
}

.play-style-combo-label {
    font-size: 1.3rem;
    font-weight: 800;
    color: #ffd700;
    text-shadow: 0 2px 8px rgba(0,0,0,0.4), 0 0 20px rgba(255,215,0,0.3);
    margin-bottom: 4px;
}

.play-style-combo-desc {
    font-size: 0.85rem;
    color: rgba(255,215,0,0.7);
}

.play-style-radar-wrap {
    display: flex;
    justify-content: center;
    width: 100%;
}

.radar-chart-svg {
    max-width: 260px;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
}

/* 维度条 */
.play-style-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.play-style-bar-row {
    display: grid;
    grid-template-columns: 1fr 120px 36px;
    align-items: center;
    gap: 10px;
}

.play-style-bar-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #c8d4c8;
    white-space: nowrap;
    overflow: hidden;
}

.play-style-bar-icon {
    font-size: 0.9rem;
    flex-shrink: 0;
}

.play-style-bar-name {
    font-weight: 600;
    flex-shrink: 0;
}

.play-style-bar-tier {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-left: 4px;
    flex-shrink: 0;
}

.play-style-bar-track {
    height: 8px;
    background: rgba(255,255,255,0.08);
    border-radius: 4px;
    overflow: hidden;
}

.play-style-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.play-style-bar-value {
    font-size: 0.85rem;
    font-weight: 700;
    text-align: right;
    flex-shrink: 0;
}

/* 数据概览 */
.play-style-report {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 14px 16px;
}

.play-style-report h4,
.play-style-advice h4 {
    margin: 0 0 12px;
    font-size: 0.9rem;
    color: #f0c040;
    font-weight: 700;
}

.play-style-report-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.report-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 8px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
}

.report-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffd700;
}

.report-label {
    font-size: 0.7rem;
    color: rgba(200,212,200,0.6);
    margin-top: 2px;
}

/* 建议 */
.play-style-advice {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 14px 16px;
}

.play-style-advice ul {
    margin: 0;
    padding-left: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.play-style-advice li {
    font-size: 0.85rem;
    color: #c8d4c8;
    line-height: 1.5;
    padding-left: 4px;
}

@media (max-width: 560px) {
    .play-style-modal {
        max-height: 92vh;
        border-radius: 12px;
    }
    .play-style-body {
        padding: 14px;
    }
    .play-style-bar-row {
        grid-template-columns: 1fr 80px 32px;
        gap: 6px;
    }
    .play-style-bar-tier {
        display: none;
    }
    .play-style-report-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
    .report-cell {
        padding: 6px 4px;
    }
    .report-value {
        font-size: 0.95rem;
    }
    .radar-chart-svg {
        max-width: 220px;
    }
}


/* ===== 每日挑战 ===== */

/* 挑战结果面板 */
#challenge-result-overlay {
    position: fixed;
    inset: 0;
    z-index: 250;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 250;
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.3s ease;
}
#challenge-result-overlay:not(.hidden) {
    opacity: 1;
}

.challenge-result-modal {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    width: 90%;
    max-width: 420px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
    transform: scale(0.92);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
#challenge-result-overlay:not(.hidden) .challenge-result-modal {
    transform: scale(1);
}

.challenge-result-header {
    padding: 20px 24px 12px;
    text-align: center;
    border-bottom: 1px solid var(--glass-border);
}
.challenge-result-header h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--accent-gold);
    margin: 0;
}

.challenge-result-body {
    padding: 20px 24px;
    text-align: center;
}

.challenge-stars {
    font-size: 2.5rem;
    margin: 8px 0 16px;
    letter-spacing: 4px;
}
.challenge-stars .star-empty {
    opacity: 0.25;
    filter: grayscale(1);
}

.challenge-result-date {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.challenge-result-score {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent-gold);
    margin: 8px 0;
}
.challenge-result-score.negative {
    color: #ff6b6b;
}

.challenge-result-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.challenge-result-detail {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 16px;
}
.challenge-detail-cell {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 10px 6px;
}
.challenge-detail-cell .detail-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}
.challenge-detail-cell .detail-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.challenge-result-footer {
    padding: 12px 24px 20px;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}
.challenge-result-footer button {
    flex: 1;
    min-width: 100px;
}

/* 挑战历史面板 */
#challenge-history-overlay {
    position: fixed;
    inset: 0;
    z-index: 250;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 250;
    backdrop-filter: blur(6px);
}

.challenge-history-modal {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    width: 90%;
    max-width: 480px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

.challenge-history-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--glass-border);
}
.challenge-history-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent-gold);
    margin: 0;
}

.challenge-history-body {
    padding: 12px 16px;
    overflow-y: auto;
    flex: 1;
}

.challenge-history-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 20px;
    font-size: 0.95rem;
}

.challenge-history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.challenge-history-item {
    display: grid;
    grid-template-columns: 70px 1fr 60px;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    transition: background 0.2s;
}
.challenge-history-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.challenge-history-item .hist-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}
.challenge-history-item .hist-stars {
    font-size: 1rem;
    letter-spacing: 1px;
}
.challenge-history-item .hist-score {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: right;
}
.challenge-history-item .hist-score.negative {
    color: #ff6b6b;
}

/* 每日挑战按钮上的状态标记 */
.daily-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
    font-weight: 600;
}
.daily-badge.completed {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}
.daily-badge.three-star {
    background: rgba(255, 215, 0, 0.2);
    color: #ffd700;
}

/* 每日挑战描述行 */
#daily-challenge-desc {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 响应式 */
@media (max-width: 560px) {
    .challenge-result-modal,
    .challenge-history-modal {
        width: 94%;
        border-radius: 16px;
    }
    .challenge-result-body {
        padding: 16px;
    }
    .challenge-result-footer {
        padding: 10px 16px 16px;
    }
    .challenge-result-footer button {
        min-width: 80px;
        font-size: 0.85rem;
    }
    .challenge-result-detail {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
    .challenge-detail-cell {
        padding: 8px 4px;
    }
}


/* ===== 残局训练 ===== */

/* 残局训练界面 */
#endgame-screen,
#challenge-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: clamp(20px, 4vh, 40px) clamp(16px, 4vw, 40px);
    overflow-y: auto;
}

.endgame-container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 18px;
    max-width: 720px;
    width: 100%;
}

.endgame-progress-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.endgame-progress-track {
    flex: 1;
    height: 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 5px;
    overflow: hidden;
}

.endgame-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #f0c040, #ffd700);
    border-radius: 5px;
    transition: width 0.5s ease;
    width: 0%;
}

.endgame-progress-text {
    font-size: 0.85rem;
    font-weight: 700;
    color: #f0c040;
    min-width: 36px;
    text-align: right;
}

.endgame-levels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
}

.endgame-level-card {
    position: relative;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 18px 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow: hidden;
}

.endgame-level-card:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(240, 192, 64, 0.3);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

.endgame-level-card.locked {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(0.8);
}

.endgame-level-card.locked:hover {
    transform: none;
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.08);
}

.endgame-level-card.completed {
    background: rgba(240, 192, 64, 0.08);
    border-color: rgba(240, 192, 64, 0.2);
}

.endgame-level-id {
    position: absolute;
    top: 10px;
    right: 12px;
    font-size: 1.4rem;
    font-weight: 900;
    opacity: 0.15;
    line-height: 1;
}

.endgame-level-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
}

.endgame-level-desc {
    font-size: 0.78rem;
    opacity: 0.55;
    line-height: 1.4;
}

.endgame-level-stars {
    font-size: 1rem;
    margin-top: 4px;
}

.endgame-level-steps {
    font-size: 0.72rem;
    color: #f0c040;
    font-weight: 600;
    margin-top: 2px;
}

.endgame-level-lock {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    opacity: 0.6;
}

.endgame-actions {
    display: flex;
    justify-content: center;
    padding-top: 8px;
}

/* 残局游戏内信息栏 */
.endgame-info-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: rgba(240, 192, 64, 0.12);
    border: 1px solid rgba(240, 192, 64, 0.2);
    border-radius: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.endgame-info-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #f0c040;
}

.endgame-info-obj {
    font-size: 0.8rem;
    opacity: 0.8;
    flex: 1;
}

.endgame-info-hint-btn {
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid rgba(240, 192, 64, 0.3);
    background: rgba(240, 192, 64, 0.15);
    color: #f0c040;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s;
}

.endgame-info-hint-btn:hover {
    background: rgba(240, 192, 64, 0.3);
}

/* 残局结果面板 */
.endgame-result-level {
    font-size: 1rem;
    font-weight: 600;
    margin: 6px 0;
}

.endgame-result-steps {
    font-size: 0.9rem;
    opacity: 0.8;
    margin: 4px 0;
}

.endgame-result-progress {
    font-size: 0.85rem;
    opacity: 0.6;
    margin: 8px 0 14px;
}

/* 响应式 */
@media (max-width: 560px) {
    .endgame-levels-grid {
        grid-template-columns: 1fr;
    }
    .endgame-info-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}

/* ===== AI 教练复盘 ===== */
.coach-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 12px 0 20px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(255,255,255,0.05);
}
.coach-score-value {
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1;
}
.coach-score-label {
    font-size: 0.85rem;
    opacity: 0.7;
    margin-top: 4px;
}
.coach-score.score-good .coach-score-value { color: #4ade80; }
.coach-score.score-mid .coach-score-value { color: #facc15; }
.coach-score.score-bad .coach-score-value { color: #f87171; }

.coach-suggestions {
    max-height: 320px;
    overflow-y: auto;
    margin-bottom: 16px;
    padding-right: 4px;
}
.coach-suggestion {
    background: rgba(255,255,255,0.04);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
    border-left: 4px solid transparent;
    text-align: left;
}
.coach-suggestion.severity-high { border-left-color: #f87171; background: rgba(248,113,113,0.06); }
.coach-suggestion.severity-medium { border-left-color: #facc15; background: rgba(250,204,21,0.06); }
.coach-suggestion.severity-low { border-left-color: #4ade80; background: rgba(74,222,128,0.06); }

.coach-suggestion-header {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.95rem;
    line-height: 1.4;
}
.coach-suggestion-icon {
    flex-shrink: 0;
    font-size: 1.1rem;
    margin-top: 1px;
}
.coach-suggestion-title {
    flex: 1;
}
.coach-suggestion-detail {
    font-size: 0.8rem;
    opacity: 0.65;
    margin-top: 6px;
    margin-left: 28px;
}
.coach-jump-btn {
    display: inline-block;
    margin-top: 8px;
    margin-left: 28px;
    padding: 4px 10px;
    font-size: 0.8rem;
    background: rgba(100,150,255,0.15);
    border: 1px solid rgba(100,150,255,0.3);
    border-radius: 6px;
    color: #93c5fd;
    cursor: pointer;
}
.coach-jump-btn:hover {
    background: rgba(100,150,255,0.25);
}
#btn-coach-review {
    background: linear-gradient(135deg, rgba(100,80,200,0.8), rgba(80,60,180,0.9));
    border: 1px solid rgba(150,130,255,0.4);
}
#btn-coach-review:hover {
    background: linear-gradient(135deg, rgba(120,100,220,0.9), rgba(100,80,200,1));
}

/* ===== 极限挑战模式 ===== */

.challenge-container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 18px;
    max-width: 840px;
    width: 100%;
}

.challenge-progress-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.challenge-progress-track {
    flex: 1;
    height: 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 5px;
    overflow: hidden;
}

.challenge-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #e040f0, #ff6b9d);
    border-radius: 5px;
    transition: width 0.5s ease;
    width: 0%;
}

.challenge-progress-text {
    font-size: 0.85rem;
    font-weight: 700;
    color: #e040f0;
    min-width: 42px;
    text-align: right;
}

.challenge-levels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
}

.challenge-level-card {
    position: relative;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 18px 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow: hidden;
}

.challenge-level-card:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(224, 64, 240, 0.3);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

.challenge-level-card.locked {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(0.8);
}

.challenge-level-card.locked:hover {
    transform: none;
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.08);
}

.challenge-level-card.completed {
    background: rgba(224, 64, 240, 0.08);
    border-color: rgba(224, 64, 240, 0.2);
}

.challenge-level-card.diff-easy {
    border-left: 3px solid #4ade80;
}

.challenge-level-card.diff-normal {
    border-left: 3px solid #facc15;
}

.challenge-level-card.diff-hard {
    border-left: 3px solid #f87171;
}

.challenge-level-icon {
    font-size: 1.6rem;
    line-height: 1;
}

.challenge-level-id {
    position: absolute;
    top: 10px;
    right: 12px;
    font-size: 1.2rem;
    font-weight: 900;
    opacity: 0.15;
    line-height: 1;
}

.challenge-level-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
}

.challenge-level-desc {
    font-size: 0.78rem;
    opacity: 0.55;
    line-height: 1.4;
}

.challenge-level-diff {
    font-size: 0.72rem;
    font-weight: 600;
    margin-top: 2px;
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(255,255,255,0.08);
    width: fit-content;
}

.challenge-level-stars {
    font-size: 1rem;
    margin-top: 4px;
}

.challenge-level-lock {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    opacity: 0.6;
}

.challenge-actions {
    display: flex;
    justify-content: center;
    padding-top: 8px;
}

/* 挑战游戏内信息栏 */
.challenge-info-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: rgba(224, 64, 240, 0.12);
    border: 1px solid rgba(224, 64, 240, 0.2);
    border-radius: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.challenge-info-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #e040f0;
}

.challenge-info-desc {
    font-size: 0.8rem;
    opacity: 0.8;
    flex: 1;
}

/* 挑战结果面板 */
.challenge-result-name {
    font-size: 1rem;
    font-weight: 600;
    margin: 6px 0;
}

.challenge-result-progress {
    font-size: 0.85rem;
    opacity: 0.6;
    margin: 8px 0 14px;
}

/* 响应式 */
@media (max-width: 560px) {
    .challenge-levels-grid {
        grid-template-columns: 1fr;
    }
    .challenge-info-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}

/* ===== 牌谱工坊 ===== */
#workshop-screen {
    overflow-y: auto;
    position: relative;
}

.workshop-container {
    padding: 32px 20px;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

.workshop-container h2 {
    text-align: center;
    margin-bottom: 6px;
    font-size: clamp(1.4rem, 3vw, 1.8rem);
    font-weight: 800;
    background: linear-gradient(180deg, #fff 0%, #f0d080 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.workshop-subtitle {
    text-align: center;
    opacity: 0.5;
    margin-bottom: 24px;
    font-size: 0.9rem;
    font-weight: 400;
}

.workshop-import-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.workshop-import-bar input {
    flex: 1;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(0,0,0,0.25);
    color: #fff;
    font-size: 0.95rem;
    outline: none;
}

.workshop-import-bar input::placeholder {
    color: rgba(255,255,255,0.35);
}

.workshop-import-bar input:focus {
    border-color: rgba(240,208,128,0.5);
}

.workshop-import-bar .btn-primary {
    padding: 10px 18px;
    border-radius: 12px;
    font-size: 0.9rem;
    white-space: nowrap;
}

.workshop-stats {
    text-align: center;
    font-size: 0.85rem;
    opacity: 0.55;
    margin-bottom: 18px;
}

.workshop-empty {
    text-align: center;
    padding: 80px 20px;
    opacity: 0.4;
    font-size: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.workshop-empty::before {
    content: '🎞️';
    font-size: 3rem;
    opacity: 0.5;
    display: block;
}

.workshop-records-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.workshop-record-card {
    background: rgba(0,0,0,0.22);
    border-radius: 16px;
    padding: 16px 18px;
    border: 1px solid rgba(255,255,255,0.06);
    transition: background 0.2s, transform 0.15s;
}

.workshop-record-card:hover {
    background: rgba(0,0,0,0.3);
    transform: translateY(-1px);
}

.workshop-record-name {
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 4px;
    color: #fff;
}

.workshop-record-note {
    font-size: 0.88rem;
    opacity: 0.6;
    margin-bottom: 6px;
    line-height: 1.4;
}

.workshop-record-date {
    font-size: 0.8rem;
    opacity: 0.4;
    margin-bottom: 10px;
}

.workshop-record-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-workshop-play,
.btn-workshop-share {
    padding: 7px 14px;
    border-radius: 10px;
    border: none;
    font-size: 0.85rem;
    cursor: pointer;
    transition: filter 0.15s, transform 0.1s;
    font-family: inherit;
}

.btn-workshop-play {
    background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
    color: #fff;
}

.btn-workshop-share {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
    color: #fff;
}

.btn-workshop-play:hover,
.btn-workshop-share:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
}

.btn-workshop-play:active,
.btn-workshop-share:active {
    transform: translateY(0);
}

.btn-workshop-delete {
    margin-left: auto;
    padding: 7px 12px;
    border-radius: 10px;
    border: none;
    font-size: 0.85rem;
    cursor: pointer;
    background: rgba(244,67,54,0.2);
    color: #f44336;
    transition: background 0.15s, transform 0.1s;
    font-family: inherit;
}

.btn-workshop-delete:hover {
    background: rgba(244,67,54,0.35);
    transform: translateY(-1px);
}

.btn-workshop-delete:active {
    transform: translateY(0);
}

.btn-workshop-share:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    filter: grayscale(0.6);
}

/* 响应式 */
@media (max-width: 560px) {
    .workshop-import-bar {
        flex-direction: column;
    }
    .workshop-import-bar .btn-primary {
        width: 100%;
    }
    .workshop-record-actions {
        gap: 6px;
    }
    .btn-workshop-play,
    .btn-workshop-share,
    .btn-workshop-delete {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
}
