/* 全局样式 */
:root {
    --primary-color: #007aff;
    --success-color: #34c759;
    --danger-color: #ff3b30;
    --warning-color: #ff9500;
    --text-color: #000;
    --text-secondary: #8e8e93;
    --background-color: #f2f2f7;
    --card-background: #fff;
    --border-color: #d1d1d6;
    --modal-background: rgba(0, 0, 0, 0.5);
    --highlight-background: #f2f2f7;
    --active-background: rgba(0, 122, 255, 0.1);
    --shadow-color: rgba(0, 0, 0, 0.1);
    --transition-time: 0.3s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.5;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

input, button, select, textarea {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    outline: none;
}

input[type="number"] {
    -moz-appearance: textfield;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

button {
    cursor: pointer;
    border: none;
    background: none;
}

/* 页面容器和标题栏样式更新 */
#app {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.page-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    padding-bottom: 20px;
}

.page {
    display: none;
    padding: 0;
    height: 100%;
}

.page.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* 标题样式 */
.page-title {
    padding: 20px 16px 10px;
    border-bottom: 1px solid var(--border-color);
}

.page-title h1 {
    font-size: 22px;
    font-weight: 600;
}

/* 标题栏美化 */
.header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: linear-gradient(135deg, #0F2027 0%, #203A43 50%, #2C5364 100%);
    color: white;
    padding: 16px;
    border-bottom: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    margin: 0 6px;
    margin-bottom: 8px;
    overflow: hidden;
    position: relative;
}

/* 添加光晕效果 */
.header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 60%);
    opacity: 0.5;
    pointer-events: none;
}

/* 左下角装饰 - 已移除 */
.game-info::after {
    display: none;
}

.game-info {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, auto);
    grid-gap: 16px;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.info-item {
    display: flex;
    flex-direction: column;
}

/* 修改游戏信息样式，适应桌球主题 */
.info-item .label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 4px;
    font-weight: 500;
    white-space: nowrap;
}

.info-item .value {
    font-size: 18px;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.info-input {
    background: none;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    padding: 4px 0;
    width: 80px;
    text-align: left;
    font-size: 18px;
    font-weight: 600;
    color: white;
}

.info-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.action-buttons {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}

#settle-button, #end-game-btn {
    min-width: 90px;
}

/* 玩家列表 */
.player-list-container {
    background-color: var(--card-background);
    margin: 0 12px 16px;
    border-radius: 12px;
    box-shadow: 0 2px 5px var(--shadow-color);
    overflow: hidden;
    max-height: calc(100vh - 250px); /* 设置最大高度，减去顶部和底部空间 */
    display: flex;
    flex-direction: column;
}

.list-header {
    display: flex;
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 500;
    font-size: 14px;
    color: var(--text-secondary);
    background-color: var(--highlight-background);
    min-width: 500px; /* 确保最小宽度，支持横向滚动 */
}

.list-body {
    padding: 0;
    overflow-y: auto; /* 添加滚动条 */
    overflow-x: auto; /* 添加横向滚动 */
    flex: 1;
}

.player-row {
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid var(--border-color);
    min-width: 500px; /* 确保最小宽度，支持横向滚动 */
    cursor: pointer;
    transition: background-color var(--transition-time);
}

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

.col {
    padding: 0 4px;
    font-size: 14px; /* 减小字体大小 */
}

.col.nickname {
    width: 30%; /* 昵称列占30% */
    font-weight: 500;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.col.hands {
    width: 20%; /* 手数列占20% */
    text-align: center;
    white-space: nowrap; /* 防止文字换行 */
    overflow: hidden;
    text-overflow: ellipsis;
}

.col.balance {
    width: 15%; /* 结余列占15% */
    text-align: center;
    white-space: nowrap; /* 防止文字换行 */
    overflow: hidden;
    text-overflow: ellipsis;
}

.col.actions {
    width: 20%; /* 操作列占20% */
    text-align: right;
}

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

.negative {
    color: var(--danger-color);
}

.balance-input {
    width: 60px;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 4px;
}

.hand-control {
    display: flex;
    align-items: center;
    justify-content: center;
}

.hand-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: var(--highlight-background);
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--transition-time);
}

.hand-btn:active {
    background-color: var(--active-background);
}

.hand-value {
    margin: 0 8px;
    min-width: 24px;
    text-align: center;
}

.exit-btn {
    padding: 6px 12px; /* 增大内边距，让按钮更容易点击 */
    border-radius: 4px;
    background-color: var(--highlight-background);
    color: var(--text-color);
    font-size: 12px; /* 增大字体 */
    transition: background-color var(--transition-time);
    white-space: nowrap; /* 防止文字换行 */
    min-width: 45px; /* 增大最小宽度 */
}

.exit-btn:active {
    background-color: var(--active-background);
}

.balance-summary {
    background-color: var(--card-background);
    margin: 16px 12px;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 2px 5px var(--shadow-color);
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.summary-item .label {
    font-weight: 500;
}

/* 统计页样式 */
.game-history {
    padding: 16px 12px;
}

.history-card {
    background-color: var(--card-background);
    margin-bottom: 16px;
    border-radius: 12px;
    box-shadow: 0 2px 5px var(--shadow-color);
    overflow: hidden;
}

.history-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-title {
    font-weight: 600;
}

.history-date {
    color: var(--text-secondary);
    font-size: 14px;
}

.history-summary {
    padding: 16px;
    display: flex;
    justify-content: space-between;
}

.history-summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.history-summary-item .label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.history-summary-item .value {
    font-weight: 500;
}

.history-action {
    padding: 12px 16px;
    text-align: center;
    border-top: 1px solid var(--border-color);
    color: var(--primary-color);
    font-weight: 500;
}

/* 设置页样式 */
.settings-section {
    background-color: var(--card-background);
    margin: 16px 12px;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 2px 5px var(--shadow-color);
}

/* 结账页样式 */
.checkout-section {
    padding: 16px 12px;
}

/* 房间费信息样式 */
.room-fee-section {
    background-color: var(--card-background);
    margin-bottom: 16px;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 2px 5px var(--shadow-color);
}

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

.room-fee-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background-color: #f5f5f5 !important;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.room-fee-item .label {
    font-size: 14px;
    color: var(--text-color);
    font-weight: 500;
    text-align: center;
}

.payer-additional {
    font-size: 14px;
    font-weight: 600;
    margin-left: 4px;
}

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

.payer-additional.negative {
    color: var(--danger-color);
}

.room-fee-item .value {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    text-align: center;
    padding: 4px 8px;
    background-color: white;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.payer-selection {
    display: flex;
    align-items: center;
    gap: 8px;
}

.selected-payer {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: #f5f5f5 !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 36px;
}

.selected-payer .placeholder {
    color: var(--text-secondary);
    font-size: 14px;
}

.selected-payer .payer-name {
    font-size: 14px;
    font-weight: 500;
}

.selected-payer .payer-profit {
    font-size: 12px;
    margin-left: 8px;
}

.select-payer-btn {
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.payer-details {
    background-color: var(--highlight-background);
    padding: 12px;
    border-radius: 8px;
    margin-top: 8px;
}

.payer-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.payer-info .label {
    font-size: 14px;
    color: var(--text-secondary);
}

.payer-info .value {
    font-size: 16px;
    font-weight: 600;
}

.payer-info .value.positive {
    color: var(--success-color);
}

.payer-info .value.negative {
    color: var(--danger-color);
}

/* 玩家输赢样式 */
.player-profit-section {
    background-color: var(--card-background);
    margin-bottom: 16px;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 2px 5px var(--shadow-color);
}

.profit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.profit-header h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.profit-columns {
    display: flex;
    gap: 16px;
}

.profit-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.column-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
    padding: 8px;
    background-color: var(--highlight-background);
    border-radius: 6px;
    border-bottom: 2px solid var(--border-color);
}

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

.profit-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background-color: var(--highlight-background);
    border-radius: 6px;
    cursor: pointer;
    transition: background-color var(--transition-time);
}

.profit-item:hover {
    background-color: var(--hover-background);
}

.profit-item.selected {
    background-color: var(--primary-color);
    color: white;
}

.profit-item .player-name {
    font-size: 14px;
    font-weight: 500;
}

.profit-item .player-profit {
    font-size: 14px;
    font-weight: 600;
}

.profit-item .player-profit.positive {
    color: var(--success-color);
}

.profit-item .player-profit.negative {
    color: var(--danger-color);
}

.profit-item .player-profit.zero {
    color: var(--text-secondary);
}

.profit-item.selected .player-profit.positive,
.profit-item.selected .player-profit.negative,
.profit-item.selected .player-profit.zero {
    color: white;
}

/* 转账提示样式 */
.transfer-note {
    font-size: 11px;
    padding: 4px 8px;
    margin: 2px 0;
    background-color: var(--highlight-background);
    border-radius: 4px;
    color: var(--text-secondary);
    animation: fadeIn 0.3s ease;
}

.transfer-note.outflow {
    border-left: 3px solid var(--danger-color);
}

.transfer-note.inflow {
    border-left: 3px solid var(--success-color);
}

.transfer-note .transfer-direction {
    font-weight: 600;
    margin-right: 4px;
}

.transfer-note.outflow .transfer-direction {
    color: var(--danger-color);
}

.transfer-note.inflow .transfer-direction {
    color: var(--success-color);
}

.transfer-note .transfer-from {
    color: var(--danger-color);
    font-weight: 500;
}

.transfer-note .transfer-to {
    color: var(--success-color);
    font-weight: 500;
}

.transfer-note .transfer-amount {
    color: var(--danger-color);
    font-weight: 600;
    margin-left: 8px;
    background-color: white;
    padding: 1px 4px;
    border-radius: 2px;
    font-size: 10px;
}

/* 确保profit-item有相对定位 */
.profit-item {
    position: relative;
}

/* 支付者选择选项样式 */
.payer-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.payer-option {
    padding: 12px;
    background-color: var(--highlight-background);
    border-radius: 6px;
    cursor: pointer;
    transition: background-color var(--transition-time);
    border: 1px solid var(--border-color);
}

.payer-option:hover {
    background-color: var(--active-background);
}

.payer-option:active {
    background-color: var(--primary-color);
    color: white;
}

/* 转账方案样式 */
.transfer-section {
    background-color: var(--card-background);
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 2px 5px var(--shadow-color);
}

.transfer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.transfer-header h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.auto-match-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color var(--transition-time);
}

.auto-match-btn:hover {
    background-color: var(--primary-hover);
}

.auto-match-btn:disabled {
    background-color: var(--text-secondary);
    cursor: not-allowed;
}

.transfer-plan {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.transfer-plan p {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
}

.transfer-step {
    background-color: var(--highlight-background);
    padding: 12px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.transfer-step h4 {
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
}

.transfer-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
}

.transfer-amount {
    font-weight: 500;
}

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

.transfer-amount.negative {
    color: var(--danger-color);
}

.transfer-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
}

.transfer-arrow .from-player {
    color: var(--danger-color);
}

.transfer-arrow .arrow {
    color: var(--primary-color);
    font-weight: 600;
}

.transfer-arrow .to-player {
    color: var(--success-color);
}

/* 转账关系图样式 */
.flow-diagram {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 16px;
    background-color: var(--highlight-background);
    border-radius: 8px;
    position: relative;
}

.flow-diagram::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 100%;
    background: linear-gradient(180deg, var(--danger-color) 0%, var(--primary-color) 50%, var(--success-color) 100%);
    transform: translateX(-50%);
    z-index: 1;
}

.profit-column, .loss-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profit-column h4, .loss-column h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 8px;
    padding: 8px;
    background-color: var(--card-background);
    border-radius: 6px;
    border-bottom: 2px solid var(--border-color);
}

.profit-item, .loss-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background-color: var(--card-background);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
}

.profit-item .player-name, .loss-item .player-name {
    font-weight: 500;
}

.profit-item .profit, .loss-item .profit {
    font-weight: 600;
}

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

.loss-item .profit.negative {
    color: var(--danger-color);
}

.room-fee-item {
    background-color: var(--highlight-background) !important;
    color: var(--text-color) !important;
    border: none !important;
    box-shadow: none !important;
}

.room-fee-item .profit {
    color: var(--success-color) !important;
}

.room-fee-item .player-name {
    color: var(--danger-color) !important;
}

.transfer-arrow-line {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin: 12px 0;
    padding: 8px;
}

.arrow-line {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    position: relative;
    z-index: 2;
}

.arrow-line::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--danger-color) 0%, var(--primary-color) 50%, var(--success-color) 100%);
    transform: translateY(-50%);
    z-index: 1;
    border-radius: 1px;
}

/* 创建连线效果 */
.transfer-arrow-line::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 25%;
    right: 25%;
    height: 1px;
    background: var(--primary-color);
    transform: translateY(-50%);
    z-index: 1;
    box-shadow: 0 0 4px rgba(0, 123, 255, 0.3);
}

.arrow-line .from {
    color: var(--danger-color);
    background-color: var(--card-background);
    padding: 2px 6px;
    border-radius: 4px;
    position: relative;
    z-index: 2;
}

.arrow-line .arrow-symbol {
    color: var(--primary-color);
    font-weight: 600;
    background-color: var(--card-background);
    padding: 2px 4px;
    border-radius: 4px;
    position: relative;
    z-index: 2;
}

/* 创建箭头效果 */
.arrow-line .arrow-symbol::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -6px;
    width: 0;
    height: 0;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-right: 6px solid var(--primary-color);
    transform: translateY(-50%);
}

.arrow-line .arrow-symbol::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -6px;
    width: 0;
    height: 0;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-left: 6px solid var(--success-color);
    transform: translateY(-50%);
}

.arrow-line .to {
    color: var(--success-color);
    background-color: var(--card-background);
    padding: 2px 6px;
    border-radius: 4px;
    position: relative;
    z-index: 2;
}

.arrow-amount {
    font-size: 12px;
    font-weight: 600;
    color: var(--danger-color);
    background-color: var(--highlight-background);
    padding: 2px 6px;
    border-radius: 4px;
    position: relative;
    z-index: 2;
}

/* 支付者选择模态框样式 */
.payer-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.payer-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background-color: var(--highlight-background);
    border-radius: 8px;
    cursor: pointer;
    transition: background-color var(--transition-time);
}

.payer-item:hover {
    background-color: var(--hover-background);
}

.payer-item.selected {
    background-color: var(--primary-color);
    color: white;
}

.payer-item .payer-name {
    font-size: 14px;
    font-weight: 500;
}

.payer-item .payer-profit {
    font-size: 14px;
    font-weight: 600;
}

.payer-item .payer-profit.positive {
    color: var(--success-color);
}

.payer-item .payer-profit.negative {
    color: var(--danger-color);
}

.payer-item.selected .payer-profit.positive,
.payer-item.selected .payer-profit.negative {
    color: white;
}

.settings-section h2 {
    font-size: 18px;
    margin-bottom: 16px;
    font-weight: 600;
}

.setting-item {
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.setting-item label {
    font-weight: 500;
}

.setting-item input {
    width: 100px;
    text-align: right;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 8px;
}

.player-search {
    display: flex;
    margin-bottom: 16px;
    align-items: center;
}

.player-search input {
    flex: 1;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
    background-color: var(--highlight-background);
}

.settings-player-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.settings-player-item {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.player-name {
    font-weight: 500;
}

.player-stats {
    color: var(--text-secondary);
    font-size: 14px;
}

.player-actions {
    display: flex;
}

.player-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    background-color: var(--highlight-background);
    transition: background-color var(--transition-time);
}

.player-action-btn:active {
    background-color: var(--active-background);
}

/* 顶部导航栏 */
.top-tab-bar {
    display: flex;
    height: 56px;
    background-color: var(--card-background);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 10px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-tab-bar .tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: color var(--transition-time);
    padding: 8px 0;
}

.top-tab-bar .tab svg {
    margin-bottom: 4px;
    stroke-width: 1.5;
}

.top-tab-bar .tab.active {
    color: var(--primary-color);
}

.top-tab-bar .tab span {
    font-size: 12px;
    font-weight: 500;
}

/* 移除底部导航栏样式，取消注释恢复为顶部导航栏 */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background-color: var(--card-background);
    display: flex;
    border-top: 1px solid var(--border-color);
    max-width: 500px;
    margin: 0 auto;
    z-index: 100;
}

.tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: color var(--transition-time);
    padding: 8px 0;
}

.tab svg {
    margin-bottom: 4px;
    stroke-width: 1.5;
}

.tab.active {
    color: var(--primary-color);
}

.tab span {
    font-size: 12px;
    font-weight: 500;
}

/* 按钮样式 */
.primary-button {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
    transition: opacity var(--transition-time);
}

.primary-button:active {
    opacity: 0.8;
}

.secondary-button {
    background-color: var(--highlight-background);
    color: var(--text-color);
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 500;
    transition: background-color var(--transition-time);
    display: flex;
    align-items: center;
    justify-content: center;
}

.secondary-button svg {
    margin-right: 6px;
}

.secondary-button:active {
    background-color: var(--active-background);
}

.icon-button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--highlight-background);
    color: var(--primary-color);
    transition: background-color var(--transition-time);
}

.icon-button:active {
    background-color: var(--active-background);
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--modal-background);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: var(--card-background);
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease;
}

.wide-modal {
    max-width: 600px;
}

.modal-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.close-modal {
    font-size: 24px;
    color: var(--text-secondary);
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color var(--transition-time);
}

.close-modal:active {
    background-color: var(--highlight-background);
}

.modal-body {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.selectable-player-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 16px;
}

.selectable-player-item {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
}

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

.selectable-player-item.selected {
    background-color: var(--active-background);
}

.player-checkbox {
    margin-right: 12px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-checkbox.checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.player-checkbox.checked::after {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: white;
}

/* 表单样式 */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
}

.radio-group {
    display: flex;
    gap: 16px;
}

.radio-group label {
    display: flex;
    align-items: center;
    margin-bottom: 0;
    cursor: pointer;
}

.radio-group input {
    margin-right: 8px;
    width: auto;
}

/* 游戏详情 */
.game-details {
    margin-bottom: 20px;
}

.detail-row {
    display: flex;
    margin-bottom: 12px;
}

.detail-item {
    flex: 1;
}

.player-detail-list {
    margin-top: 16px;
    margin-bottom: 16px;
}



.game-log {
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

.game-log h3 {
    margin-bottom: 12px;
    font-size: 16px;
    font-weight: 600;
}

.log-list {
    max-height: 200px;
    overflow-y: auto;
}

.log-item {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.log-item:last-child {
    border-bottom: none;
}

.log-time {
    color: var(--text-secondary);
    font-size: 12px;
    margin-right: 8px;
}

/* 玩家统计 */
.player-stats-header {
    margin-bottom: 20px;
}

.player-stats-header h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
}

.stats-summary {
    display: flex;
    justify-content: space-between;
    background-color: var(--highlight-background);
    padding: 16px;
    border-radius: 8px;
}

.stats-games-list {
    margin-top: 16px;
}

.stats-games-list h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

.history-games-container {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    grid-gap: 12px;
    max-height: 400px;
    overflow-y: auto;
}

.history-game-card {
    background-color: var(--card-background);
    border-radius: 8px;
    box-shadow: 0 2px 5px var(--shadow-color);
    padding: 12px;
    display: flex;
    flex-direction: column;
}

.game-card-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.game-card-title {
    font-weight: 600;
}

.game-card-date {
    color: var(--text-secondary);
    font-size: 13px;
}

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

.game-card-item {
    display: flex;
    justify-content: space-between;
}

.game-card-label {
    color: var(--text-secondary);
    font-size: 13px;
}

.game-card-value {
    font-weight: 600;
}

@media (min-width: 480px) {
    .history-games-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 吐司提示 */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 1001;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    max-width: 80%;
    text-align: center;
}

.toast.show {
    opacity: 1;
}

/* 动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* 媒体查询 */
@media (max-width: 360px) {
    .game-info {
        grid-template-columns: 1fr;
    }
    
    .col.nickname {
        width: 30%; /* 小屏幕昵称列占30% */
        font-size: 12px; /* 进一步减小字体 */
    }
    
    .col.hands {
        width: 20%; /* 小屏幕手数列占20% */
    }
    
    .col.balance {
        width: 15%; /* 小屏幕结余列占15% */
    }
    
    .col.actions {
        width: 20%; /* 小屏幕操作列占20% */
    }
    
    .player-details {
        flex-direction: column;
        gap: 8px;
    }
    
    .detail-item {
        justify-content: space-between;
    }
    
    /* 小屏幕设备上的退场按钮优化 */
    .exit-btn {
        padding: 4px 8px; /* 增大内边距，让按钮更容易点击 */
        font-size: 11px; /* 增大字体 */
        min-width: 35px; /* 增大最小宽度 */
    }
}

@media (min-width: 768px) {
    body {
        background-color: #e0e0e0;
    }
    
    #app {
        margin: 20px auto;
        height: calc(100vh - 40px);
        border-radius: 16px;
        overflow: hidden;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    }
} 

/* 添加info-row样式 */
.info-row {
    display: flex;
    justify-content: space-between;
    margin-top: 16px;
}

.info-row .info-item {
    flex: 1;
}

/* 玩家部分标题 */
.player-section {
    margin-top: 16px;
}

.player-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    margin-bottom: 12px;
}

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

.checkout-button {
    background-color: var(--success-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color var(--transition-time);
}

.checkout-button:hover {
    background-color: #2db84d;
}

.checkout-button:active {
    background-color: #28a745;
}

.section-title {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-color);
    margin-right: 8px;
}

/* 结算模态框样式 */
.formula-display {
    background-color: var(--highlight-background);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.formula-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    padding: 4px 0;
}

.formula-row:last-child {
    margin-bottom: 0;
}

.formula-label {
    font-weight: 500;
}

.formula-result {
    border-top: 1px solid var(--border-color);
    margin-top: 8px;
    padding-top: 12px;
    font-weight: 600;
} 

/* 借出手数红点样式 */
.borrowed-indicator {
    display: inline-flex;
    margin-left: 6px;
}

.borrowed-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--danger-color);
    margin-right: 2px;
}

/* 输赢列样式调整 - 已移除，现在在子项中显示 */ 

/* 已退场玩家样式 */
.player-row.exited {
    background-color: rgba(0, 0, 0, 0.03);
}

.status {
    color: var(--text-secondary);
    font-size: 12px;
}

.return-btn {
    padding: 4px 8px;
    border-radius: 4px;
    background-color: var(--highlight-background);
    color: var(--primary-color);
    font-size: 12px;
    transition: background-color var(--transition-time);
}

.return-btn:active {
    background-color: var(--active-background);
} 

/* 修改输赢列样式 */
.positive {
    color: var(--success-color);
    font-weight: 600;
}

.negative {
    color: var(--danger-color);
    font-weight: 600;
} 

/* 设置页面区块标题样式 */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* 危险按钮样式 */
.danger-button {
    background-color: var(--danger-color);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
    border: none;
}

.danger-button:active {
    background-color: #d93025;
}

/* 可展开玩家行样式 */
.player-row:hover {
    background-color: var(--highlight-background);
}

.player-row.expanded {
    background-color: var(--active-background);
}

.player-row.expanded .player-details {
    display: flex;
    animation: slideDown 0.3s ease;
}

.player-details {
    display: none;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background-color: var(--highlight-background);
    border-top: 1px solid var(--border-color);
    margin-top: 8px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-label {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 14px;
}

.detail-value {
    font-weight: 600;
    font-size: 14px;
}

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

.detail-value.negative {
    color: var(--danger-color);
}

/* 展开动画 */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 玩家主行样式 */

/* 玩家主行样式 */
.player-main-row {
    display: flex;
    padding: 12px;
    align-items: center;
    width: 100%;
} 