* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow: auto !important;
    -webkit-overflow-scrolling: touch !important;
}

body {
    font-family: 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

/* 游戏容器禁止滚动 */
.game-container {
    overflow: hidden !important;
}

/* 模态框 */
.modal {
    overflow: auto !important;
}

.modal-content {
    max-height: 85vh !important;
    height: auto !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.header {
    background: #2c3e50;
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
}

.nav {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav button {
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
}

.nav button:hover {
    background: #2980b9;
}

.main {
    padding: 40px 0;
}

.auth-box {
    background: white;
    max-width: 400px;
    margin: 0 auto;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.auth-tabs {
    display: flex;
    margin-bottom: 20px;
}

.auth-tabs button {
    flex: 1;
    padding: 10px;
    border: none;
    background: #ecf0f1;
    cursor: pointer;
}

.auth-tabs button.active {
    background: #3498db;
    color: white;
}

.auth-box form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.auth-box input {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.auth-box button[type="submit"] {
    background: #3498db;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
}

.auth-box button[type="submit"]:hover {
    background: #2980b9;
}

.game-menu {
    text-align: center;
}

.game-menu h2 {
    margin-bottom: 40px;
    color: #2c3e50;
}

.mode-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.mode-card {
    background: white;
    padding: 40px 20px;
    border-radius: 15px;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.mode-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.mode-card h3 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #2c3e50;
}

.mode-card p {
    color: #7f8c8d;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    text-align: center;
}

.modal-content h2 {
    margin-bottom: 30px;
    color: #2c3e50;
}

.difficulty-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.difficulty {
    background: #ecf0f1;
    padding: 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.3s;
}

.difficulty:hover {
    background: #3498db;
    color: white;
}

.difficulty h3 {
    margin-bottom: 5px;
}

.room-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 20px;
}

.room-options div {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.room-options input {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    text-transform: uppercase;
}

.room-options button, .close-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
}

.room-options button:hover, .close-btn:hover {
    background: #2980b9;
}

.close-btn {
    background: #95a5a6;
}

.close-btn:hover {
    background: #7f8c8d;
}

.modal .button-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.modal .button-group button {
    flex: 1;
    padding: 12px;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    border: none;
}

.modal .button-group .close-btn {
    background: #95a5a6;
    color: white;
}

.modal .button-group .close-btn:hover {
    background: #7f8c8d;
}

.profile-modal form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.profile-modal input {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.profile-modal .button-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 5px;
}

.profile-modal button[type="submit"],
.profile-modal .close-btn {
    flex: 1;
    background: #3498db;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
}

.profile-modal .close-btn {
    background: #95a5a6;
}

.profile-modal .close-btn:hover {
    background: #7f8c8d;
}

.profile-info {
    text-align: left;
    margin-bottom: 20px;
}

.profile-info p {
    margin: 10px 0;
}

/* 所有模态框通用布局 */
.ai-modal .modal-content,
.history-modal .modal-content,
.room-modal .modal-content {
    max-width: 700px;
    width: 90%;
    margin: 0 auto;
    text-align: center;
    display: flex;
    flex-direction: column;
}

.ai-modal h2,
.history-modal h2,
.room-modal h2 {
    flex-shrink: 0;
    font-size: 24px;
}

.ai-modal .difficulty-options,
.history-list,
.room-modal .room-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.ai-modal .button-group,
.history-modal .button-group,
.room-modal .button-group {
    flex-shrink: 0;
}

/* 房间模态框字号增大 */
.room-modal label,
.room-modal select,
.room-modal input,
.room-modal button,
.room-modal .room-item p {
    font-size: 16px !important;
}

.room-modal .room-tabs button {
    font-size: 14px !important;
    padding: 12px !important;
}

.room-modal .checkbox-item label {
    font-size: 15px !important;
}

.history-item {
    padding: 8px 15px;
    border-bottom: 1px solid #ecf0f1;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    cursor: default;
    min-height: 60px;
}

.history-item:hover {
    background: #f8f9fa;
}

.history-item .game-info {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.history-item .game-info-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    align-items: flex-start;
}

.history-item .game-info-right {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.history-item .game-info p {
    margin: 0;
    font-size: 14px;
    color: #2c3e50;
    line-height: 1.4;
}

.history-item .game-info .game-title {
    font-size: 14px;
    color: #2c3e50;
}

.history-item .game-info .game-date {
    font-size: 13px;
    color: #7f8c8d;
}

.history-item .game-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-shrink: 0;
}

.view-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
    transition: background 0.3s;
}

.view-btn:hover {
    background: #2980b9;
}

.history-header {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 15px;
}

.history-header h2 {
    margin: 0;
    flex-shrink: 0;
}

.history-filter {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.filter-text {
    font-size: 14px;
    color: #7f8c8d;
    font-weight: 500;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #2c3e50;
}

.filter-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.game-stats {
    display: flex;
    gap: 15px;
    margin-top: 5px;
}

.stat-item {
    font-size: 13px;
    padding: 4px 10px;
    background: #3498db;
    color: white;
    border-radius: 12px;
    font-weight: 500;
}

.review-controls {
    display: flex;
    gap: 10px;
}

.review-controls button {
    background: #3498db;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
}

.game-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: #ecf0f1;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    transition: opacity 0.3s ease;
}

.game-container.v-enter-active,
.game-container.v-leave-active {
    transition: opacity 0.3s ease;
}

.game-container.v-enter-from,
.game-container.v-leave-to {
    opacity: 0;
}

.game-container,
.game-container[v-if="inReview"] {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: #ecf0f1;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    transition: opacity 0.3s ease;
}

.game-header {
    background: #2c3e50;
    color: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    position: relative;
}

.game-header .header-left {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 25px;
}

.game-header h2 {
    font-size: 20px;
    margin: 0;
    flex-shrink: 0;
}

.game-info-horizontal {
    display: flex;
    gap: 18px;
    align-items: center;
}

.game-info-horizontal .info-item {
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    font-size: 14px;
    white-space: nowrap;
}

.game-info-horizontal .turn-info {
    font-weight: bold;
}

.game-info-horizontal .turn-info.your-turn {
    background: #27ae60;
}

.game-info-horizontal .turn-info.waiting-turn {
    background: #95a5a6;
}

.game-header .leave-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    z-index: 10;
    white-space: nowrap;
}

.game-header .leave-btn:hover {
    background: #c0392b;
}

.game-header .game-info {
    display: flex;
    gap: 20px;
}

.game-main {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px;
    overflow: hidden;
    position: relative;
}

.region {
    display: flex;
    flex-direction: column;
}

.region-1 {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

.region-2 {
    flex: 0 0 320px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    z-index: 2;
    max-height: calc(100vh - 100px);
}

.region-3 {
    flex: 0 0 280px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    z-index: 2;
    max-height: calc(100vh - 100px);
}

.game-sidebar {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
    min-height: 0;
    padding-right: 5px;
}

.game-sidebar::-webkit-scrollbar {
    width: 6px;
}

.game-sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.game-sidebar::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.game-sidebar::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

.game-board-container {
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    position: relative;
}

.game-sidebar {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
    min-height: 0;
}

.panel-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
}

.panel-header {
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background 0.3s;
}

.panel-header:hover {
    background: #e9ecef;
}

.panel-header h3 {
    margin: 0;
    font-size: 14px;
    color: #2c3e50;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.panel-toggle {
    font-size: 12px;
    color: #7f8c8d;
    transition: transform 0.3s;
}

.panel-content {
    padding: 15px;
    border-top: 1px solid #e9ecef;
    transition: all 0.3s;
}

.status-section {
    margin-bottom: 20px;
}

.status-section:last-child {
    margin-bottom: 0;
}

.status-section h3 {
    font-size: 14px;
    color: #7f8c8d;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.turn-indicator {
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    margin-top: 8px;
}

.turn-indicator.your-turn {
    background: #27ae60;
    color: white;
}

.turn-indicator.waiting-turn {
    background: #95a5a6;
    color: white;
}

.current-turn-display {
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

.timers-vertical {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.timer-vertical {
    display: flex;
    flex-direction: column;
    padding: 12px;
    border-radius: 8px;
    background: #f8f9fa;
    transition: all 0.3s;
}

.timer-vertical.active {
    background: #3498db;
    color: white;
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.timer-vertical .timer-label {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 4px;
}

.timer-vertical .timer-value {
    font-size: 20px;
    font-weight: bold;
}

.timer-vertical .captured-info {
    font-size: 12px;
    opacity: 0.8;
    margin-top: 4px;
}

.captured-display-vertical {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.captured-item {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
}

.captured-item.black {
    background: #2c3e50;
    color: white;
}

.captured-item.white {
    background: #ecf0f1;
    color: #2c3e50;
}

.game-controls-vertical {
    background: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.game-controls-vertical h3 {
    font-size: 14px;
    color: #7f8c8d;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.game-controls-vertical select,
.game-controls-vertical button {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.game-controls-vertical select {
    border: 1px solid #ddd;
    background: white;
}

.game-controls-vertical button {
    background: #3498db;
    color: white;
}

.game-controls-vertical button:hover {
    background: #2980b9;
}

.game-controls-vertical button:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    opacity: 0.6;
}

.panel-content button {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 8px;
}

.panel-content button:last-child {
    margin-bottom: 0;
}

.panel-content button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.panel-content button:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
    box-shadow: none;
}

.move-history-panel {
    background: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 200px;
}

.move-history-panel h3 {
    font-size: 14px;
    color: #7f8c8d;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.move-history {
    flex: 1;
    overflow-y: auto;
    background: #f8f9fa;
    border-radius: 6px;
    padding: 10px;
}

.move-record {
    font-size: 12px;
    padding: 6px 8px;
    border-bottom: 1px solid #e9ecef;
    line-height: 1.5;
    word-break: break-all;
}

.move-record:last-child {
    border-bottom: none;
}

.right-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-height: 0;
}

.right-panel .move-history-panel {
    background: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    flex: 0 0 35%;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.right-panel .move-history-panel .move-history {
    flex: 1;
    overflow-y: auto;
    background: #f8f9fa;
    border-radius: 6px;
    padding: 10px;
    min-height: 0;
}

.right-panel .chat-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    min-height: 0;
}

.chat-box h3 {
    font-size: 14px;
    color: #7f8c8d;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.game-board-container.opponent-left canvas,
.game-board-container.opponent-resigned canvas {
    opacity: 0.5;
    pointer-events: none;
}

.undo-request-modal {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.6);
    z-index: 20;
}

.undo-request-content {
    background: white;
    padding: 30px 50px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.undo-request-content h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 24px;
}

.undo-request-content p {
    color: #7f8c8d;
    font-size: 16px;
    margin-bottom: 25px;
}

.undo-request-content .button-group {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.approve-btn {
    background: #27ae60;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
}

.approve-btn:hover {
    background: #219a52;
}

.reject-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
}

.reject-btn:hover {
    background: #c0392b;
}

.opponent-left-watermark {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.watermark-content {
    background: white;
    padding: 40px 60px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.watermark-content h2 {
    color: #e74c3c;
    margin-bottom: 10px;
    font-size: 32px;
}

.watermark-content p {
    color: #7f8c8d;
    font-size: 18px;
}

canvas {
    background: #dcb35c;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.chat-messages {
    flex: 1;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    max-height: calc(100% - 80px);
}

.chat-message {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    max-width: 85%;
}

.chat-message.own-message {
    flex-direction: row-reverse;
    align-self: flex-end;
}

.chat-message.system-message {
    align-self: center;
    max-width: 100%;
    justify-content: center;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #3498db;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    flex-shrink: 0;
}

.own-message .message-avatar {
    background: #27ae60;
}

.message-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.own-message .message-content {
    align-items: flex-end;
}

.system-message .message-content {
    align-items: center;
}

.message-nickname {
    font-size: 12px;
    color: #7f8c8d;
    font-weight: 500;
}

.own-message .message-nickname {
    text-align: right;
}

.message-text {
    background: white;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    word-break: break-word;
}

.own-message .message-text {
    background: #3498db;
    color: white;
}

.system-message .message-text {
    background: #95a5a6;
    color: white;
    font-size: 13px;
    padding: 6px 12px;
}

.chat-input {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
}

.chat-input input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 5px;
    height: 46px;
    min-width: 0;
    font-size: 14px;
}

.chat-input button {
    background: #3498db;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 5px;
    cursor: pointer;
    height: 46px;
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 14px;
    transition: background 0.3s;
}

.chat-input button:hover {
    background: #2980b9;
}

.room-modal .modal-content {
    max-width: 600px;
    width: 90%;
    margin: 0 auto;
}

.room-tabs {
    display: flex;
    margin-bottom: 20px;
}

.room-tabs button {
    flex: 1;
    padding: 10px;
    border: none;
    background: #ecf0f1;
    cursor: pointer;
}

.room-tabs button.active {
    background: #3498db;
    color: white;
}

.room-create-form, .room-join-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.room-create-form label {
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.room-create-form select {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    width: 100%;
}

.room-join-form input {
    padding: 14px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    width: 100%;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.room-join-form input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.room-join-form input::placeholder {
    color: #95a5a6;
}

.checkbox-group {
    display: flex;
    gap: 30px;
    justify-content: center;
    align-items: center;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-item label {
    margin: 0;
    font-weight: normal;
    cursor: pointer;
}

.room-create-form button, .room-join-form button {
    background: #3498db;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 5px;
    cursor: pointer;
}

.room-list {
    max-height: 300px;
    overflow-y: auto;
}

.room-item {
    padding: 15px;
    border-bottom: 1px solid #ecf0f1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.room-item:hover {
    background: #f8f9fa;
}

.room-item .room-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.room-item .room-info p {
    margin: 0;
    font-size: 14px;
    color: #2c3e50;
}

.room-item .room-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.room-item .join-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.room-item .join-btn:hover {
    background: #2980b9;
}

.room-item .delete-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.room-item .delete-btn:hover {
    background: #c0392b;
}

.timer-display {
    display: flex;
    gap: 30px;
    align-items: center;
}

.timer {
    font-size: 20px;
    font-weight: bold;
    padding: 8px 16px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.2);
    opacity: 0.7;
    transition: all 0.3s;
}

.timer.active {
    opacity: 1;
    background: #e74c3c;
    transform: scale(1.05);
}

.timer.black-timer.active {
    background: #2c3e50;
}

.timer.white-timer.active {
    background: #ecf0f1;
    color: #2c3e50;
}

.captured-count {
    font-size: 14px;
    font-weight: normal;
    margin-left: 8px;
    opacity: 0.9;
}

.turn-status {
    text-align: center;
    padding: 12px 20px;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s;
}

.turn-status.your-turn {
    background: #27ae60;
    color: white;
    animation: pulse 2s infinite;
}

.turn-status.waiting-turn {
    background: #95a5a6;
    color: white;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

.captured-display {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 10px 20px;
    background: #ecf0f1;
    font-size: 16px;
    font-weight: bold;
    border-bottom: 2px solid #bdc3c7;
}

/* ========================================
   移动端适配 (Mobile Responsive)
   ======================================== */

@media screen and (max-width: 768px) {
    /* 页面默认可以滚动，但游戏容器禁止 */
    html, body {
        overflow: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    /* 游戏容器禁止滚动 */
    .game-container {
        overflow: hidden !important;
    }

    /* 强制所有模态框可滚动 */
    .modal {
        overflow: auto !important;
    }

    .modal-content {
        max-height: 85vh !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
    }

    /* 基础容器和间距 */
    .container {
        padding: 0 15px;
    }

    /* 头部导航 */
    .header {
        padding: 12px 0;
    }

    .header .container {
        flex-direction: column;
        gap: 10px;
    }

    .logo {
        font-size: 20px;
    }

    .nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    .nav button {
        padding: 10px 14px;
        font-size: 14px;
    }

    /* 主内容区域 */
    .main {
        padding: 25px 0;
    }

    /* 登录/注册框 */
    .auth-box {
        padding: 25px 20px;
        max-width: 100%;
        margin: 0 10px;
    }

    /* 游戏菜单卡片 */
    .mode-cards {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .mode-card {
        padding: 30px 15px;
    }

    /* 模态框 */
    .modal-content {
        padding: 25px 20px;
        width: 95%;
        max-width: 400px;
    }

    .modal-content h2 {
        font-size: 20px;
        margin-bottom: 20px;
    }

    /* 房间模态框 */
    .room-modal .modal-content {
        max-width: 100%;
        width: 95%;
    }

    .room-tabs {
        flex-direction: column;
    }

    .room-tabs button {
        padding: 12px;
    }

    /* 房间列表 */
    .room-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .room-item .room-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .room-item .join-btn,
    .room-item .delete-btn {
        padding: 10px 16px;
        font-size: 14px;
    }

    /* 游戏界面 */
    .game-header {
        padding: 8px 12px;
        flex-direction: column;
        gap: 6px;
    }

    .game-header .header-left {
        flex-direction: column;
        align-items: center;
        gap: 6px;
        width: 100%;
    }

    .game-header h2 {
        font-size: 16px;
        margin: 0;
    }

    .game-info-horizontal {
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
    }

    .game-info-horizontal .info-item {
        font-size: 11px;
        padding: 4px 8px;
    }

    .game-header .leave-btn {
        width: 100%;
        max-width: 180px;
        padding: 8px 16px;
        font-size: 14px;
        margin-top: 10px;
        align-self: center;
    }

    .game-main {
        flex-direction: column;
        padding: 8px;
        gap: 8px;
        height: 100vh;
        overflow: hidden;
    }

    .region {
        width: 100%;
    }

    .region-1 {
        position: static;
        transform: none;
        order: 1;
        flex: 0 0 auto;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .region-2 {
        order: 2;
        flex: 1 1 auto;
        width: 100%;
        min-height: 0;
        overflow-y: auto;
    }

    .region-3 {
        order: 3;
        flex: 0 0 auto;
        width: 100%;
        max-height: 200px;
        overflow-y: auto;
    }

    /* 棋盘容器 */
    .game-board-container {
        width: 100%;
        max-width: 100vw;
        padding: 0;
    }

    /* 棋盘自适应 */
    .game-board-container canvas {
        max-width: 100%;
        height: auto;
        width: auto;
        max-height: 50vh;
    }

    /* 按钮和交互元素 - 增大点击区域 */
    button,
    input,
    select {
        min-height: 44px;
        min-width: 44px;
    }

    /* 游戏控制按钮 */
    .game-controls-vertical button,
    .game-controls-vertical select {
        padding: 14px;
        font-size: 15px;
    }

    /* 聊天输入 */
    .chat-input {
        flex-direction: row;
    }

    .chat-input input {
        min-width: 0;
    }

    .chat-input button {
        padding: 10px 20px;
        flex-shrink: 0;
    }

    /* 历史记录 */
    .history-modal .modal-content {
        max-width: 100%;
        width: 95%;
    }

    .history-item {
        flex-direction: row;
        align-items: center;
        gap: 10px;
        padding: 10px 12px;
        min-height: auto;
    }

    .history-item .game-info {
        flex-direction: row;
        gap: 10px;
    }

    .history-item .game-info-left {
        gap: 2px;
    }

    .history-item .game-info p {
        font-size: 13px;
    }

    .history-item .game-info .game-title {
        font-size: 13px;
    }

    .history-item .game-info .game-date {
        font-size: 12px;
    }

    .game-stats {
        gap: 6px;
    }

    .stat-item {
        font-size: 11px;
        padding: 3px 8px;
    }

    .view-btn {
        padding: 6px 14px;
        font-size: 13px;
    }

    .history-filter {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    /* 复盘界面 */
    .review-controls {
        flex-wrap: wrap;
        justify-content: center;
    }

    .review-controls button {
        padding: 10px 12px;
        font-size: 14px;
    }

    /* 竖屏时房间模态框优化 */
    .room-modal .modal-content {
        max-width: 95%;
        max-height: 85vh;
        padding: 20px;
        overflow-y: auto;
    }

    .room-modal h2 {
        font-size: 18px;
        margin-bottom: 15px;
    }

    .room-tabs {
        margin-bottom: 15px;
    }

    .room-tabs button {
        padding: 8px;
        font-size: 13px;
    }

    .room-create-form, .room-join-form {
        gap: 12px;
        margin-bottom: 15px;
    }

    .room-create-form label {
        font-size: 14px;
        margin-bottom: 5px;
    }

    .room-create-form select {
        padding: 10px;
        font-size: 14px;
    }

    .room-join-form input {
        padding: 12px;
        font-size: 14px;
    }

    .checkbox-group {
        gap: 15px;
        flex-wrap: wrap;
    }

    .checkbox-item label {
        font-size: 13px;
    }

    .room-create-form button, .room-join-form button {
        padding: 12px;
        font-size: 14px;
    }

    .room-list {
        max-height: 35vh;
        overflow-y: auto;
    }

    .room-item {
        padding: 12px;
    }

    .room-item p {
        font-size: 13px;
    }

    .room-item button {
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* 小屏手机 (320px - 480px) */
@media screen and (max-width: 480px) {
    .logo {
        font-size: 18px;
    }

    .mode-card h3 {
        font-size: 20px;
    }

    .modal-content {
        padding: 20px 15px;
    }

    .auth-box {
        padding: 20px 15px;
    }

    .game-info-horizontal .info-item {
        font-size: 12px;
        padding: 4px 8px;
    }

    canvas {
        max-width: 100%;
        height: auto;
    }
}

/* 横屏模式优化 - 仅针对移动端 */
@media screen and (max-width: 1024px) and (orientation: landscape) {
    /* 后台管理页面允许滚动 */
    html.admin-page,
    body.admin-page {
        overflow: auto !important;
    }

    /* 游戏容器禁止滚动 */
    .game-container {
        overflow: hidden !important;
    }
    
    /* 首页菜单界面允许纵向滚动 */
    .main {
        overflow-y: auto !important;
        height: calc(100vh - 60px) !important;
    }
    
    /* 确保body在非游戏界面时允许滚动 */
    body:not(.admin-page) {
        overflow-y: auto !important;
    }

    .game-main {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        padding: 5px !important;
        gap: 5px !important;
        overflow: hidden !important;
        height: calc(100vh - 60px) !important;
    }

    .region-1 {
        order: 1 !important;
        flex: 1 1 auto !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        min-width: 0 !important;
        overflow: visible !important;
        height: 100% !important;
        }

    .region-2 {
        order: 2 !important;
        flex: 0 0 180px !important;
        width: 180px !important;
        overflow-y: auto !important;
        max-height: calc(100vh - 60px) !important;
        }

    .region-3 {
        order: 3 !important;
        flex: 0 0 180px !important;
        width: 180px !important;
        overflow: hidden !important;
        height: calc(100vh - 60px) !important;
        max-height: calc(100vh - 60px) !important;
        }

    .game-header {
        padding: 8px 15px !important;
    }

    .game-header h2 {
        font-size: 16px !important;
    }

    .game-info-horizontal .info-item {
        font-size: 12px !important;
        padding: 4px 8px !important;
    }

    .game-header .leave-btn {
        padding: 8px 15px !important;
        font-size: 14px !important;
        max-width: 120px !important;
        z-index: 10 !important;
        white-space: nowrap !important;
    }

    /* 棋盘在横屏时更大一些 */
    .game-board-container {
        width: 100% !important;
        padding: 0 !important;
    }

    .game-board-container {
        overflow: visible !important;
        height: auto !important;
        width: 100% !important;
    }

    .game-board-container canvas {
        max-height: none !important;
        max-width: none !important;
        width: auto !important;
        height: auto !important;
        display: block !important;
        }

    /* 游戏控制侧边栏优化 */
    .game-sidebar {
        gap: 8px;
    }

    .game-status-panel {
        padding: 10px;
    }

    .game-status-panel h3 {
        font-size: 12px;
        margin-bottom: 8px;
    }

    .timer-vertical {
        padding: 8px;
    }

    .timer-vertical .timer-label {
        font-size: 11px;
    }

    .timer-vertical .timer-value {
        font-size: 16px;
    }

    .timer-vertical .captured-info {
        font-size: 10px;
    }

    .game-controls-vertical {
        padding: 10px;
    }

    .game-controls-vertical h3 {
        font-size: 12px;
        margin-bottom: 8px;
    }

    .game-controls-vertical button,
    .game-controls-vertical select {
        padding: 8px;
        font-size: 12px;
        min-height: 36px;
    }

    /* 右侧面板优化 */
    .right-panel {
        gap: 8px;
        height: 100%;
        display: flex;
        flex-direction: column;
        }

    .move-history-panel {
        padding: 10px;
        flex: 0 0 40%;
        min-height: 0;
        overflow: hidden;
        }

    .chat-box {
        padding: 10px;
        flex: 0 0 60%;
        min-height: 0;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        }

    .move-history-panel h3,
    .chat-box h3 {
        font-size: 12px;
        margin-bottom: 8px;
        }

    .move-history {
        padding: 8px;
        flex: 1;
        overflow-y: auto;
        min-height: 0;
        }

    .move-record {
        font-size: 11px;
        padding: 4px 6px;
        }

    .chat-messages {
        padding: 8px;
        margin-bottom: 8px;
        flex: 1;
        overflow-y: auto;
        min-height: 0;
        }

    .chat-input {
        gap: 6px;
    }

    .chat-input input {
        padding: 8px 10px;
        height: 36px;
        font-size: 12px;
    }

    .chat-input button {
        padding: 8px 14px;
        height: 36px;
        font-size: 12px;
    }

    /* 强制横屏时所有模态框都可滚动 */
    .modal {
        overflow: auto !important;
    }

    .modal-content {
        max-height: 85vh !important;
        height: auto !important;
        overflow-y: auto !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    /* 横屏时房间模态框优化 */
    .room-modal .modal-content {
        max-width: 400px !important;
        width: 40% !important;
        max-height: 85vh !important;
        height: auto !important;
        padding: 10px 15px !important;
        overflow-y: auto !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        display: block !important;
        }

    .room-modal h2 {
        font-size: 15px !important;
        margin-bottom: 8px !important;
    }

    .room-tabs {
        margin-bottom: 8px !important;
        flex-shrink: 0;
    }

    .room-tabs button {
        padding: 5px !important;
        font-size: 11px !important;
    }

    .room-create-form, .room-join-form {
        gap: 6px !important;
        margin-bottom: 8px !important;
        flex-shrink: 0;
    }

    .room-create-form label {
        font-size: 11px !important;
        margin-bottom: 2px !important;
    }

    .room-create-form select {
        padding: 5px !important;
        font-size: 11px !important;
        min-height: 30px !important;
    }

    .room-join-form input {
        padding: 6px 8px !important;
        font-size: 11px !important;
        min-height: 30px !important;
    }

    .checkbox-group {
        gap: 8px !important;
        flex-wrap: wrap !important;
    }

    .checkbox-item {
        gap: 4px !important;
    }

    .checkbox-item label {
        font-size: 9px !important;
    }

    .checkbox-item input[type="checkbox"] {
        width: 12px !important;
        height: 12px !important;
    }

    .room-create-form button, .room-join-form button {
        padding: 6px !important;
        font-size: 11px !important;
        min-height: 32px !important;
    }

    .room-list {
        max-height: 25vh !important;
        overflow-y: auto !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .room-item {
        padding: 6px !important;
    }

    .room-item p {
        font-size: 10px !important;
    }

    .room-item button {
        padding: 3px 6px !important;
        font-size: 9px !important;
        min-height: 28px !important;
    }

    .room-modal .button-group {
        margin-top: 8px !important;
        flex-shrink: 0;
    }

    .room-modal .button-group button {
        padding: 6px !important;
        font-size: 11px !important;
        min-height: 32px !important;
    }



    /* 历史记录模态框横屏优化 */
    .history-modal .modal-content {
        max-width: 500px !important;
        width: 40% !important;
        max-height: 75vh !important;
        height: auto !important;
        overflow: hidden !important;
        padding: 15px !important;
        display: flex !important;
        flex-direction: column !important;
        }

    .history-header {
        gap: 8px !important;
        margin-bottom: 10px !important;
    }

    .history-header h2 {
        flex-shrink: 0 !important;
        margin-bottom: 0 !important;
        font-size: 18px !important;
        }

    .history-filter {
        padding: 8px 10px !important;
        gap: 8px !important;
    }

    .filter-text {
        font-size: 12px !important;
    }

    .filter-checkbox {
        font-size: 12px !important;
    }

    .filter-checkbox input[type="checkbox"] {
        width: 14px !important;
        height: 14px !important;
    }

    .history-list {
        flex: 1 !important;
        min-height: 0 !important;
        overflow-y: auto !important;
        margin-bottom: 10px !important;
        }

    .history-item {
        padding: 5px 10px !important;
        gap: 10px !important;
        min-height: 50px !important;
    }

    .history-item .game-info {
        gap: 10px !important;
    }

    .history-item .game-info-left {
        gap: 1px !important;
        align-items: flex-start !important;
    }

    .history-item .game-info p {
        font-size: 11px !important;
        line-height: 1.3 !important;
    }

    .history-item .game-info .game-title {
        font-size: 11px !important;
    }

    .history-item .game-info .game-date {
        font-size: 10px !important;
    }

    .game-stats {
        gap: 8px !important;
        margin-top: 3px !important;
    }

    .stat-item {
        font-size: 11px !important;
        padding: 3px 8px !important;
    }

    .view-btn {
        padding: 5px 12px !important;
        font-size: 12px !important;
    }

    .history-modal .button-group {
        flex-shrink: 0 !important;
        margin-top: 0 !important;
        }

    /* 横屏时AI菜单模态框优化 */
    .ai-modal .modal-content {
        max-width: 450px !important;
        width: 35% !important;
        max-height: 75vh !important;
        height: auto !important;
        overflow: hidden !important;
        padding: 15px !important;
        display: flex !important;
        flex-direction: column !important;
        }

    .ai-modal h2 {
        flex-shrink: 0 !important;
        margin-bottom: 10px !important;
        }

    .ai-modal .difficulty-options {
        flex: 1 !important;
        min-height: 0 !important;
        overflow-y: auto !important;
        margin-bottom: 10px !important;
        max-height: none !important;
        }

    .ai-modal .button-group {
        flex-shrink: 0 !important;
        margin-top: 0 !important;
        }

    .difficulty {
        padding: 8px !important;
        flex-shrink: 0;
    }

    .difficulty h3 {
        font-size: 13px !important;
    }

    .difficulty p {
        font-size: 10px !important;
    }
}
}

.profile-tabs {
    display: flex;
    margin-bottom: 20px;
    gap: 10px;
}

.profile-tabs button {
    flex: 1;
    padding: 12px;
    border: none;
    background: #ecf0f1;
    cursor: pointer;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
}

.profile-tabs button.active {
    background: #3498db;
    color: white;
}

.achievement-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.achievement-stat-item {
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.achievement-stat-item .stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #3498db;
    display: block;
}

.achievement-stat-item .stat-label {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

.achievement-filter {
    margin-bottom: 15px;
}

.achievement-filter select {
    width: 100%;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
}

.achievement-list {
    max-height: 400px;
    overflow-y: auto;
}

.achievement-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-bottom: 1px solid #e2e8f0;
    transition: background 0.2s;
    opacity: 0.5;
}

.achievement-item.unlocked {
    opacity: 1;
    background: #f0fff4;
}

.achievement-item:hover {
    background: #f7fafc;
}

.achievement-icon {
    font-size: 32px;
    min-width: 40px;
    text-align: center;
}

.achievement-info {
    flex: 1;
}

.achievement-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    color: #2c3e50;
}

.achievement-desc {
    font-size: 12px;
    color: #666;
}

.achievement-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 4px;
    transition: width 0.3s;
}

.progress-text {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
}

.achievement-points {
    font-weight: bold;
    color: #f39c12;
    font-size: 14px;
    min-width: 50px;
    text-align: right;
}

@media (max-width: 768px) {
    .achievement-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 好友和排行榜样式 */
.social-modal .modal-content,
.ranking-modal .modal-content {
    max-width: 800px;
    width: 95%;
}

.social-tabs,
.ranking-tabs {
    display: flex;
    margin-bottom: 20px;
    gap: 10px;
}

.social-tabs button,
.ranking-tabs button {
    flex: 1;
    padding: 12px;
    border: none;
    background: #ecf0f1;
    cursor: pointer;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
}

.social-tabs button.active,
.ranking-tabs button.active {
    background: #3498db;
    color: white;
}

.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-box input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

.search-box button {
    padding: 12px 24px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.search-box button:hover {
    background: #2980b9;
}

.friend-list,
.search-results,
.request-list,
.ranking-list {
    max-height: 400px;
    overflow-y: auto;
}

.friend-item,
.search-item,
.request-item,
.ranking-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-bottom: 1px solid #ecf0f1;
    transition: background 0.2s;
}

.friend-item:hover,
.search-item:hover,
.request-item:hover,
.ranking-item:hover {
    background: #f8f9fa;
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
}

.user-stats {
    font-size: 12px;
    color: #7f8c8d;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.user-stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

.user-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.user-actions button {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-add-friend {
    background: #27ae60;
    color: white;
}

.btn-add-friend:hover {
    background: #219a52;
}

.btn-remove-friend {
    background: #e74c3c;
    color: white;
}

.btn-remove-friend:hover {
    background: #c0392b;
}

.btn-accept {
    background: #27ae60;
    color: white;
}

.btn-accept:hover {
    background: #219a52;
}

.btn-reject {
    background: #e74c3c;
    color: white;
}

.btn-reject:hover {
    background: #c0392b;
}

.btn-cancel {
    background: #95a5a6;
    color: white;
}

.btn-cancel:hover {
    background: #7f8c8d;
}

.request-message {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
    font-style: italic;
}

.rank-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    flex-shrink: 0;
}

.rank-1 {
    background: linear-gradient(135deg, #ffd700, #ffb700);
    color: white;
}

.rank-2 {
    background: linear-gradient(135deg, #c0c0c0, #a0a0a0);
    color: white;
}

.rank-3 {
    background: linear-gradient(135deg, #cd7f32, #a0522d);
    color: white;
}

.rank-other {
    background: #ecf0f1;
    color: #7f8c8d;
}

.my-rank-card {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.my-rank-card .user-avatar {
    background: rgba(255,255,255,0.3);
}

.my-rank-card .user-name {
    color: white;
}

.my-rank-card .user-stats {
    color: rgba(255,255,255,0.8);
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #7f8c8d;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

@media (max-width: 768px) {
    .friend-item,
    .search-item,
    .request-item,
    .ranking-item {
        flex-wrap: wrap;
    }
    
    .user-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .social-tabs,
    .ranking-tabs {
        flex-wrap: wrap;
    }
}
