* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    height: 100dvh;
    overflow: hidden;
    background: #121933;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    min-height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #121933;
}

.back-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    background-color: #2196F3;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 12px 25px;
    font-size: 16px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    z-index: 1000;
}

.back-btn:hover {
    background-color: #1976D2;
}

.style-toggle-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: background 0.25s ease, box-shadow 0.25s ease, opacity 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

.voice-toggle-btn {
    background: linear-gradient(135deg, #3aa0ff 0%, #2f74d0 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: background 0.25s ease, box-shadow 0.25s ease, opacity 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

.speech-mode-btn {
    background: linear-gradient(135deg, #27ae60 0%, #1e8f4f 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: background 0.25s ease, box-shadow 0.25s ease, opacity 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

.style-toggle-btn:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.voice-toggle-btn:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.28);
}

.speech-mode-btn:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.28);
}

.style-toggle-btn .icon {
    font-size: 16px;
}

.style-toggle-btn:disabled,
.voice-toggle-btn:disabled,
.speech-mode-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

.all-boxes {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    margin-bottom: 20px;
}

.left-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18.9px;
    padding: 20px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(244, 67, 54, 0.15) 0%, rgba(244, 67, 54, 0.05) 100%);
    border: 2px solid #f44336;
}

.right-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18.9px;
    padding: 20px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.15) 0%, rgba(33, 150, 243, 0.05) 100%);
    border: 2px solid #2196F3;
}

/* 现代样式 - 左右屏幕 */
body.style-modern .left-screen {
    background: linear-gradient(135deg, rgba(244, 67, 54, 0.25) 0%, rgba(183, 28, 28, 0.15) 100%);
    border-color: #ff5252;
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.3);
}

body.style-modern .right-screen {
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.25) 0%, rgba(13, 71, 161, 0.15) 100%);
    border-color: #448aff;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
}

/* 经典样式 - 左右屏幕 */
body.style-classic .left-screen {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.22) 0%, rgba(24, 33, 66, 0.7) 100%);
    border-color: rgba(255, 120, 120, 0.88);
    box-shadow: 0 10px 28px rgba(255, 82, 82, 0.22);
}

body.style-classic .right-screen {
    background: linear-gradient(135deg, rgba(86, 170, 255, 0.22) 0%, rgba(24, 33, 66, 0.7) 100%);
    border-color: rgba(111, 191, 255, 0.9);
    box-shadow: 0 10px 28px rgba(64, 169, 255, 0.22);
}

/* 不同样式下的body背景 */
body.style-modern {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

body.style-classic {
    background: linear-gradient(135deg, #0f1633 0%, #17234d 55%, #1c2d64 100%);
}

body.style-default {
    background: #f5f5f5;
}

.rect {
    width: 94.5px;
    height: 37.8px;
    background-color: white;
    border:1px solid #ddd;
    border-radius:4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5px;
    font-size: 10px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    z-index: 10;
}

.rect:hover {
    background-color: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.rect.left-side {
    border-color: #f44336;
}

.rect.right-side {
    border-color: #2196F3;
}

.box {
    width: 56.7px;
    height: 56.7px;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
}

.box.left-side {
    border-color: #ddd;
}

.box.right-side {
    border-color: #ddd;
}

.box-large {
    width: 85.05px;
    height: 85.05px;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: bold;
    color: #333;
    position: relative;
}

.box-large.left-side {
    border-color: #ddd;
    background-color: white;
}

.box-large.left-side .score-display {
    color: #333;
}

.box-large.left-side .score-input {
    color: #333;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 100;
}

.box-large.right-side {
    border-color: #ddd;
    background-color: white;
}

.box-large.right-side .score-display {
    color: #333;
}

.box-large.right-side .score-input {
    color: #333;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 100;
}

.box-large.serving {
    box-shadow: 0 0 0 3px #FFA000;
}

.box-large.serving::before {
    content: '🏓';
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 18px;
    z-index: 10;
}

.box-large.selectable {
    cursor: pointer;
    position: relative;
}

.box-large.selectable::after {
    content: '点选发球方';
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    font-weight: 300;
    color: #666;
    white-space: nowrap;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 2px 8px;
    border-radius: 3px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.box-large.selectable:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.score-display {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.score-display.hidden {
    display: none;
}

.score-input {
    display: none !important;
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    font-size: 32px;
    font-weight: bold;
    text-align: center;
    outline: none;
}

.score-input.active {
    display: block !important;
}

.score-input::-webkit-inner-spin-button,
.score-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.score-input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.game-dots-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    min-height: 22px;
}

.game-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    flex-shrink: 0;
}

.game-dot.pending {
    opacity: 0.45;
}

.game-dot.completed {
    width: 13px;
    height: 13px;
    border-color: transparent;
}

.game-dot.completed.winner-left {
    background: linear-gradient(135deg, #ff7a7a 0%, #e53935 100%);
    box-shadow: 0 0 12px rgba(229, 57, 53, 0.55);
}

.game-dot.completed.winner-right {
    background: linear-gradient(135deg, #7eb6ff 0%, #3f51b5 100%);
    box-shadow: 0 0 12px rgba(63, 81, 181, 0.55);
}

.game-dot.completed:not(.winner-left):not(.winner-right) {
    background: linear-gradient(135deg, #81c784 0%, #43a047 100%);
    box-shadow: 0 0 10px rgba(67, 160, 71, 0.45);
}

.game-dot.active {
    width: 15px;
    height: 15px;
    background: linear-gradient(135deg, #a5d6a7 0%, #66bb6a 100%);
    border-color: rgba(255, 255, 255, 0.35);
    box-shadow: 0 0 12px rgba(102, 187, 106, 0.75);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 8px rgba(76, 175, 80, 0.6);
    }
    50% {
        transform: scale(1.2);
        box-shadow: 0 0 15px rgba(76, 175, 80, 0.9);
    }
}

.controls-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin-top: 18.9px;
}

.control-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-item label {
    font-size: 14px;
    color: #333;
    background: rgba(255, 255, 255, 0.7);
    padding: 4px 10px;
    border-radius: 4px;
    backdrop-filter: blur(4px);
}

.control-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.control-item select {
    padding: 6px 12px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    cursor: pointer;
}

.control-item select:hover {
    border-color: #2196F3;
}

.control-item select:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}

.game-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin-top: 15px;
    padding: 10px;
    background-color: #f5f5f5;
    border-radius: 8px;
}

.confirm-game-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 15px;
    margin-bottom: 8px;
    padding: 10px;
}

@keyframes blink {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.05); }
    100% { opacity: 1; transform: scale(1); }
}

#confirm-game-btn {
    animation: blink 1s ease-in-out infinite;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.info-value {
    font-size: 16px;
    color: #333;
    font-weight: bold;
}

.winner-display {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.winner-content {
    background-color: white;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
}

.winner-content h2 {
    color: #4CAF50;
    font-size: 32px;
    margin-bottom: 20px;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #fff;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: space-around;
    padding: 12px 0;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.nav-item {
    text-decoration: none;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
    text-align: center;
    flex: 1;
    margin: 0 4px;
}

.nav-item:hover {
    background-color: #f0f0f0;
    color: #4CAF50;
}

.nav-item:active {
    background-color: #e0e0e0;
    transform: scale(0.98);
}

.import-dialog-overlay {
    font-size: 24px;
    color: #333;
    margin-bottom: 30px;
    font-weight: bold;
}

.new-match-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 15px 40px;
    font-size: 18px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.new-match-btn:hover {
    background-color: #45a049;
}

.new-match-button-container {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1001;
}

.new-match-main-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 15px 40px;
    font-size: 18px;
    cursor: pointer;
    transition: background-color 0.3s;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.new-match-main-btn:hover {
    background-color: #45a049;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.continue-match-button-container {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1001;
}

.continue-match-main-btn {
    background-color: #2196F3;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 15px 40px;
    font-size: 18px;
    cursor: pointer;
    transition: background-color 0.3s;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.continue-match-main-btn:hover {
    background-color: #0b7dda;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.circle {
    width: 56.7px;
    height: 56.7px;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 300;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
}

.circle:hover {
    background-color: #f0f0f0;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.circle:active {
    transform: scale(0.95);
}

.circle.left-side {
    border-color: #ddd;
}

.circle.right-side {
    border-color: #ddd;
}

.import-text {
    font-size: 16px;
    font-weight: bold;
}

.player-select {
    width: 151.2px;
    height: 56.7px;
    padding: 8px;
    margin-top: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    overflow: visible;
}

.player-select option {
    font-weight: normal;
    padding: 8px;
    white-space: normal;
    word-wrap: break-word;
}

.player-select option.selected-player {
    font-weight: bold;
    color: #333;
    background: #f0f0f0;
}

.player-select option.disabled-player {
    color: #999;
    background: #f9f9f9;
}

.player-select:focus {
    outline: none;
    border-color: #4CAF50;
}

.player-display-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.custom-select {
    position: relative;
    width: 151.2px;
    z-index: 40;
}

.select-trigger {
    width: 151.2px;
    height: 56.7px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
}

#trigger-left {
    border-color: #ddd;
}

#trigger-right {
    border-color: #ddd;
}

.select-trigger:focus {
    outline: none;
    border-color: #4CAF50;
}

.selected-values {
    flex: 1;
    text-align: center;
    font-size: 14px;
    color: #333;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: center;
    align-items: center;
}

.selected-value-item {
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: bold;
}

.select-arrow {
    margin-left: 5px;
    font-size: 12px;
    color: #666;
}

.select-options {
    position: absolute;
    top: 100%;
    left: 0;
    width: 151.2px;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
    display: none;
    z-index: 200;
    margin-top: 2px;
}

.select-options.show {
    display: block;
}

.select-option {
    padding: 10px;
    cursor: pointer;
    font-size: 14px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
}

.select-option:last-child {
    border-bottom: none;
}

.select-option:hover {
    background: #f0f0f0;
}

.select-option.selected {
    font-weight: bold;
    color: #333;
    background: #f0f0f0;
}

.select-option.disabled {
    color: #999;
    cursor: not-allowed;
    background: #f9f9f9;
}

.imported-player-item .remove-btn {
    background: #f44336;
    border: none;
    color: white;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    line-height: 1;
}

.imported-player-item .remove-btn:hover {
    background: #d32f2f;
}

.import-dialog {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    z-index: 1000;
    width: 400px;
    max-width: 90vw;
}

.import-dialog h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 18px;
}

.import-dialog .import-content {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 15px;
}

.import-content label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
}

.import-content select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.import-content select option {
    padding: 8px;
}

.import-content .hint {
    margin-top: 10px;
    font-size: 12px;
    color: #666;
    font-style: italic;
}

.selected-players {
    margin-top: 15px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #f9f9f9;
}

.selected-players label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    font-size: 14px;
}

#selected-players-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.player-tag {
    display: inline-block;
    padding: 5px 12px;
    background-color: #4CAF50;
    color: white;
    border-radius: 15px;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.player-tag:hover {
    background-color: #45a049;
}

.player-tag::after {
    content: ' ×';
    margin-left: 5px;
}

.import-dialog .dialog-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.import-dialog .dialog-btn {
    border: none;
    border-radius: 5px;
    padding: 10px 20px;
    font-size: 14px;
    cursor: pointer;
}

.import-dialog .confirm-btn {
    background-color: #4CAF50;
    color: white;
}

.import-dialog .confirm-btn:hover {
    background-color: #45a049;
}

.import-dialog .cancel-btn {
    background-color: #9E9E9E;
    color: white;
}

.import-dialog .cancel-btn:hover {
    background-color: #757575;
}

.import-dialog-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 999;
}

.scoreboard-top-scores-zone {
    position: fixed;
    top: calc(38px + env(safe-area-inset-top, 0px));
    left: 0;
    right: 0;
    z-index: 998;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    max-height: min(172px, 28vh);
    overflow-y: auto;
    padding: 2px 6px 4px;
    box-sizing: border-box;
    pointer-events: none;
}

body.scoreboard-has-scores {
    --scoreboard-scores-band: min(88px, 18vh);
}

body.tc-challenge-scoreboard.scoreboard-has-scores {
    --scoreboard-scores-band: min(88px, 18vh);
}

.match-scores-display {
    position: static;
    top: auto;
    left: auto;
    right: auto;
    width: 100%;
    max-height: none;
    overflow: visible;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    pointer-events: none;
}

.match-scores-display h3 {
    display: none;
}

.game-scores-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
    max-height: 156px;
    overflow-y: auto;
    align-items: center;
    width: fit-content;
    margin: 0 auto;
}

.game-score-item {
    display: grid;
    grid-template-columns: 44px minmax(40px, 1fr) 14px minmax(40px, 1fr);
    align-items: center;
    gap: 4px 6px;
    width: min(480px, 90vw);
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.25;
    min-height: 26px;
    box-sizing: border-box;
    pointer-events: auto;
    backdrop-filter: blur(8px);
}

.game-score-item.current {
    background: rgba(91, 141, 255, 0.16);
    border: 1px solid rgba(91, 141, 255, 0.42);
}

.game-score-item.game-score-item-pending {
    background: rgba(255, 193, 7, 0.12);
    border: 1px dashed rgba(255, 193, 7, 0.45);
}

.game-score-item.game-score-item-pending .game-pending-tag {
    font-size: 10px;
    font-weight: 700;
    color: #ffcc80;
    margin-left: 3px;
}

.game-number {
    font-weight: bold;
    color: rgba(243, 246, 255, 0.78);
    min-width: 38px;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-score {
    font-weight: bold;
    color: var(--text-main);
    min-width: 44px;
    text-align: center;
    border-radius: 5px;
    padding: 1px 5px;
}

.game-score.winner {
    color: #6ee7a8;
}

.game-score.loser {
    color: #fca5a5;
}

.game-score-separator {
    font-weight: bold;
    color: rgba(243, 246, 255, 0.45);
    text-align: center;
}

.confirm-dialog {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    z-index: 1000;
    width: 400px;
    max-width: 90vw;
}

/* 高于全场结束弹窗，保证「返回比赛 / 确定放弃」始终可点 */
#cancel-match-dialog.confirm-dialog {
    z-index: 1004;
}

/* 微信等 WebView：缩小点击延迟、保证足够点触区域 */
#cancel-match-dialog .dialog-btn {
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.08);
    min-height: 44px;
}

/* 比赛进行中：赛制、换人、开始比赛、大分区点选、直接输入勾选项、底部导航不可点（JS 同步加 body 类） */
body.scoreboard-match-active #bottom-nav {
    pointer-events: none !important;
    opacity: 0.6 !important;
}
body.scoreboard-match-active #start-match-btn {
    pointer-events: none;
    opacity: 0.6;
}
body.scoreboard-match-active #match-format {
    pointer-events: none;
    opacity: 0.6;
}
body.scoreboard-match-active #style-toggle-btn {
    pointer-events: none;
    opacity: 0.6;
}
body.scoreboard-match-active #direct-input,
body.scoreboard-match-active label[for="direct-input"] {
    pointer-events: none;
    opacity: 0.6;
}
body.scoreboard-match-active .custom-select {
    pointer-events: none !important;
    opacity: 0.6 !important;
}
body.scoreboard-match-active .score-display {
    pointer-events: none !important;
    cursor: default;
}

/* 全场结束：深色卡片 + 各局与局分摘要，胜标在左右外侧 */
#confirm-dialog.match-end-dialog {
    width: min(440px, 92vw);
    max-height: min(78vh, 640px);
    overflow-y: auto;
    background: rgba(28, 30, 46, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    color: var(--text-main);
    -webkit-overflow-scrolling: touch;
    z-index: 1002;
}

#confirm-dialog.match-end-dialog h3 {
    color: var(--text-main);
    margin-bottom: 12px;
}

.match-end-summary-row {
    display: grid;
    grid-template-columns: 2.25rem 1fr 2.25rem;
    align-items: stretch;
    gap: 6px;
    margin-bottom: 14px;
}

.match-end-win-outer {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: clamp(18px, 4.2vw, 22px);
    color: #ff3b3b;
    text-shadow: 0 0 12px rgba(255, 59, 59, 0.35);
    line-height: 1;
    user-select: none;
}

.match-end-win-outer.is-placeholder {
    visibility: hidden;
    pointer-events: none;
}

.match-end-summary-core {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 10px;
    align-items: center;
    min-width: 0;
}

.mec-col {
    min-width: 0;
    text-align: center;
}

.mec-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.35;
    word-break: break-word;
}

.mec-col-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.mec-label {
    font-size: 11px;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    text-transform: none;
}

.mec-big {
    font-size: clamp(26px, 7vw, 34px);
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    color: var(--text-main);
    letter-spacing: 0.04em;
}

.match-end-last-game {
    text-align: center;
    margin: 0 0 12px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-variant-numeric: tabular-nums;
}

.match-end-last-game .mlg-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.match-end-last-game .mlg-score {
    font-size: 17px;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: 0.06em;
}

.match-end-games-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-align: center;
}

.match-end-games-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
    max-height: min(44vh, 340px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.match-end-game-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 8px;
    align-items: center;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}

.match-end-game-row .meg-left,
.match-end-game-row .meg-right {
    font-weight: 800;
    text-align: center;
    min-width: 0;
}

.match-end-game-row .meg-left.won {
    color: #7ee787;
}

.match-end-game-row .meg-left.lost {
    color: rgba(243, 246, 255, 0.55);
}

.match-end-game-row .meg-right.won {
    color: #7ee787;
}

.match-end-game-row .meg-right.lost {
    color: rgba(243, 246, 255, 0.55);
}

.match-end-game-row .meg-num {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    padding: 0 4px;
}

.match-end-hint {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.45;
    margin: 0 0 4px;
}

.match-end-winner-line {
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    color: #ff6b6b;
    margin: 0 0 12px;
    line-height: 1.4;
}

.confirm-dialog h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 18px;
    text-align: center;
}

.confirm-dialog .dialog-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.confirm-dialog .dialog-btn {
    border: none;
    border-radius: 5px;
    padding: 10px 20px;
    font-size: 14px;
    cursor: pointer;
}

.confirm-dialog .confirm-btn {
    background-color: #4CAF50;
    color: white;
}

.confirm-dialog .confirm-btn:hover {
    background-color: #45a049;
}

.confirm-dialog .cancel-btn {
    background-color: #9E9E9E;
    color: white;
}

.confirm-dialog .cancel-btn:hover {
    background-color: #757575;
}

/* --- Responsive + visual refresh (aligned to 单/双打 循环/淘汰赛风格) --- */
:root {
    --app-bg: linear-gradient(165deg, #080c18 0%, #0f1628 38%, #121933 68%, #0a1020 100%);
    --card-bg: rgba(18, 28, 52, 0.52);
    --card-border: rgba(140, 185, 255, 0.28);
    --text-main: #eef4ff;
    --text-muted: rgba(220, 232, 255, 0.72);
    --accent: #5b8dff;
    --accent-2: #3d5fc9;
    --danger: #ff6b6b;
    --primary: #6eb0ff;
    --tech-glow: rgba(90, 160, 255, 0.35);
    --tech-metal: rgba(180, 205, 240, 0.22);
    --tech-glass: rgba(12, 22, 45, 0.55);
    --score-digit: #f8fbff;
    /* 顶/底预留：用于避开固定顶栏与底部导航 */
    --scoreboard-header-top-gap: 22px;
    --scoreboard-top-clearance: 54px;
    --scoreboard-scores-band: 0px;
    --scoreboard-content-top-gap: 20px;
    --scoreboard-body-pad-y: 0px;
    /* 与 common.css --nav-height(70px) + 底部安全区对齐，避免底坞被导航遮挡 */
    --scoreboard-bottom-nav-clearance: calc(var(--nav-height, 70px) + env(safe-area-inset-bottom, 0px));
    /* 确认本局浮层底边抬高量（避开底坞 + 底栏导航） */
    --confirm-game-overlay-lift: 188px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--app-bg);
    justify-content: flex-start;
    color: var(--text-main);
    /* 顶部尽量贴顶：只为固定顶栏预留高度 + 刘海安全区 */
    padding-top: calc(var(--scoreboard-top-clearance) + var(--scoreboard-scores-band) + env(safe-area-inset-top));
    padding-left: 8px;
    padding-right: 8px;
    padding-bottom: calc(var(--scoreboard-bottom-nav-clearance) + 12px);
    min-height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
}

/* 比分板 + 底栏：略偏下，避免与顶部局分条重叠 */
.scoreboard-main-column {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    min-height: 0;
    width: 100%;
    max-width: 100%;
    padding-top: calc(var(--scoreboard-content-top-gap) + 6px);
    box-sizing: border-box;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* fixed 子项不参与纵向占位，否则 flex:1 主栏拿不到剩余高度 */
body > .scoreboard-top-bar,
body > .scoreboard-settings-backdrop,
body > .scoreboard-settings-panel,
body > .scoreboard-top-scores-zone,
body > .confirm-game-container.confirm-game-overlay {
    flex: 0 0 0;
    min-height: 0;
    overflow: visible;
}

body > .confirm-game-container.confirm-game-overlay {
    z-index: 1008;
}

body > .bottom-nav {
    flex: 0 0 0;
    min-height: 0;
    overflow: visible;
    z-index: 1020;
}

.scoreboard-top-bar {
    position: fixed;
    top: var(--scoreboard-header-top-gap);
    left: 0;
    right: 0;
    min-height: 44px;
    padding: calc(6px + env(safe-area-inset-top, 0px)) 52px 8px;
    padding-left: max(52px, calc(12px + env(safe-area-inset-left, 0px)));
    padding-right: max(52px, calc(12px + env(safe-area-inset-right, 0px)));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1010;
    box-sizing: border-box;
    pointer-events: none;
}

.scoreboard-top-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    max-width: 100%;
    text-align: center;
    pointer-events: none;
}

.scoreboard-top-main .scoreboard-header-timer {
    pointer-events: auto;
}

.scoreboard-top-bar .scoreboard-header-timer.game-info {
    margin: 0;
    padding: 0;
    gap: 0;
    width: auto;
    max-width: 100%;
    min-height: 0;
    height: auto;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 0;
    background: transparent;
    backdrop-filter: none;
    box-shadow: none;
    pointer-events: auto;
}

.scoreboard-top-bar .scoreboard-header-timer .info-item {
    gap: 0;
    margin: 0;
    padding: 0;
}

.scoreboard-top-bar .scoreboard-header-timer .info-label {
    display: none;
}

.scoreboard-top-bar .scoreboard-header-timer .info-value {
    font-size: 15px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
    color: #ffffff;
    line-height: 1;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}

/* 顶栏计时器不因「直接输入」等脚本降低透明度，始终保持醒目 */
#game-info.scoreboard-header-timer {
    opacity: 1 !important;
}

body.style-default .scoreboard-top-bar .scoreboard-header-timer.game-info,
body.style-modern .scoreboard-top-bar .scoreboard-header-timer.game-info {
    background: transparent;
    border: none;
    box-shadow: none;
}

body.style-default .scoreboard-top-bar .scoreboard-header-timer .info-value,
body.style-modern .scoreboard-top-bar .scoreboard-header-timer .info-value {
    color: #ffffff;
}

body.style-classic .scoreboard-top-bar .scoreboard-header-timer.game-info {
    background: transparent;
    border: none;
    box-shadow: none;
}

body.style-classic .scoreboard-top-bar .scoreboard-header-timer .info-value {
    color: #ffffff;
}

.scoreboard-top-bar .scoreboard-page-title {
    margin: 0;
    padding: 0;
    font-size: clamp(16px, 4vw, 19px);
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55), 0 1px 12px rgba(0, 0, 0, 0.35);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    pointer-events: none;
    box-sizing: border-box;
    flex-shrink: 0;
}

.scoreboard-top-bar .scoreboard-header-timer .info-value {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.06em;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.scoreboard-format-btn {
    position: absolute;
    top: 50%;
    left: max(8px, env(safe-area-inset-left, 0px));
    transform: translateY(-50%);
    margin-top: calc(env(safe-area-inset-top, 0px) * 0.5);
    width: 46px;
    height: 46px;
    padding: 0;
    border-radius: 12px;
    border: none;
    background: transparent;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: 0.02em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
    transition: background 0.2s ease, transform 0.15s ease, opacity 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    pointer-events: auto;
    z-index: 2;
}

.scoreboard-format-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

.scoreboard-format-btn:active {
    transform: translateY(-50%) scale(0.96);
}

.scoreboard-format-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

#tc-challenge-banner {
    display: none;
    width: min(520px, 94vw);
    margin: 0;
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid rgba(102, 126, 234, 0.45);
    background: rgba(102, 126, 234, 0.18);
    font-size: 12px;
    line-height: 1.4;
    position: static;
    pointer-events: auto;
    box-sizing: border-box;
}

.tc-banner-title { font-weight: 800; }
.tc-banner-sub { opacity: 0.9; margin-top: 4px; }
.tc-banner-disc { opacity: 0.78; margin-top: 2px; font-size: 12px; }

.tc-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 13000;
    background: rgba(0, 0, 0, 0.72);
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.tc-overlay.show { display: flex; }

.tc-dialog {
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow: auto;
    background: linear-gradient(180deg, rgba(34, 45, 82, 0.99), rgba(26, 36, 68, 0.99));
    border: 1px solid rgba(190, 209, 255, 0.35);
    border-radius: 14px;
    padding: 16px;
    color: #eef3ff;
}

.tc-dialog h3 {
    margin: 0 0 12px;
    font-size: 16px;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px;
    line-height: 1.35;
}
.tc-dialog h3 .tc-dialog-title-hint {
    font-size: 12px;
    font-weight: 500;
    opacity: 0.72;
    letter-spacing: 0;
}
.tc-dialog label { display: block; font-size: 13px; margin: 10px 0 4px; opacity: 0.85; }
.tc-dialog select,
.tc-dialog input[type="search"],
.tc-dialog input[type="number"] {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(190, 209, 255, 0.35);
    background: rgba(0, 0, 0, 0.35);
    color: #f0f4ff;
    font-size: 15px;
    color-scheme: dark;
}

.tc-dialog select option,
.tc-dialog select optgroup {
    background: #1a2240;
    color: #f0f4ff;
}

.tc-format-item {
    display: block;
    padding: 10px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
}

.tc-format-desc { display: block; font-size: 12px; opacity: 0.72; margin-top: 4px; line-height: 1.45; }
.tc-format-group { margin-bottom: 10px; }
.tc-format-group-hd { font-size: 12px; font-weight: 700; opacity: 0.82; margin: 8px 0 4px; }
.tc-search-pick {
    display: block;
    width: 100%;
    text-align: left;
    margin: 6px 0;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    cursor: pointer;
}

.tc-meta { opacity: 0.7; font-size: 12px; }
.tc-dialog-ft {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}
.tc-dialog-ft button {
    border: none;
    border-radius: 8px;
    padding: 6px 12px;
    min-height: 32px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.tc-dialog-ft .tc-primary { background: #667eea; }
.tc-roster-section-title {
    font-size: 13px;
    font-weight: 700;
    opacity: 0.9;
    margin: 12px 0 8px;
}
.tc-roster-section-title:first-child { margin-top: 0; }
.tc-roster-empty-hint,
.tc-roster-loading,
.tc-roster-remain {
    font-size: 12px;
    line-height: 1.5;
    opacity: 0.72;
    margin: 6px 0 10px;
}
.tc-roster-opponent-taken {
    font-size: 12px;
    line-height: 1.5;
    margin: 6px 0 10px;
    color: #ffb74d;
    font-weight: 600;
    opacity: 1;
}
.tc-roster-remain { color: #ffb74d; font-weight: 600; opacity: 1; }
.tc-roster-level-sum {
    margin-top: 10px;
    font-size: 13px;
    line-height: 1.5;
    color: #81c784;
    font-weight: 600;
}
.tc-roster-level-sum.tc-roster-level-over { color: #ff8a80; }
.tc-roster-slot {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 8px;
    margin-bottom: 6px;
    border: 1px solid rgba(190, 209, 255, 0.35);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
}
.tc-roster-select {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(190, 209, 255, 0.35);
    background: rgba(0, 0, 0, 0.25);
    color: #fff;
    font-size: 15px;
    touch-action: manipulation;
}
.tc-roster-select:disabled { opacity: 0.6; }

.tc-slot-idx {
    flex-shrink: 0;
    width: 1.6em;
    height: 1.6em;
    line-height: 1.6em;
    text-align: center;
    font-weight: 800;
    color: #fff;
    background: #667eea;
    border-radius: 50%;
    font-size: 12px;
}
.tc-roster-slot-name { flex: 1; min-width: 0; font-size: 15px; font-weight: 600; }
.tc-roster-slot-acts { display: flex; gap: 4px; flex-shrink: 0; }
.tc-roster-slot-acts button {
    min-width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    touch-action: manipulation;
}
.tc-roster-slot-acts button:disabled { opacity: 0.35; cursor: default; }
.tc-roster-rm { color: #ffb4b4; }

.scoreboard-settings-btn {
    position: absolute;
    top: 50%;
    right: max(8px, env(safe-area-inset-right, 0px));
    transform: translateY(-50%);
    margin-top: calc(env(safe-area-inset-top, 0px) * 0.5);
    width: 46px;
    height: 46px;
    border-radius: 12px;
    border: none;
    background: transparent;
    backdrop-filter: none;
    color: #ffffff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.22));
    transition: background 0.2s ease, transform 0.15s ease, opacity 0.2s ease, filter 0.2s ease;
    pointer-events: auto;
}

.scoreboard-settings-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    filter: drop-shadow(0 0 14px rgba(255, 255, 255, 0.35));
}

.scoreboard-settings-btn:active {
    transform: translateY(-50%) scale(0.96);
}

body.style-default .scoreboard-settings-btn {
    background: transparent;
    border: none;
    color: #ffffff;
    box-shadow: none;
}

body.style-default .scoreboard-settings-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* 打开设置时由 JS 加上，彻底避免顶栏标题/计时器叠在侧栏上（部分 WebView 合成层会盖过普通 z-index） */
body.scoreboard-settings-open .scoreboard-top-bar {
    visibility: hidden !important;
}

.scoreboard-settings-backdrop {
    position: fixed;
    inset: 0;
    /* 高于顶栏(1010)、底栏(1020)及页内多数浮层；低于 showCustomAlert(9999) 以免抢裁判提示 */
    z-index: 9500;
    background: rgba(0, 0, 0, 0.42);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s ease, visibility 0.22s ease;
}

.scoreboard-settings-backdrop.is-open {
    opacity: 1;
    visibility: visible;
}

.scoreboard-settings-panel {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    height: 100dvh;
    max-width: 400px;
    width: min(400px, 92vw);
    z-index: 9501;
    background: rgba(22, 28, 48, 0.97);
    color: var(--text-main);
    border-left: 1px solid var(--card-border);
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.35);
    transform: translateX(100%);
    transition: transform 0.26s ease;
    display: flex;
    flex-direction: column;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

.scoreboard-settings-panel.is-open {
    transform: translateX(0);
}

.scoreboard-settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px 12px;
    border-bottom: 1px solid var(--card-border);
    flex-shrink: 0;
}

.scoreboard-settings-header h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    letter-spacing: 0.02em;
}

.scoreboard-settings-close {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-main);
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.scoreboard-settings-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.scoreboard-settings-body {
    padding: 16px 18px 28px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.settings-field {
    margin-bottom: 18px;
}

.settings-field-voice {
    margin-bottom: 20px;
}

.settings-field-label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

/* 语音：两行按钮纵向排布；试听按钮在「默认(浅色)侧栏」下必须用深色字，否则白底看不见 */
.settings-voice-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
}

.voice-preview-btn {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.12);
    color: #eef3ff;
    border-radius: 12px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.voice-preview-btn:active {
    opacity: 0.9;
}

body.style-default .voice-preview-btn {
    border-color: rgba(0, 0, 0, 0.14);
    background: linear-gradient(135deg, #eef2ff 0%, #dfe6fb 100%);
    color: #1a2744;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* 仅「试听朗读」失败或不支持时显示 */
.settings-voice-fail-help {
    display: none;
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(0, 0, 0, 0.2);
}

.settings-voice-fail-help.is-visible {
    display: block;
}

.settings-voice-fail-title {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
}

.settings-voice-fail-body {
    font-size: 12px;
    line-height: 1.55;
    color: var(--text-muted);
    margin: 0;
    white-space: pre-line;
}

body.style-default .settings-voice-fail-help {
    border-color: rgba(0, 0, 0, 0.1);
    background: rgba(0, 0, 0, 0.04);
}

body.style-default .settings-voice-fail-title {
    color: #1a2744;
}

body.style-default .settings-voice-fail-body {
    color: #555;
}

.settings-field-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
}

.settings-inline-label {
    font-size: 15px;
    color: var(--text-main);
    cursor: pointer;
}

.settings-field-row input[type="checkbox"] {
    width: 22px;
    height: 22px;
    cursor: pointer;
    flex-shrink: 0;
}

.settings-player-tools-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.settings-player-tools-row .voice-preview-btn {
    flex: 1 1 calc(50% - 5px);
    min-width: 118px;
}

.settings-player-hint {
    font-size: 12px;
    line-height: 1.55;
    color: var(--text-muted);
    margin-top: 8px;
}

body.style-default .settings-player-hint {
    color: #555;
}

#match-format.settings-match-format-select {
    width: 100%;
    padding: 11px 12px;
    font-size: 15px;
    border-radius: 10px;
    border: 1px solid var(--card-border);
    background: rgba(0, 0, 0, 0.22);
    color: var(--text-main);
    cursor: pointer;
}

body.style-classic .scoreboard-settings-panel {
    background: rgba(12, 18, 40, 0.98);
}

body.style-classic .scoreboard-settings-close {
    background: rgba(9, 16, 36, 0.55);
}

body.style-default .scoreboard-settings-panel {
    background: #fff;
    color: #222;
    border-left-color: rgba(0, 0, 0, 0.08);
}

body.style-default .scoreboard-settings-header {
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

body.style-default .scoreboard-settings-header h2 {
    color: #222;
}

body.style-default .scoreboard-settings-close {
    background: #f0f0f0;
    color: #333;
}

body.style-default .settings-field-label {
    color: #666;
}

body.style-default .settings-inline-label {
    color: #222;
}

body.style-default .settings-field-row {
    background: #f7f7f7;
    border-color: #e0e0e0;
}

body.style-default #match-format.settings-match-format-select {
    background: #fff;
    border-color: #ccc;
    color: #222;
}

body.style-default .style-toggle-btn,
body.style-default .voice-toggle-btn,
body.style-default .speech-mode-btn {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

body.style-default,
body.style-modern {
    background: var(--app-bg);
}

body.style-classic {
    background: linear-gradient(135deg, #0f1633 0%, #17234d 55%, #1c2d64 100%);
    color: #ecf3ff;
}

body.style-classic .selected-values,
body.style-classic .select-arrow,
body.style-classic .control-item label,
body.style-classic .info-label,
body.style-classic .info-value {
    color: #ecf3ff;
}

body.style-classic .select-trigger,
body.style-classic .box,
body.style-classic .box-large,
body.style-classic .circle,
body.style-classic .control-item,
body.style-classic .game-info:not(.scoreboard-header-timer) {
    background: rgba(9, 16, 36, 0.45);
    border-color: rgba(220, 235, 255, 0.22);
}

body.style-classic .box-large .score-display,
body.style-classic .box-large .score-input {
    color: #f3f8ff !important;
    text-shadow: 0 1px 8px rgba(20, 35, 70, 0.45);
}

body.style-classic .select-options {
    background: rgba(11, 18, 40, 0.98);
    border-color: rgba(220, 235, 255, 0.22);
}

body.style-classic .select-option {
    color: #edf4ff;
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.style-classic .select-option:hover {
    background: rgba(102, 126, 234, 0.25);
}

body.style-classic .settings-field-row {
    background: rgba(9, 16, 36, 0.45);
    border-color: rgba(220, 235, 255, 0.22);
}

body.style-classic #match-format.settings-match-format-select {
    background: rgba(9, 16, 36, 0.45);
    border-color: rgba(220, 235, 255, 0.22);
    color: #ecf3ff;
}

body.style-classic .bottom-nav {
    background: rgba(28, 38, 72, 0.72);
    border-top-color: rgba(255, 255, 255, 0.09);
    box-shadow: 0 -4px 22px rgba(0, 0, 0, 0.08);
}

body.style-classic .nav-item {
    color: rgba(230, 238, 255, 0.82);
}

body.style-classic .nav-item:hover {
    background-color: rgba(102, 126, 234, 0.14);
    color: #fff;
}

.all-boxes {
    width: 100%;
    max-width: min(1240px, calc(100vw - 16px));
    margin: 0 auto 16px;
    gap: 2px;
    flex-wrap: nowrap;
    --board-scale: 1;
    transform: scale(var(--board-scale));
    transform-origin: top center;
}

.left-screen,
.right-screen {
    width: min(44vw, 460px);
    min-width: 250px;
    padding: clamp(12px, 2vw, 18px);
    border-radius: 16px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(8px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.22);
}

.left-screen {
    border-color: rgba(255, 107, 107, 0.45);
}

.right-screen {
    border-color: rgba(91, 141, 255, 0.45);
}

.custom-select,
.select-trigger,
.select-options {
    width: 100%;
}

.select-trigger {
    height: 52px;
    border-radius: 12px;
    border-color: var(--card-border);
    background: rgba(0, 0, 0, 0.2);
}

.selected-values {
    color: var(--text-main);
}

.select-arrow {
    color: var(--text-muted);
}

.select-options {
    border-radius: 12px;
    border-color: var(--card-border);
    background: rgba(22, 33, 62, 0.98);
}

.select-option {
    color: var(--text-main);
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.select-option:hover {
    background: rgba(102, 126, 234, 0.2);
}

.box,
.circle {
    width: clamp(54px, 9vw, 64px);
    height: clamp(54px, 9vw, 64px);
    border-radius: 12px;
    border-color: var(--card-border);
    background: rgba(0, 0, 0, 0.18);
    color: var(--text-main);
}

.circle {
    border-radius: 50%;
    font-size: clamp(18px, 2.5vw, 22px);
}

.box-large {
    width: clamp(88px, 13vw, 132px);
    height: clamp(88px, 13vw, 132px);
    border-radius: 14px;
    border-color: var(--card-border);
    background: rgba(0, 0, 0, 0.24);
}

.score-display {
    font-size: clamp(32px, 6vw, 56px);
    color: var(--text-main);
}

.score-input {
    font-size: clamp(32px, 6vw, 56px);
    color: var(--text-main);
}

.controls-container {
    width: 100%;
    max-width: 980px;
    gap: 10px;
    flex-wrap: wrap;
    margin: 8px auto 0;
}

.control-item {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 8px 10px;
}

.control-item label {
    color: var(--text-main);
    background: transparent;
    padding: 0;
}

.control-item select {
    border-radius: 8px;
    border-color: var(--card-border);
    background: rgba(0, 0, 0, 0.22);
    color: var(--text-main);
}

#undo-btn,
#cancel-btn,
#confirm-game-btn,
.new-match-main-btn,
.continue-match-main-btn {
    border-radius: 999px !important;
    border: none;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

#confirm-game-btn {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%) !important;
}

.new-match-main-btn {
    background: linear-gradient(135deg, #43a047 0%, #2e7d32 100%);
}

.continue-match-main-btn {
    background: linear-gradient(135deg, var(--primary) 0%, #3b6de0 100%);
}

.scoreboard-dock-meta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    column-gap: 8px;
    width: 100%;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-sizing: border-box;
    min-height: 32px;
}

.scoreboard-dock-title {
    grid-column: 1;
    justify-self: start;
    margin: 0;
    min-width: 0;
    display: flex;
    align-items: center;
    height: 100%;
    font-size: clamp(13px, 3.6vw, 15px);
    font-weight: 700;
    letter-spacing: 0.02em;
    color: rgba(243, 246, 255, 0.92);
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

.scoreboard-dock-format {
    grid-column: 2;
    justify-self: center;
    min-width: 0;
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: clamp(11px, 3vw, 13px);
    font-weight: 700;
    color: rgba(167, 181, 255, 0.95);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 4px;
    line-height: 1;
}

.scoreboard-dock-format[hidden] {
    display: none !important;
}

.scoreboard-dock-timer.game-info {
    grid-column: 3;
    justify-self: end;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    margin: 0 !important;
    padding: 0 !important;
    border: none;
    background: transparent !important;
    box-shadow: none;
    min-height: 0;
}

.scoreboard-dock-timer .info-item {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
}

.scoreboard-dock-timer .info-value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.06em;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #ffffff;
    line-height: 1;
}

.bottom-nav {
    background: rgba(28, 38, 72, 0.72);
    border-top: 1px solid rgba(255, 255, 255, 0.09);
    backdrop-filter: blur(14px);
    box-shadow: 0 -4px 22px rgba(0, 0, 0, 0.08);
}

.nav-item {
    color: rgba(230, 238, 255, 0.82);
}

.nav-item:hover {
    background-color: rgba(102, 126, 234, 0.14);
    color: #fff;
}

.new-match-button-container,
.continue-match-button-container {
    bottom: calc(84px + env(safe-area-inset-bottom));
}

.confirm-game-container.confirm-game-overlay {
    position: fixed;
    inset: 0;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    margin: 0;
    padding: 0 12px;
    padding-bottom: calc(var(--confirm-overlay-lift) + var(--scoreboard-bottom-nav-clearance));
    box-sizing: border-box;
    pointer-events: none;
    background: transparent;
    width: auto;
    max-width: none;
}

.confirm-game-overlay #confirm-game-btn {
    pointer-events: auto;
    width: 100%;
    max-width: min(520px, 92vw);
}

.scoreboard-bottom-dock {
    width: 100%;
    max-width: min(540px, calc(100vw - 20px));
    margin: 12px auto 0;
    padding: 14px 16px 14px;
    background: rgba(12, 16, 30, 0.88);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    backdrop-filter: blur(16px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.42);
}

.bottom-dock-dots-row {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.bottom-dock-dots-row .game-dots-container {
    width: 100%;
    justify-content: center;
}

.scoreboard-bottom-dock .controls-container,
.scoreboard-bottom-dock #controls-container {
    margin-top: 0;
    margin-bottom: 0;
    width: 100%;
    max-width: none;
    display: flex !important;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: stretch;
    gap: 8px;
}

.scoreboard-bottom-dock #controls-container > .control-item {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    max-width: none;
    box-sizing: border-box;
}

.scoreboard-bottom-dock #controls-container > #cancel-match-item {
    flex: 1 1 0;
    max-width: none;
    width: auto;
    margin-left: 0;
    margin-right: 0;
}

#start-match-btn.dock-primary-btn,
#undo-btn.dock-warn-btn,
#cancel-btn.dock-neutral-btn {
    width: 100%;
    padding: 10px 8px !important;
    font-size: 14px !important;
    font-weight: 600;
    border: none;
    border-radius: 12px !important;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    box-sizing: border-box;
}

#start-match-btn.dock-primary-btn {
    background: linear-gradient(135deg, #5b8dff 0%, #3f51b5 100%) !important;
    color: #fff !important;
    box-shadow: 0 6px 18px rgba(63, 81, 181, 0.45);
}

#undo-btn.dock-warn-btn {
    background: linear-gradient(135deg, #ffb74d 0%, #f57c00 100%) !important;
    color: #fff !important;
    box-shadow: 0 6px 18px rgba(245, 124, 0, 0.4);
}

#cancel-btn.dock-neutral-btn {
    background: linear-gradient(135deg, #90949e 0%, #6d727b 100%) !important;
    color: #fff !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

#start-match-btn.dock-primary-btn:disabled,
#undo-btn.dock-warn-btn:disabled {
    opacity: 0.55;
    box-shadow: none;
}

/* 默认/现代主题：底部坞偏深半透明，与页头深蓝背景统一 */
body.style-default .scoreboard-bottom-dock,
body.style-modern .scoreboard-bottom-dock {
    background: rgba(10, 14, 28, 0.92);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

body.style-default .bottom-dock-dots-row,
body.style-modern .bottom-dock-dots-row {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

body.style-classic .scoreboard-bottom-dock {
    background: rgba(6, 10, 24, 0.88);
    border-color: rgba(220, 235, 255, 0.12);
}

@media (min-width: 900px) {
    .scoreboard-bottom-dock #controls-container {
        width: 100%;
        max-width: none;
    }
}

@media (min-width: 1200px) {
    .scoreboard-bottom-dock #controls-container {
        width: 100%;
        max-width: none;
    }
}

@media (max-width: 1024px) {
    .all-boxes {
        margin-top: 0;
        gap: 2px;
    }

    .left-screen,
    .right-screen {
        min-width: 220px;
        padding: 12px;
    }
}

@media (max-width: 768px) {
    :root {
        --scoreboard-top-clearance: 54px;
        --scoreboard-content-top-gap: 10px;
        --confirm-overlay-lift: 200px;
    }

    .left-screen,
    .right-screen {
        gap: 8px;
    }

    .all-boxes {
        margin-bottom: 8px;
    }

    .scoreboard-bottom-dock {
        margin-bottom: 8px;
    }

    .back-btn {
        top: calc(8px + env(safe-area-inset-top));
        padding: 8px 12px;
        font-size: 13px;
        border-radius: 10px;
        left: 10px;
    }

    .scoreboard-top-bar {
        min-height: 48px;
        padding-top: calc(6px + env(safe-area-inset-top));
        padding-bottom: 8px;
    }

    .scoreboard-settings-btn,
    .scoreboard-format-btn {
        width: 44px;
        height: 44px;
    }

    .scoreboard-top-bar .scoreboard-header-timer.game-info {
        min-height: 0;
        height: auto;
        padding: 0;
        border-radius: 0;
    }

    .scoreboard-top-bar .scoreboard-header-timer .info-value {
        font-size: 14px;
    }

    .scoreboard-top-bar .scoreboard-page-title {
        font-size: 15px;
        letter-spacing: 0.02em;
        padding: 0 2px;
    }

    .scoreboard-settings-btn {
        width: 44px;
        height: 44px;
        font-size: 22px;
        border-radius: 11px;
    }

    .scoreboard-format-btn {
        width: 44px;
        height: 44px;
        font-size: 12px;
        border-radius: 11px;
    }

    .all-boxes {
        margin-top: 0;
        gap: 2px;
    }

    .controls-container {
        justify-content: center;
    }

    .control-item {
        width: calc(50% - 6px);
        justify-content: center;
    }

    #confirm-game-btn {
        width: min(92vw, 460px);
        font-size: 15px !important;
        padding: 11px 18px !important;
    }

    .bottom-nav {
        padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
    }

    .nav-item {
        font-size: 12px;
        padding: 7px 6px;
        margin: 0 2px;
    }
}

/* 小屏：主卡片尽量占满宽度，减少左右留白 */
@media (max-width: 640px) {
    :root {
        --scoreboard-top-clearance: 54px;
        --scoreboard-content-top-gap: 14px;
    }

    body {
        padding-left: max(2px, env(safe-area-inset-left));
        padding-right: max(2px, env(safe-area-inset-right));
    }

    .all-boxes {
        max-width: 100%;
        width: 100%;
    }

    .left-screen,
    .right-screen {
        flex: 1 1 0;
        min-width: 0;
        width: auto;
        max-width: none;
    }

    .scoreboard-top-bar {
        padding-top: calc(8px + env(safe-area-inset-top));
        padding-bottom: 8px;
    }
}

@media (max-width: 480px) {
    body {
        padding-left: max(2px, env(safe-area-inset-left));
        padding-right: max(2px, env(safe-area-inset-right));
    }

    .all-boxes {
        gap: 2px;
    }

    .left-screen,
    .right-screen {
        flex: 1 1 0;
        min-width: 0;
        width: auto;
        max-width: none;
        padding: 10px 6px;
        border-radius: 12px;
        gap: 8px;
    }

    .box-large {
        width: 90px;
        height: 90px;
    }

    .score-display,
    .score-input {
        font-size: 44px;
    }

    .box,
    .circle {
        width: 48px;
        height: 48px;
    }

    body.style-default .left-screen,
    body.style-default .right-screen,
    body.style-modern .left-screen,
    body.style-modern .right-screen {
        clip-path: none;
        border-radius: 14px;
    }

    .select-trigger {
        height: 44px;
        padding: 6px;
    }

    .selected-values {
        font-size: 13px;
    }

    .control-item {
        width: 100%;
    }
}

/* 中小折叠屏/小平板（如 540x720）：上半部再放大一档 */
@media (min-width: 501px) and (max-width: 640px) {
    .all-boxes {
        gap: 2px;
    }

    .left-screen,
    .right-screen {
        flex: 1 1 0;
        min-width: 0;
        width: auto;
        max-width: none;
        padding: 12px 8px;
    }

    .box-large {
        width: 100px;
        height: 100px;
    }

    .score-display,
    .score-input {
        font-size: 50px;
    }

    .box,
    .circle {
        width: 52px;
        height: 52px;
    }

    .select-trigger {
        height: 48px;
    }

    .selected-values {
        font-size: 14px;
    }
}

/* 窄平板/小笔记本：提前切纵向，避免横向挤压 */
@media (max-width: 920px) and (min-width: 769px) {
    .all-boxes {
        margin-top: 0;
    }

    .left-screen,
    .right-screen {
        width: min(44vw, 460px);
        min-width: 250px;
    }
}

/* 低高度屏幕（横屏手机、小窗体） */
@media (max-height: 760px) {
    body {
        justify-content: flex-start;
    }

    .scoreboard-main-column {
        justify-content: flex-start;
    }

    .all-boxes {
        margin-top: 0;
    }

    body > .scoreboard-top-scores-zone {
        position: static;
        flex: 0 0 auto;
        max-height: 120px;
        margin: 0 auto 8px;
        top: auto;
    }

    .scoreboard-bottom-dock {
        margin-top: 8px;
    }

    .new-match-button-container,
    .continue-match-button-container {
        position: static;
        transform: none;
        margin: 8px auto 0;
    }
}

/* 超低高度（如 Nest Hub 1024x600）：进一步压缩垂直占用，避免需要上拉 */
@media (max-height: 640px) {
    .all-boxes {
        gap: 2px;
        margin-bottom: 8px;
    }

    .left-screen,
    .right-screen {
        padding: 8px 10px;
        gap: 10px;
        border-radius: 12px;
    }

    .box-large {
        width: 88px;
        height: 88px;
    }

    .score-display,
    .score-input {
        font-size: 42px;
    }

    .box,
    .circle {
        width: 44px;
        height: 44px;
    }

    .select-trigger {
        height: 40px;
        padding: 6px;
    }

    .selected-values {
        font-size: 13px;
    }

    .controls-container {
        margin-top: 4px;
        gap: 8px;
    }

    .control-item {
        padding: 6px 10px;
    }

    .control-item label,
    .control-item select {
        font-size: 14px;
    }

    #start-match-btn,
    #undo-btn,
    #cancel-btn {
        padding: 7px 16px !important;
        font-size: 14px !important;
    }

    .scoreboard-top-bar .scoreboard-header-timer .info-value {
        font-size: 13px;
    }

    .bottom-nav {
        padding-top: 6px;
        padding-bottom: calc(6px + env(safe-area-inset-bottom));
    }

    .nav-item {
        font-size: 12px;
        padding: 5px 4px;
    }
}

/* 极窄宽度：底部导航可读性兜底 */
@media (max-width: 360px) {
    .nav-item {
        font-size: 11px;
        padding: 6px 2px;
        margin: 0 1px;
        white-space: nowrap;
    }

}

/* 平板/桌面：放大下半区控件，提升空间利用率 */
@media (min-width: 900px) {
    .controls-container {
        max-width: 1120px;
        gap: 14px;
        margin-top: 18px;
        width: min(94vw, 1120px);
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        align-items: stretch;
    }

    .control-item {
        padding: 12px 16px;
        border-radius: 14px;
        width: 100%;
        justify-content: center;
    }

    .control-item label {
        font-size: 18px;
    }

    .control-item input[type="checkbox"] {
        width: 22px;
        height: 22px;
    }

    .control-item select {
        font-size: 18px;
        padding: 10px 14px;
    }

    #start-match-btn,
    #undo-btn,
    #cancel-btn {
        font-size: 18px !important;
        padding: 10px 24px !important;
        width: 100%;
    }

    .scoreboard-top-bar .scoreboard-header-timer .info-value {
        font-size: 16px;
    }

    .info-label {
        font-size: 20px;
    }

    .info-value {
        font-size: 26px;
    }

    #cancel-match-item {
        grid-column: 1 / -1;
    }
}

/* 大屏：提升主体原始尺寸，减少留白 */
@media (min-width: 1200px) {
    body {
        padding-left: 6px;
        padding-right: 6px;
    }

    .all-boxes {
        max-width: min(1480px, calc(100vw - 12px));
        gap: 2px;
    }

    .left-screen,
    .right-screen {
        width: min(45vw, 560px);
        min-width: 300px;
        padding: 20px 24px;
        border-radius: 18px;
    }

    .select-trigger {
        height: 62px;
        border-radius: 14px;
    }

    .selected-values {
        font-size: 18px;
    }

    .box-large {
        width: 148px;
        height: 148px;
        border-radius: 16px;
    }

    .score-display,
    .score-input {
        font-size: 68px;
    }

    .box,
    .circle {
        width: 72px;
        height: 72px;
        font-size: 24px;
    }

    .controls-container {
        width: min(95vw, 1320px);
        max-width: min(95vw, 1320px);
        margin-top: 26px;
        gap: 16px;
    }

    .control-item label,
    .control-item select {
        font-size: 20px;
    }

    #start-match-btn,
    #undo-btn,
    #cancel-btn {
        font-size: 20px !important;
        padding: 12px 26px !important;
    }

    .scoreboard-top-bar .scoreboard-header-timer .info-value {
        font-size: 17px;
    }

    .info-label {
        font-size: 22px;
    }

    .info-value {
        font-size: 30px;
    }
}

@media (min-width: 1600px) {
    .all-boxes {
        max-width: min(1700px, calc(100vw - 10px));
    }

    .left-screen,
    .right-screen {
        width: min(46vw, 640px);
    }

    .box-large {
        width: 164px;
        height: 164px;
    }

    .score-display,
    .score-input {
        font-size: 76px;
    }
}

/* 折叠屏/窄平板（如 853 宽）：仅放大下半区，使上下更协调 */
@media (min-width: 820px) and (max-width: 899px) {
    .controls-container {
        width: min(96vw, 980px);
        max-width: min(96vw, 980px);
        gap: 12px;
        margin-top: 18px;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        align-items: stretch;
    }

    .control-item {
        padding: 10px 14px;
        border-radius: 13px;
        width: 100%;
        justify-content: center;
    }

    .control-item label {
        font-size: 17px;
    }

    .control-item input[type="checkbox"] {
        width: 20px;
        height: 20px;
    }

    .control-item select {
        font-size: 17px;
        padding: 9px 13px;
    }

    #start-match-btn,
    #undo-btn,
    #cancel-btn {
        font-size: 17px !important;
        padding: 9px 22px !important;
        width: 100%;
    }

    #cancel-match-item {
        grid-column: 1 / -1;
    }

    .scoreboard-bottom-dock #controls-container {
        width: 100%;
        max-width: none;
    }

    .scoreboard-top-bar .scoreboard-header-timer .info-value {
        font-size: 16px;
    }

    .info-label {
        font-size: 18px;
    }

    .info-value {
        font-size: 24px;
    }
}

/* 兜底覆盖：501~640 且低高度设备，强制使用放大后的上半区 */
@media (min-width: 501px) and (max-width: 640px) and (max-height: 760px) {
    .all-boxes {
        gap: 2px !important;
    }

    .left-screen,
    .right-screen {
        flex: 1 1 0 !important;
        min-width: 0 !important;
        width: auto !important;
        max-width: none !important;
        padding: 12px 8px !important;
    }

    .box-large {
        width: 100px !important;
        height: 100px !important;
    }

    .score-display,
    .score-input {
        font-size: 50px !important;
    }

    .box,
    .circle {
        width: 52px !important;
        height: 52px !important;
    }

    .select-trigger {
        height: 48px !important;
    }
}

/* --- 科技 · 未来 · 金属 · 沉稳（默认 / 现代主题）--- */
body.style-default,
body.style-modern {
    background:
        radial-gradient(ellipse 90% 55% at 50% 105%, rgba(45, 95, 190, 0.22) 0%, transparent 58%),
        radial-gradient(ellipse 50% 35% at 12% 8%, rgba(70, 130, 220, 0.1) 0%, transparent 55%),
        linear-gradient(rgba(80, 130, 210, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(80, 130, 210, 0.045) 1px, transparent 1px),
        var(--app-bg);
    background-size: 100% 100%, 100% 100%, 26px 26px, 26px 26px, 100% 100%;
    background-attachment: fixed;
}

html:has(body.style-default),
html:has(body.style-modern) {
    background: #080c18;
}

body.style-default .left-screen,
body.style-default .right-screen,
body.style-modern .left-screen,
body.style-modern .right-screen {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    border: none;
    border-radius: 18px;
    clip-path: polygon(
        14px 0, calc(100% - 14px) 0, 100% 14px, 100% calc(100% - 14px),
        calc(100% - 14px) 100%, 14px 100%, 0 calc(100% - 14px), 0 14px
    );
    background: linear-gradient(155deg, rgba(22, 38, 72, 0.62) 0%, rgba(8, 14, 32, 0.78) 52%, rgba(14, 24, 48, 0.68) 100%);
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.14),
        inset 0 -1px 0 rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(120, 175, 255, 0.28),
        0 0 0 2px rgba(25, 40, 75, 0.85),
        0 10px 36px rgba(0, 0, 0, 0.48),
        0 0 28px var(--tech-glow);
}

body.style-default .left-screen::before,
body.style-default .right-screen::before,
body.style-modern .left-screen::before,
body.style-modern .right-screen::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(
        128deg,
        rgba(255, 255, 255, 0.11) 0%,
        rgba(255, 255, 255, 0.03) 22%,
        transparent 42%,
        transparent 58%,
        rgba(120, 170, 255, 0.06) 78%,
        rgba(255, 255, 255, 0.04) 100%
    );
    z-index: 0;
}

body.style-default .left-screen::after,
body.style-modern .left-screen::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    box-shadow:
        inset 0 0 0 1px rgba(255, 120, 120, 0.22),
        0 0 18px rgba(255, 90, 90, 0.12);
    z-index: 0;
}

body.style-default .right-screen::after,
body.style-modern .right-screen::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    box-shadow:
        inset 0 0 0 1px rgba(110, 170, 255, 0.28),
        0 0 18px rgba(70, 130, 255, 0.14);
    z-index: 0;
}

body.style-default .left-screen .custom-select,
body.style-default .right-screen .custom-select,
body.style-modern .left-screen .custom-select,
body.style-modern .right-screen .custom-select {
    position: relative;
    z-index: 40;
}

body.style-default .left-screen .box-large,
body.style-default .left-screen .box,
body.style-default .left-screen .circle,
body.style-default .right-screen .box-large,
body.style-default .right-screen .box,
body.style-default .right-screen .circle,
body.style-modern .left-screen .box-large,
body.style-modern .left-screen .box,
body.style-modern .left-screen .circle,
body.style-modern .right-screen .box-large,
body.style-modern .right-screen .box,
body.style-modern .right-screen .circle {
    position: relative;
    z-index: 1;
}

body.style-default .select-trigger,
body.style-modern .select-trigger {
    background: linear-gradient(180deg, rgba(28, 42, 78, 0.82) 0%, rgba(12, 20, 42, 0.9) 100%);
    border: 1px solid var(--tech-metal);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 4px 14px rgba(0, 0, 0, 0.28);
}

body.style-default .box-large,
body.style-modern .box-large {
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.14) 0%, rgba(18, 30, 58, 0.72) 38%, rgba(8, 14, 32, 0.88) 100%);
    border: 1px solid rgba(170, 210, 255, 0.38);
    box-shadow:
        inset 0 2px 12px rgba(255, 255, 255, 0.12),
        inset 0 -3px 10px rgba(0, 0, 0, 0.35),
        0 0 16px rgba(80, 140, 255, 0.18),
        0 6px 20px rgba(0, 0, 0, 0.35);
}

body.style-default .box-large .score-display,
body.style-default .box-large .score-input,
body.style-modern .box-large .score-display,
body.style-modern .box-large .score-input {
    color: var(--score-digit) !important;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
    text-shadow: 0 0 18px rgba(120, 180, 255, 0.35), 0 2px 6px rgba(0, 0, 0, 0.45);
}

body.style-default .box-large.serving,
body.style-modern .box-large.serving {
    box-shadow:
        0 0 0 2px rgba(255, 183, 77, 0.85),
        0 0 22px rgba(255, 160, 0, 0.42),
        inset 0 2px 12px rgba(255, 255, 255, 0.14),
        inset 0 -3px 10px rgba(0, 0, 0, 0.35);
}

body.style-default .box,
body.style-modern .box {
    background: linear-gradient(180deg, rgba(32, 48, 82, 0.88) 0%, rgba(14, 22, 44, 0.94) 100%);
    border: 1px solid rgba(150, 190, 255, 0.28);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 4px 12px rgba(0, 0, 0, 0.28);
    color: var(--score-digit);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

body.style-default .circle,
body.style-modern .circle {
    background: linear-gradient(145deg, rgba(45, 68, 110, 0.92) 0%, rgba(16, 26, 52, 0.96) 100%);
    border: 1px solid rgba(160, 200, 255, 0.38);
    color: rgba(220, 235, 255, 0.95);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        0 0 14px rgba(80, 140, 255, 0.22),
        0 4px 14px rgba(0, 0, 0, 0.32);
}

body.style-default .circle:hover,
body.style-modern .circle:hover {
    background: linear-gradient(145deg, rgba(58, 88, 140, 0.95) 0%, rgba(22, 36, 68, 0.98) 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        0 0 20px rgba(100, 160, 255, 0.35),
        0 6px 18px rgba(0, 0, 0, 0.35);
}

body.style-default .scoreboard-bottom-dock,
body.style-modern .scoreboard-bottom-dock {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(155, 190, 240, 0.24);
    border-radius: 22px;
    background:
        repeating-linear-gradient(
            90deg,
            transparent 0,
            transparent 3px,
            rgba(255, 255, 255, 0.012) 3px,
            rgba(255, 255, 255, 0.012) 4px
        ),
        linear-gradient(180deg, rgba(38, 52, 88, 0.94) 0%, rgba(12, 18, 36, 0.97) 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        inset 0 -1px 0 rgba(0, 0, 0, 0.35),
        0 0 0 1px rgba(0, 0, 0, 0.45),
        0 16px 44px rgba(0, 0, 0, 0.55),
        0 0 32px rgba(60, 110, 200, 0.1);
}

body.style-default .scoreboard-bottom-dock::before,
body.style-modern .scoreboard-bottom-dock::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, transparent 28%);
}

body.style-default .scoreboard-bottom-dock > *,
body.style-modern .scoreboard-bottom-dock > * {
    position: relative;
    z-index: 1;
}

body.style-default .bottom-dock-dots-row,
body.style-modern .bottom-dock-dots-row,
body.style-default .scoreboard-dock-meta,
body.style-modern .scoreboard-dock-meta {
    border-bottom-color: rgba(160, 195, 255, 0.14);
}

body.style-default .game-dot,
body.style-modern .game-dot {
    background: transparent;
    border: 1.5px solid rgba(160, 195, 255, 0.35);
    box-shadow: inset 0 0 6px rgba(80, 130, 255, 0.15);
}

body.style-default .game-dot.active,
body.style-modern .game-dot.active {
    background: radial-gradient(circle at 35% 30%, rgba(180, 220, 255, 0.95) 0%, rgba(70, 130, 220, 0.85) 100%);
    border-color: rgba(200, 230, 255, 0.7);
    box-shadow: 0 0 14px rgba(100, 170, 255, 0.75), inset 0 0 8px rgba(255, 255, 255, 0.35);
    animation: tech-dot-pulse 1.8s ease-in-out infinite;
}

@keyframes tech-dot-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 10px rgba(100, 170, 255, 0.55), inset 0 0 6px rgba(255, 255, 255, 0.25);
    }
    50% {
        transform: scale(1.12);
        box-shadow: 0 0 18px rgba(120, 190, 255, 0.85), inset 0 0 10px rgba(255, 255, 255, 0.4);
    }
}

body.style-default #start-match-btn.dock-primary-btn,
body.style-modern #start-match-btn.dock-primary-btn {
    background: linear-gradient(180deg, #7eb8ff 0%, #4a72d8 42%, #243d8a 100%) !important;
    border: 1px solid rgba(190, 220, 255, 0.45) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.38),
        inset 0 -2px 6px rgba(0, 0, 0, 0.25),
        0 8px 22px rgba(40, 80, 190, 0.48) !important;
}

body.style-default #undo-btn.dock-warn-btn,
body.style-modern #undo-btn.dock-warn-btn {
    background: linear-gradient(180deg, #ffc978 0%, #e8922a 45%, #a85a08 100%) !important;
    border: 1px solid rgba(255, 220, 170, 0.42) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.32),
        inset 0 -2px 6px rgba(0, 0, 0, 0.22),
        0 8px 22px rgba(180, 100, 20, 0.42) !important;
}

body.style-default #cancel-btn.dock-neutral-btn,
body.style-modern #cancel-btn.dock-neutral-btn {
    background: linear-gradient(180deg, #9aa3b8 0%, #6b7280 45%, #454b57 100%) !important;
    border: 1px solid rgba(210, 220, 235, 0.28) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        inset 0 -2px 6px rgba(0, 0, 0, 0.25),
        0 6px 18px rgba(0, 0, 0, 0.32) !important;
}

body.style-default .scoreboard-dock-timer .info-value,
body.style-modern .scoreboard-dock-timer .info-value,
body.style-default .scoreboard-top-bar .scoreboard-header-timer .info-value,
body.style-modern .scoreboard-top-bar .scoreboard-header-timer .info-value {
    background: linear-gradient(180deg, rgba(35, 50, 85, 0.85) 0%, rgba(12, 20, 40, 0.92) 100%);
    border: 1px solid rgba(160, 195, 255, 0.28);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 0 12px rgba(80, 130, 255, 0.12);
    font-variant-numeric: tabular-nums;
}

body.style-default .scoreboard-format-btn,
body.style-modern .scoreboard-format-btn {
    background: linear-gradient(180deg, rgba(40, 58, 98, 0.82) 0%, rgba(16, 26, 52, 0.9) 100%);
    border: 1px solid rgba(160, 195, 255, 0.26);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 4px 14px rgba(0, 0, 0, 0.28);
}

body.style-default .scoreboard-format-btn:hover,
body.style-modern .scoreboard-format-btn:hover {
    background: linear-gradient(180deg, rgba(50, 72, 118, 0.9) 0%, rgba(22, 34, 64, 0.94) 100%);
    border-color: rgba(190, 220, 255, 0.42);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 0 14px rgba(90, 150, 255, 0.2);
}

body.style-default .scoreboard-settings-btn,
body.style-modern .scoreboard-settings-btn {
    background: linear-gradient(180deg, rgba(40, 58, 98, 0.82) 0%, rgba(16, 26, 52, 0.9) 100%);
    border: 1px solid rgba(160, 195, 255, 0.26);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 4px 14px rgba(0, 0, 0, 0.28);
}

body.style-default .bottom-nav,
body.style-modern .bottom-nav {
    background: linear-gradient(180deg, rgba(18, 26, 50, 0.92) 0%, rgba(8, 12, 26, 0.96) 100%);
    border-top: 1px solid rgba(140, 180, 255, 0.14);
    box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

body.style-default .scoreboard-dock-title,
body.style-modern .scoreboard-dock-title {
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}

body.style-default .scoreboard-dock-format,
body.style-modern .scoreboard-dock-format {
    color: rgba(180, 205, 255, 0.92);
}

/* 科技主题：鼠标经过 / 按下反馈（仅 hover 设备，避免移动端粘滞） */
@media (hover: hover) and (pointer: fine) {
    body.style-default .select-trigger,
    body.style-modern .select-trigger,
    body.style-default .box-large,
    body.style-modern .box-large,
    body.style-default .circle,
    body.style-modern .circle,
    body.style-default .scoreboard-format-btn,
    body.style-modern .scoreboard-format-btn,
    body.style-default .scoreboard-settings-btn,
    body.style-modern .scoreboard-settings-btn,
    body.style-default #start-match-btn.dock-primary-btn,
    body.style-modern #start-match-btn.dock-primary-btn,
    body.style-default #undo-btn.dock-warn-btn,
    body.style-modern #undo-btn.dock-warn-btn,
    body.style-default #cancel-btn.dock-neutral-btn,
    body.style-modern #cancel-btn.dock-neutral-btn,
    body.style-default .nav-item,
    body.style-modern .nav-item {
        transition:
            transform 0.18s ease,
            box-shadow 0.22s ease,
            border-color 0.22s ease,
            background 0.22s ease,
            filter 0.22s ease,
            color 0.22s ease;
    }

    body.style-default .select-trigger:hover,
    body.style-modern .select-trigger:hover {
        background: linear-gradient(180deg, rgba(46, 68, 118, 0.94) 0%, rgba(20, 34, 64, 0.96) 100%);
        border-color: rgba(200, 225, 255, 0.48);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.18),
            0 0 20px rgba(100, 160, 255, 0.24),
            0 6px 18px rgba(0, 0, 0, 0.34);
        transform: translateY(-1px);
    }

    body.style-default .select-option:hover,
    body.style-modern .select-option:hover {
        background: rgba(90, 145, 255, 0.24);
        color: #fff;
    }

    body.style-default .box-large:hover,
    body.style-modern .box-large:hover {
        border-color: rgba(200, 230, 255, 0.55);
        box-shadow:
            inset 0 2px 14px rgba(255, 255, 255, 0.16),
            inset 0 -3px 10px rgba(0, 0, 0, 0.32),
            0 0 24px rgba(100, 170, 255, 0.28),
            0 8px 24px rgba(0, 0, 0, 0.38);
        transform: translateY(-2px) scale(1.015);
    }

    body.style-default .box-large.serving:hover,
    body.style-modern .box-large.serving:hover {
        box-shadow:
            0 0 0 2px rgba(255, 200, 100, 0.95),
            0 0 28px rgba(255, 170, 40, 0.5),
            inset 0 2px 14px rgba(255, 255, 255, 0.16),
            inset 0 -3px 10px rgba(0, 0, 0, 0.32);
    }

    body.style-default .box-large.selectable:hover,
    body.style-modern .box-large.selectable:hover {
        transform: translateY(-2px) scale(1.03);
    }

    body.style-default .circle:hover,
    body.style-modern .circle:hover {
        background: linear-gradient(145deg, rgba(62, 95, 150, 0.96) 0%, rgba(26, 42, 78, 0.98) 100%);
        border-color: rgba(190, 225, 255, 0.52);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.24),
            0 0 24px rgba(110, 175, 255, 0.42),
            0 8px 22px rgba(0, 0, 0, 0.38);
        transform: translateY(-2px) scale(1.08);
    }

    body.style-default #start-match-btn.dock-primary-btn:hover:not(:disabled),
    body.style-modern #start-match-btn.dock-primary-btn:hover:not(:disabled) {
        filter: brightness(1.1);
        transform: translateY(-2px);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.45),
            inset 0 -2px 6px rgba(0, 0, 0, 0.22),
            0 12px 28px rgba(50, 100, 220, 0.55) !important;
    }

    body.style-default #undo-btn.dock-warn-btn:hover:not(:disabled),
    body.style-modern #undo-btn.dock-warn-btn:hover:not(:disabled) {
        filter: brightness(1.08);
        transform: translateY(-2px);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.38),
            inset 0 -2px 6px rgba(0, 0, 0, 0.2),
            0 12px 26px rgba(200, 110, 20, 0.5) !important;
    }

    body.style-default #cancel-btn.dock-neutral-btn:hover:not(:disabled),
    body.style-modern #cancel-btn.dock-neutral-btn:hover:not(:disabled) {
        filter: brightness(1.12);
        transform: translateY(-2px);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.28),
            inset 0 -2px 6px rgba(0, 0, 0, 0.22),
            0 10px 24px rgba(0, 0, 0, 0.42) !important;
    }

    body.style-default .scoreboard-format-btn:hover:not(:disabled),
    body.style-modern .scoreboard-format-btn:hover:not(:disabled) {
        transform: translateY(calc(-50% - 1px));
        border-color: rgba(210, 230, 255, 0.55);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.22),
            0 0 20px rgba(100, 160, 255, 0.28),
            0 6px 18px rgba(0, 0, 0, 0.34);
        filter: brightness(1.08);
    }

    body.style-default .scoreboard-settings-btn:hover,
    body.style-modern .scoreboard-settings-btn:hover {
        background: linear-gradient(180deg, rgba(52, 74, 122, 0.92) 0%, rgba(24, 38, 72, 0.96) 100%);
        border-color: rgba(190, 220, 255, 0.42);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.16),
            0 0 18px rgba(100, 160, 255, 0.28),
            0 6px 16px rgba(0, 0, 0, 0.32);
        filter: brightness(1.1);
    }

    body.style-default .nav-item:hover,
    body.style-modern .nav-item:hover {
        background: rgba(90, 140, 255, 0.18);
        color: #fff;
        box-shadow: inset 0 0 0 1px rgba(160, 200, 255, 0.22);
        transform: translateY(-1px);
    }

    body.style-default .left-screen:hover,
    body.style-default .right-screen:hover,
    body.style-modern .left-screen:hover,
    body.style-modern .right-screen:hover {
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.16),
            inset 0 -1px 0 rgba(0, 0, 0, 0.45),
            0 0 0 1px rgba(140, 190, 255, 0.34),
            0 0 0 2px rgba(25, 40, 75, 0.85),
            0 12px 40px rgba(0, 0, 0, 0.5),
            0 0 36px rgba(80, 140, 255, 0.16);
    }
}

@media (hover: hover) and (pointer: fine) {
    body.style-default .select-trigger:active,
    body.style-modern .select-trigger:active,
    body.style-default .circle:active,
    body.style-modern .circle:active,
    body.style-default #start-match-btn.dock-primary-btn:active:not(:disabled),
    body.style-modern #start-match-btn.dock-primary-btn:active:not(:disabled),
    body.style-default #undo-btn.dock-warn-btn:active:not(:disabled),
    body.style-modern #undo-btn.dock-warn-btn:active:not(:disabled),
    body.style-default #cancel-btn.dock-neutral-btn:active:not(:disabled),
    body.style-modern #cancel-btn.dock-neutral-btn:active:not(:disabled) {
        transform: translateY(0) scale(0.98);
    }

    body.style-default .scoreboard-format-btn:active:not(:disabled),
    body.style-modern .scoreboard-format-btn:active:not(:disabled) {
        transform: translateY(-50%) scale(0.97);
    }

    body.style-default .box-large:active,
    body.style-modern .box-large:active {
        transform: translateY(0) scale(0.99);
    }
}

/* 微信 web-view：common.css 会清零 body 顶距；计分板须保留固定顶栏（赛制/设置）占位 */
html.ppq-wx-webview body[data-ppq-scoreboard-home="1"] {
    --scoreboard-header-top-gap: 0px;
    --scoreboard-top-clearance: 54px;
    padding-top: calc(
        var(--scoreboard-top-clearance) + var(--scoreboard-scores-band, 0px) + env(safe-area-inset-top, 0px)
    ) !important;
}

html.ppq-wx-webview body[data-ppq-scoreboard-home="1"] .scoreboard-top-bar {
    top: 0;
}

html.ppq-wx-webview body[data-ppq-scoreboard-home="1"] .scoreboard-top-scores-zone {
    top: calc(var(--scoreboard-top-clearance, 54px) + env(safe-area-inset-top, 0px));
}
