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

/* body 的颜色必须走主题变量。
   原来写死 background #2c3e50 + color #ecf0f1（老调色板），
   浅色模式下继承下来就是「浅色文字配浅色底」→ 大片元素看不见。 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--c-bg-main);
    color: var(--c-text-primary);
    line-height: 1.6;
}

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

/* ========== 侧边栏内边栏 ========== */
.sidebar-tabs {
    display: flex;
    border-bottom: 2px solid var(--c-border-subtle);
    margin-bottom: 12px;
}

.sidebar-tab {
    flex: 1;
    background: none;
    border: none;
    color: var(--c-text-tertiary);
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    transition: color 0.2s, border-color 0.2s;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.sidebar-tab.active {
    color: var(--c-accent);
    border-bottom-color: var(--c-accent);
}

.sidebar-tab:hover {
    color: var(--c-text-primary);
}

.main-content {
    background: var(--c-bg-surface);
    border-radius: 8px;
    padding: 15px;
}

/* 在线玩家网格 */
.user-grid > div {
    margin-top: 0;
}

.user-card-item {
    background: var(--c-bg-surface);
    border-radius: 6px;
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.user-list, .game-list {
    margin-top: 15px;
    max-height: 400px;
    overflow-y: auto;
}

.user-list li, .game-list table {
    list-style: none;
    padding: 8px;
    border-bottom: 1px solid var(--c-border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.online-status {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
}

/* ========== 对局房间（棋盘全局样式，侧边栏见 GameRoom.vue） ========== */
.game-room {
    min-height: 0;
    flex: 1;
    overflow: hidden;
    box-sizing: border-box;
}

.board-container {
    touch-action: none;
    overscroll-behavior: none;
}

/* 棋盘刻意保持木色质感（围棋盘本来就是木色），不跟主题色走 */
#go-board {
    background: #f5deb3;
    border: 2px solid #8b5a2b;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    display: block;
    margin: 0 auto;
    max-width: 100%;
    max-height: 100%;
    flex-shrink: 0;
    touch-action: none;
    overscroll-behavior: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    tap-highlight-color: transparent;
}

/* ========== 个人中心 ========== */
.profile-layout {
    display: flex;
    gap: 40px;
    margin-top: 20px;
}

.profile-left {
    flex: 1;
}

.profile-right {
    flex: 2;
}

.avatar-large {
    border-radius: 50%;
    object-fit: cover;
}

.info-card {
    background: var(--c-bg-surface);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.info-card p {
    margin: 10px 0;
}

.user-rank {
    color: var(--c-rank-text);
    font-size: 0.9rem;
}

#profile-rank {
    font-weight: bold;
    color: var(--c-rank-text);
}

/* 用户横向卡片（旧样式兼容） */
.user-card-horizontal {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-bottom: 1px solid var(--c-border-subtle);
}

.user-avatar-small {
    border-radius: 50%;
    object-fit: cover;
}

.user-info-text {
    flex: 1;
}

.user-name {
    font-weight: bold;
}

.offline {
    color: var(--c-text-muted);
    font-size: 0.8rem;
}

/* ========== 响应式（768px = variables.scss $bp-mobile） ========== */
@media (max-width: 768px) {
    .main-content {
        overflow-y: visible;
    }
}
