add-player-btn:root {
    --primary-color: #4a6fa5;
    --primary-light: #6b98d1;
    --primary-dark: #3a5a8c;
    --secondary-color: #e67e22;
    --accent-color: #e74c3c;
    --light-color: #f8f9fa;
    --dark-color: #2c3e50;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --border-radius: 12px;
    --box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
    --box-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.15);
    --card-padding: 10px;
    --transition-speed: 0.3s;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4eaf2 100%);
    color: var(--dark-color);
    line-height: 1.6;
    padding: 15px;
    min-height: 100vh;
}

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

header {
    text-align: center;
    margin-bottom: 15px;
    color: var(--primary-color);
    padding: 5px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

header:hover {
    transform: translateY(-3px);
    box-shadow: var(--box-shadow-hover);
}

h1 {
    font-size: 1.8rem;
    margin-bottom: 8px;
    font-weight: 700;
    position: relative;
    display: inline-block;
    color: #2c3e50;
}

h1:after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 10%;
    width: 80%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--secondary-color), transparent);
}

.subtitle {
    color: var(--primary-light);
    font-size: 1rem;
    font-style: italic;
}

.session-info {
    text-align: center;
    margin: 10px 0 25px;
    padding: 12px;
    background: #e3f2fd;
    border-radius: 8px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 隐藏顶部房间信息卡片 */
#session-info {
    display: none !important;
}

.card {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: var(--card-padding);
    margin-bottom: 10px;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--box-shadow-hover);
}

.card-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    color: var(--primary-color);
    padding-bottom: 12px;
    border-bottom: 2px solid #f1f5f9;
}

.card-title h2 {
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title h2 i {
    color: var(--secondary-color);
    font-size: 1.1em;
}

/* 更新房间头部样式 */
.room-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 10px 15px;
    border-radius: var(--border-radius);
    margin-bottom: 10px;
    box-shadow: var(--box-shadow);
}

.room-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

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

.room-id-text {
    font-weight: 600;
    font-size: 1.1rem;
}

.room-id-value {
    font-family: monospace;
    font-size: 1.4rem;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.2);
    padding: 3px 14px;
    border-radius: 6px;
}

.btn-leave {
    padding: 10px;
    border: none;
    border-radius: 8px;
    background-color: rgba(231, 76, 60, 0.8);
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-leave:hover {
    background-color: rgba(231, 76, 60, 1);
    transform: scale(1.05);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .room-header-content {
        flex-direction: row;
        gap: 8px;
    }
    
    .room-id-value {
        font-size: 1.2rem;
    }
    
    .room-header-info {
        flex-wrap: wrap;
    }
}
/* 调整房间输入行布局 */
.room-input-row {
    display: flex;
    align-items: center; /* 改为居中对齐 */
    gap: 10px;
    justify-content: center;
    margin-bottom: 15px;
}

.room-input {
    margin-top: 8px;
    padding: 10px;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-radius: 5px;
    border: 3px solid #90caf9;
    display: flex;
    justify-content: space-between;
    align-items: center; /* 改为改为居中对齐 */
    width: 180px; /* 与台板信息框保持一致 */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#room-management-card {
    display: none;
}
/* 新增房间管理卡片中的台板信息样式 */
.table-info {
    margin-top: 8px;
    padding: 10px;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-radius: 8px;
    border: 1px solid #90caf9;

    justify-content: space-between;
    align-items: center;
}

.table-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: var(--primary-dark);
}

.table-score {
    font-size: 1.0rem;
    font-weight: bold;
    color: var(--primary-color);
    background: white;
    padding: 5px 8px;
    border-radius: 10px;
    min-width: 80px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.player-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.player-name-input[readonly] {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #6c757d;
    cursor: not-allowed;
}

.player-name-input[readonly]:focus {
    border-color: #dee2e6;
    box-shadow: none;
    outline: none;
}

/* 历史对局查询样式 */
.history-results {
  margin-top: 20px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 10px;
}

.history-results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #dee2e6;
}

.history-room-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 15px;
}

.history-info-card {
  background: white;
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.history-info-card h4 {
  margin-bottom: 8px;
  font-size: 0.9rem;
  color: #6c757d;
}

.history-info-card .history-value {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--primary-color);
}

.history-rounds-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 15px;
}

.history-round-item {
  background: white;
  border-radius: 10px;
  padding: 15px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.history-round-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #dee2e6;
}

.history-round-id {
  font-weight: bold;
  color: var(--primary-color);
}

.history-round-date {
  color: #6c757d;
  font-size: 0.9rem;
}

.history-players-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.history-player-item {
  display: flex;
  justify-content: space-between;
  padding: 8px;
  border-radius: 6px;
  background: #f8f9fa;
}

.history-positive {
  color: var(--success-color);
  font-weight: bold;
}

.history-negative {
  color: var(--accent-color);
  font-weight: bold;
}

.history-toggle-details {
  background: none;
  border: none;
  color: var(--primary-color);
  cursor: pointer;
  font-size: 0.9rem;
  text-decoration: underline;
}

.history-round-details {
  margin-top: 12px;
}

.history-details-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.history-details-table th,
.history-details-table td {
  padding: 8px;
  text-align: left;
  border-bottom: 1px solid #dee2e6;
}

.history-details-table th {
  background: #f8f9fa;
  font-weight: 600;
}

.history-win {
  color: var(--success-color);
  font-weight: bold;
}

.history-lose {
  color: var(--accent-color);
  font-weight: bold;
}

.history-summary-section {
  margin-top: 25px;
  padding-top: 15px;
  border-top: 1px solid #dee2e6;
}

.history-summary-section h4 {
  margin-bottom: 15px;
  text-align: center;
  color: var(--primary-color);
}

.history-player-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.history-player-stat-card {
  background: white;
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.history-player-name {
  font-size: 1rem;
  font-weight: bold;
  margin-bottom: 8px;
  color: var(--primary-color);
}

.history-stat-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid #f1f3f4;
  font-size: 0.9rem;
}

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

@media (max-width: 768px) {
  .history-room-info {
    grid-template-columns: 1fr 1fr;
  }
  
  .history-player-stats {
    grid-template-columns: 1fr;
  }
  
  .history-players-grid {
    grid-template-columns: 1fr;
  }
}


.btn {
    padding: 10px 10px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: all 0.5s;
}

.btn:hover:before {
    left: 100%;
}

.btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-danger {
    background-color: var(--accent-color);
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
    transform: translateY(-2px);
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #219653;
    transform: translateY(-2px);
}

.btn-warning {
    background-color: var(--warning-color);
    color: var(--dark-color);
}

.btn-warning:hover {
    background-color: #e67e22;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 8px 12px;
    font-size: 0.85rem;
}

.actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.rounds-scroll-container {
    overflow-x: auto;
    margin-top: 20px;
    padding-bottom: 15px;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-light) transparent;
}

.rounds-scroll-container::-webkit-scrollbar {
    height: 6px;
}

.rounds-scroll-container::-webkit-scrollbar-track {
    background: transparent;
}

.rounds-scroll-container::-webkit-scrollbar-thumb {
    background-color: var(--primary-light);
    border-radius: 3px;
}

.rounds-container {
    display: flex;
    gap: 15px;
    min-width: max-content;
    padding: 5px 0;
}

.round-item {
    padding: 15px;
    border-radius: 10px;
    background-color: var(--light-color);
    min-width: 180px;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    border: 1px solid #e9ecef;
}

.round-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.round-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-weight: bold;
    color: var(--primary-color);
    padding-bottom: 8px;
    border-bottom: 1px solid #e9ecef;
}

.round-players {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.round-player {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    padding: 5px 6px;
    background: white;
    border-radius: 6px;
    transition: background-color var(--transition-speed);
}

.round-player:hover {
    background-color: #f8f9fa;
}

.round-date {
    color: #6c757d;
    font-size: 0.8rem;
}

.total-scores {
    margin-top: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border-radius: 10px;
    transition: box-shadow var(--transition-speed);
}

.total-scores:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.total-title {
    font-weight: bold;
    margin-bottom: 12px;
    color: var(--primary-color);
    text-align: center;
    font-size: 1rem;
}

.total-player {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #ddd;
    transition: transform var(--transition-speed);
}

.total-player:hover {
    transform: translateX(5px);
}

.total-player:last-child {
    border-bottom: none;
}

.empty-state {
    text-align: center;
    padding: 30px 15px;
    color: #6c757d;
    transition: color var(--transition-speed);
}

.empty-state:hover {
    color: var(--primary-color);
    transform: scale(1.02);
}

.empty-state i {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: #ced4da;
    transition: color var(--transition-speed), transform var(--transition-speed);
}

.empty-state:hover i {
    color: var(--primary-light);
    transform: scale(1.1);
}

/* 调试按钮容器样式 */
.debug-buttons-container {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: nowrap; /* 确保按钮不换行 */
    margin-top: 10px;
    width: 70%;
}
/* 添加玩家卡片特殊样式 */
.add-player-card {
    animation: pulse 2s infinite;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-player-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 简洁版 - 只修改确认添加玩家按钮的宽度 */
#confirm-add-player {
    width: 160px !important;
    min-width: 160px !important;
}

/* 移动端适配 */
@media (max-width: 768px) {
    #confirm-add-player {
        width: 160px !important;
        min-width: 160px !important;
    }
}

@media (max-width: 480px) {
    #confirm-add-player {
        width: 140px !important;
        min-width: 140px !important;
    }
}

.new-player-name-input {
    width: 10em;
    height: 40px;
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    text-align: center;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.new-player-name-input:focus {
    border-color: #4a6fa5;
    box-shadow: 0 0 0 2px rgba(74, 111, 165, 0.2);
    outline: none;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(74, 111, 165, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(74, 111, 165, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(74, 111, 165, 0);
    }
}

/* 确保添加玩家卡片在网格布局中正确显示 */
.score-item.add-player-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
}
/* 调试按钮样式 */
.debug-btn {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap; /* 防止文本换行 */
    flex-shrink: 0; /* 防止按钮缩小 */
    min-width: 70px; /* 设置最小宽度 */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

/* 调试信息样式 */
.debug-tabs {
    display: flex;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 15px;
}

.debug-tab {
    padding: 8px 15px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 0.9rem;
    color: #6c757d;
}

.debug-tab.active {
    border-bottom-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: 600;
}

.debug-content {
    min-height: 150px;
    max-height: 300px;
    overflow-y: auto;
}

.debug-tab-content {
    display: none;
}

.debug-tab-content.active {
    display: block;
}

.debug-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f1f3f4;
}

.debug-label {
    font-weight: 600;
    color: var(--dark-color);
}

.debug-value {
    color: var(--primary-color);
    font-family: monospace;
}

.debug-players-list {
    margin-top: 10px;
}

.debug-player-item {
    padding: 8px;
    background-color: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 8px;
    font-family: monospace;
    font-size: 0.9rem;
}

.debug-events-list {
    font-family: monospace;
    font-size: 0.85rem;
}

.debug-event-item {
    padding: 6px 0;
    border-bottom: 1px dashed #e9ecef;
    color: #495057;
}

.debug-event-item.error {
    color: var(--accent-color);
}

.debug-event-item.warning {
    color: var(--warning-color);
}

.debug-event-item.success {
    color: var(--success-color);
}

.debug-event-time {
    color: #6c757d;
    margin-right: 10px;
}

.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: var(--dark-color);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    z-index: 1000;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    font-size: 0.9rem;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* 玩家分数容器布局优化 */
/* 玩家分数容器布局优化 - 改为横向排列 */
.score-container {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 15px;
}

/* 玩家分数项样式 - 横向排列 */
.score-item {
    display: flex;
    align-items: center;
    padding: 3px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    border: 1px solid transparent;
    transition: all var(--transition-speed);
    min-height: 80px;
    justify-content: space-between;
    gap: 15px;
}

.score-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--box-shadow-hover);
    border-color: var(--primary-light);
}

/* 玩家信息区域 */
.player-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

/* 玩家图标样式 */
.player-icon {
    font-size: 1.5rem;
    color: var(--primary-color);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 玩家姓名输入框 - 固定宽度 */
.player-name-input {
    width: 120px !important;
    height: 40px;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    text-align: center;
    font-size: 0.95rem;
    transition: all var(--transition-speed);
}

.player-name-input:focus {
    border-color: var(--primary-light);
    outline: none;
    box-shadow: 0 0 0 3px rgba(107, 152, 209, 0.2);
}

/* 分数输入框 - 固定宽度 */
.score-input {
    width: 120px !important;
    height: 40px;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1.1rem;
    text-align: center;
    transition: all var(--transition-speed);
}

.score-input:focus {
    border-color: var(--primary-light);
    outline: none;
    box-shadow: 0 0 0 3px rgba(107, 152, 209, 0.2);
}

/* 胜负按钮容器 */
.score-controls {
    display: flex;
    gap: 8px;
}

/* 胜负按钮样式 - 调整为与输入框等高 */
.score-control-btn {
    width: 50px;
    height: 40px; /* 与输入框高度一致 */
    padding: 0;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    border: none;
    font-size: 0.9rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-win {
    background-color: #ccc;
    color: white;
}

.btn-win.active {
    background-color: var(--success-color);
    box-shadow: 0 0 0 2px rgba(39, 174, 96, 0.3);
}

.btn-lose {
    background-color: #ccc;
    color: white;
}

.btn-lose.active {
    background-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.3);
}

/* 添加玩家按钮容器 */
.add-player-container {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 15px;
}

/* 添加玩家按钮样式 */
#add-player-btn {
    width: 200px;
    height: 50px;
    border-radius: 8px;
    font-size: 1rem;
    padding: 0 15px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#add-player-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-hover);
}

.total-column {
    background: linear-gradient(135deg, #4a6fa5 0%, #6b98d1 100%);
    color: white;
    padding: 15px;
    border-radius: 10px;
    min-width: 180px;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.total-column:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.total-column .round-header {
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 8px;
}

.total-column .round-player {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.total-column .round-player:hover {
    background: rgba(255, 255, 255, 0.25);
}

.multiplier-selector {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 15px 0;
    flex-wrap: nowrap; /* 确保按钮不换行 */
    overflow-x: auto; /* 在小屏幕上允许横向滚动 */
    white-space: nowrap; /* 防止内容换行 */
    padding-bottom: 5px; /* 为滚动条留出空间 */
}

/* 添加滚动条样式 */
.multiplier-selector::-webkit-scrollbar {
    height: 4px;
}

.multiplier-selector::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.multiplier-selector::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
}

.multiplier-selector::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* 确保按钮保持最小宽度 */
.multiplier-btn {
    padding: 8px 15px;
    border-radius: 6px;
    background-color: var(--light-color);
    border: 2px solid var(--primary-light);
    color: var(--primary-color);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0; /* 防止按钮缩小 */
    min-width: 55px; /* 设置最小宽度 */
}

.multiplier-btn.active {
    background-color: var(--primary-color);
    color: white;
}

.final-score {
    font-weight: bold;
    color: var(--secondary-color);
}

/* 修改用户输入框高度与分数输入框一致 */
.player-name-input:focus {
    border-color: var(--primary-light);
    outline: none;
    box-shadow: 0 0 0 2px rgba(107, 152, 209, 0.2);
}

.table-fee-section {
    margin-top: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    border: 1px solid #ddd;
    text-align: center; /* 添加居中 */
    display: flex;
    flex-direction: column;
    align-items: center; /* 水平居中 */
}

.table-fee-input:focus {
    border-color: var(--primary-light);
    outline: none;
    box-shadow: 0 0 0 3px rgba(107, 152, 209, 0.2);
}

.settlement-detail {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px dashed #ddd;
    font-size: 0.9rem;
}

.settlement-detail:last-child {
    border-bottom: none;
}

.settlement-result {
    font-weight: bold;
    color: var(--primary-dark);
}

.settlement-positive {
    color: var(--success-color);
}

.settlement-negative {
    color: var(--accent-color);
}

.locked .player-name-input,
.locked .score-input,
.locked .score-control-btn,
.locked .table-fee-input,
.locked .btn:not(#end-session) {
    opacity: 0.7;
    pointer-events: none;
}

.final-scores {
    margin-top: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #4a6fa5 0%, #6b98d1 100%);
    border-radius: 10px;
    color: white;
}

.final-title {
    font-weight: bold;
    margin-bottom: 12px;
    text-align: center;
    font-size: 1.1rem;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.final-player {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.9rem;
}

.final-player:last-child {
    border-bottom: none;
}

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

.player-input-row {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 10px;
    gap: 10px;
    align-items: center; /* 确保输入框垂直居中 */
}

.table-score {
color: green;
}

/* 台板负分样式 */
.table-negative {
    background-color: rgba(39, 174, 96, 0.1);
    border-radius: 6px;
    border: 1px solid var(--success-color);
    font-size: 0.9rem;
}

/* 只读输入框的负分样式 */
input[readonly].negative-score {
    color: #e74c3c;
    background-color: #ffebee;
    font-weight: bold;
}

/* 负分提示文本 */
.negative-score-text {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 5px;
    font-style: italic;
}

@media (max-width: 768px) {
    .score-container {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
     .score-item {
        flex-direction: row !important;
        align-items: center;
        padding: 10px;
        min-height: auto;
        gap: 10px;
    }
    
   .player-info {
        flex-direction: row;
        justify-content: flex-start;
        width: auto;
        flex: 1;
    }
    
    .score-controls {
        width: auto;
        margin-bottom: 5px;
        justify-content: flex-end;
        flex: 0 0 auto;
    }

    .score-control-btn {
        width: 45px;
        height: 36px; /* 与移动端输入框高度一致 */
        font-size: 0.8rem;
    }
        
    .player-name-input, .score-input {
        width: 100px !important;
        height: 38px;
        margin-bottom: 0;
    }
         
    .score-label {
        margin-bottom: 8px;
    }
    
    
    .multiplier-selector {
        flex-direction: column;
    }
    
  
    .player-icon {
        width: 36px;
        height: 36px;
        font-size: 1.2rem;
        flex-shrink: 0;
    }
  
    .card-title-buttons {
        flex-direction: column;
    }

    .player-input-row {
        justify-content: center;
    }
    
    .score-item {
        align-items: center;
    }
    
}

@media (max-width: 600px) {
    h1 {
        font-size: 1.5rem;
    }
    
    .card-title h2 {
        font-size: 1.1rem;
    }
    
    .btn {
        padding: 8px 10px;
        font-size: 0.85rem;
    }
    
    .player-name-input, .score-input {
        width: 80px !important;
        height: 38px;
        font-size: 0.9rem;
    }
    
    .multiplier-btn {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    
    .score-container {
        grid-template-columns: 1fr;
    }
    
    .score-control-btn {
        width: 40px;
        height: 36px;
        font-size: 0.8rem;
    }
    
    #add-player-btn {
        width: 200px;
        height: 45px;
        font-size: 1rem;
    }
    
    .round-item, .total-column {
        min-width: 160px;
    }

    .debug-buttons-container {
        justify-content: center; /* 在小屏幕上居中 */
    }
    
    .debug-btn {
        padding: 6px 10px;
        font-size: 0.8rem;
        min-width: 60px;
    }
    
}

@media (max-width: 400px) {
    .score-container {
        grid-template-columns: 1fr;
    }
    
  .player-logo {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    
    .player-name-input, .score-input {
        width: 70px !important;
    }

    .player-input-row {
        justify-content: center; /* 水平居中 */
        flex-wrap: wrap;
    }

    .debug-buttons-container {
        gap: 5px;
    }
    
    .debug-btn {
        padding: 5px 8px;
        font-size: 0.75rem;
        min-width: 55px;
    }
    
    .debug-btn i {
        margin-right: 3px;
    }

}

/* 添加小程序码样式 */
#qrcode-container {
    transition: all 0.3s ease;
}

#qrcode-container img {
    transition: transform 0.3s ease;
}

#qrcode-container img:hover {
    transform: scale(1.05);
}

#qrcode-room-id {
    font-weight: bold;
    color: var(--primary-color);
}

/* 响应式调整 */
@media (max-width: 768px) {
    #qrcode-container {
        margin: 8px 0;
    }
    
    #dynamic-qrcode {
        width: 160px;
    }
}

@media (max-width: 480px) {
    #dynamic-qrcode {
        width: 160px;
    }
    
    #qrcode-container p {
        font-size: 0.8rem;
    }
}

.scroll-hint {
    text-align: center;
    color: #6c757d;
    margin-top: 10px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.info-text {
    color: #6c757d;
    font-size: 0.85rem;
    text-align: center;
    margin-top: 8px;
    font-style: italic;
}

.validation-error {
    color: var(--accent-color);
    font-weight: bold;
    text-align: center;
    margin-top: 12px;
    padding: 8px;
    background-color: rgba(231, 76, 60, 0.1);
    border-radius: 6px;
    border: 1px solid var(--accent-color);
    font-size: 0.9rem;
}

.validation-success {
    color: var(--success-color);
    font-weight: bold;
    text-align: center;
    margin-top: 12px;
    padding: 8px;
    background-color: rgba(39, 174, 96, 0.1);
    border-radius: 6px;
    border: 1px solid var(--success-color);
    font-size: 0.9rem;
}

/* 确保这些样式存在 */
.table-fee-section {
    margin-top: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    border: 1px solid #ddd;
}

.table-fee-title {
    font-weight: bold;
    margin-bottom: 12px;
    color: var(--primary-color);
    text-align: center;
    font-size: 1rem;
}

.table-fee-input {
    width: 120px;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    text-align: center;
    margin-bottom: 12px;
}

.settlement-details {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.settlement-detail {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px dashed #ddd;
    font-size: 0.9rem;
}

.settlement-result {
    font-weight: bold;
    color: var(--primary-dark);
}

.settlement-positive {
    color: var(--success-color);
}

.settlement-negative {
    color: var(--accent-color);
}

.validation-success {
    color: var(--success-color);
    font-weight: bold;
    text-align: center;
    margin-top: 10px;
    padding: 8px;
    background-color: rgba(39, 174, 96, 0.1);
    border-radius: 6px;
}

.validation-error {
    color: var(--accent-color);
    font-weight: bold;
    text-align: center;
    margin-top: 10px;
    padding: 8px;
    background-color: rgba(231, 76, 60, 0.1);
    border-radius: 6px;
}
/* 在现有的样式表中添加 */
#qrcode-container {
    margin: 10px 0;
    padding: 10px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

/* 响应式设计 */
@media (max-width: 480px) {
    #qrcode-container {
        max-width: 280px;
        padding: 8px;
    }
    
    #qrcode-container img {
        width: 70px !important;
        height: 70px !important;
    }
}

/* 在style.css中添加麻将牌头像样式 */
.mahjong-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4a6fa5, #3a5a8c);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    color: white;
    margin-right: 10px;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.mahjong-avatar-small {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4a6fa5, #3a5a8c);
    text-align: center;
    line-height: 20px;
    font-size: 12px;
    font-weight: bold;
    color: white;
    margin-right: 5px;
}

.mahjong-avatar-tiny {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4a6fa5, #3a5a8c);
    text-align: center;
    line-height: 16px;
    font-size: 10px;
    font-weight: bold;
    color: white;
    margin-right: 5px;
}

.player-info {
    display: flex;
    align-items: center;
}

.player-info-small {
    display: flex;
    align-items: center;
}

.player-badge {
    display: inline-flex;
    align-items: center;
    background-color: var(--primary-light);
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    margin: 3px;
    font-size: 0.85rem;
}

/* 调整分数项布局 */
.score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    text-align: center;
    border: 1px solid transparent;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .mahjong-avatar {
        width: 35px;
        height: 35px;
        font-size: 18px;
        margin-right: 8px;
    }
}

@media (max-width: 480px) {
    .mahjong-avatar {
        width: 30px;
        height: 30px;
        font-size: 16px;
        margin-right: 6px;
    }
}