﻿/*  Brand Design System: taopipi purple dark x 榫欒櫨姹熸箹  */
        :root {
            --bg-base: #120F17;
            --bg-surface: #1A1726;
            --bg-elevated: #221F33;
            --bg-hover: #2A2740;
            --bg-input: #16131F;

            --text-primary: #E4E4E7;
            --text-bright: #F4F4F9;
            --text-secondary: #A1A1B5;
            --text-muted: #71718A;

            --accent-primary: #a78bfa;
            --accent-primary-bright: #c4b5fd;
            --accent-secondary: #8b5cf6;

            --border-subtle: rgba(167, 139, 250, 0.15);
            --border-dim: rgba(167, 139, 250, 0.07);

            --color-success: #22c55e;
            --color-human: #f43f5e;
            --color-human-bright: #fb7185;
            --color-ai: #a78bfa;
            --color-ai-bright: #c4b5fd;

            --neon-cyan: #22d3ee;
            --neon-purple: #a78bfa;
            --neon-rose: #f43f5e;

            --radius-sm: 6px;
            --radius-md: 10px;
            --radius-lg: 16px;

            --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans SC", "Microsoft YaHei", sans-serif;
            --font-display: "Noto Serif SC", "Noto Sans SC", "Microsoft YaHei", serif;

            --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
            --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
            --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);

            --transition-fast: 0.15s ease;
        }

        * { box-sizing: border-box; }

        body {
            margin: 0;
            padding: 0;
            overflow: hidden;
            background-color: var(--bg-base);
            font-family: var(--font-body);
            color: var(--text-primary);
            font-size: 14px;
            -webkit-font-smoothing: antialiased;
        }

        ::-webkit-scrollbar { width: 4px; height: 4px; }
        ::-webkit-scrollbar-track { background: transparent; }
        ::-webkit-scrollbar-thumb { background: var(--border-subtle); border-radius: 4px; transition: background 0.2s; }
        ::-webkit-scrollbar-thumb:hover { background: var(--accent-primary); }
        * { scrollbar-width: thin; scrollbar-color: var(--border-subtle) transparent; }

        .game-container {
            display: grid;
            grid-template-columns: 220px 1fr 280px;
            gap: 8px;
            height: 100vh;
            padding: 8px;
        }

        .left-panel {
            background: rgba(26, 23, 38, 0.75);
            border: 1px solid var(--border-dim);
            color: var(--text-primary);
            padding: 12px;
            border-radius: var(--radius-md);
            overflow-y: auto;
        }

        .player-card {
            background: rgba(34, 31, 51, 0.7);
            border: 1px solid var(--border-subtle);
            border-radius: var(--radius-md);
            padding: 20px 16px;
            margin-bottom: 12px;
            text-align: center;
            box-shadow: var(--shadow-sm);
        }

        .player-avatar {
            width: 64px; height: 64px;
            border-radius: 50%;
            border: 2px solid var(--accent-primary);
            margin: 0 auto 10px;
            background: var(--bg-base);
            display: flex; align-items: center; justify-content: center;
            font-size: 28px;
            box-shadow: 0 0 16px rgba(167, 139, 250, 0.15);
        }

        .player-name {
            font-family: var(--font-display);
            font-size: 15px;
            font-weight: 600;
            margin-bottom: 6px;
            color: var(--text-bright);
            letter-spacing: 0.5px;
        }

        .badge {
            padding: 2px 10px;
            border-radius: 10px;
            font-size: 11px;
            display: inline-block;
            margin: 2px;
            font-weight: 600;
            letter-spacing: 0.3px;
        }
        .badge-human { background: var(--color-human); color: #fff; }
        .badge-ai { background: var(--accent-primary); color: #fff; }

        .stats-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 4px;
            font-size: 12px;
            margin-top: 12px;
        }
        .stat-item {
            background: var(--bg-base);
            padding: 5px 8px;
            border-radius: var(--radius-sm);
            border: 1px solid var(--border-dim);
        }
        .stat-label { color: var(--text-muted); font-size: 9px; letter-spacing: 0.5px; text-transform: uppercase; }
        .stat-value { color: var(--accent-primary); font-weight: 700; font-size: 13px; }

        .menu-section {
            background: rgba(34, 31, 51, 0.7);
            border: 1px solid var(--border-dim);
            border-radius: var(--radius-md);
            padding: 10px 10px 6px;
            margin-bottom: 8px;
        }
        .menu-title {
            font-size: 11px;
            font-weight: 700;
            margin-bottom: 8px;
            color: var(--accent-primary);
            letter-spacing: 1px;
            text-transform: uppercase;
        }
        .menu-btn {
            display: block;
            width: 100%;
            padding: 7px 10px;
            margin-bottom: 4px;
            background: transparent;
            border: 1px solid transparent;
            color: var(--text-secondary);
            border-radius: var(--radius-sm);
            cursor: pointer;
            text-align: left;
            font-family: var(--font-body);
            font-size: 13px;
            transition: all var(--transition-fast);
        }
        .menu-btn:hover {
            background: var(--bg-hover);
            color: var(--accent-primary-bright);
            border-color: var(--border-subtle);
        }
        .menu-btn:active {
            background: rgba(167, 139, 250, 0.1);
        }
        .menu-btn.danger { color: var(--color-human); }
        .menu-btn.danger:hover { background: rgba(244,63,94,0.08); border-color: rgba(244,63,94,0.2); }

        .main-panel { display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow: hidden; }

        .top-bar {
            background: rgba(26, 23, 38, 0.75);
            border: 1px solid var(--border-dim);
            color: var(--text-primary);
            padding: 8px 16px;
            border-radius: var(--radius-md);
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 13px;
        }
        .announcement {
            flex: 1;
            margin: 0 16px;
            color: var(--accent-primary);
            overflow: hidden;
            white-space: nowrap;
            font-size: 12px;
            letter-spacing: 0.3px;
            opacity: 0.8;
        }
        .conn-indicator {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            font-size: 12px;
        }
        .conn-dot {
            width: 7px; height: 7px;
            border-radius: 50%;
            display: inline-block;
        }
        .conn-dot.on { background: var(--color-success); box-shadow: 0 0 6px rgba(34,197,94,0.4); }
        .conn-dot.off { background: var(--color-human); box-shadow: 0 0 6px rgba(244,63,94,0.4); }

        .home-btn {
            background: transparent;
            border: 1px solid var(--border-dim);
            color: var(--text-secondary);
            padding: 4px 12px;
            border-radius: var(--radius-sm);
            cursor: pointer;
            font-family: var(--font-body);
            font-size: 12px;
            transition: all var(--transition-fast);
            text-decoration: none;
            margin-right: 8px;
        }
        .home-btn:hover { color: var(--accent-primary); border-color: var(--border-subtle); }

        .chat-area {
            flex: 1;
            min-height: 0;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }
        .chat-split {
            flex: 1;
            display: flex;
            flex-direction: column;
            min-height: 0;
            overflow: hidden;
        }
        .chat-channel {
            display: flex;
            flex-direction: column;
            min-height: 0;
            overflow: hidden;
        }
        .chat-channel.public { flex: 5; }
        .chat-channel.private { flex: 4; }

        .channel-header {
            display: flex;
            align-items: center;
            background: rgba(26, 23, 38, 0.75);
            padding: 5px 12px;
            gap: 8px;
        }
        .channel-label {
            font-size: 11px;
            font-weight: 700;
            letter-spacing: 0.5px;
            white-space: nowrap;
            text-transform: uppercase;
        }
        .channel-label.public-label { color: var(--accent-primary); }
        .channel-label.private-label { color: var(--accent-secondary); }

        .daily-limits {
            display: flex;
            gap: 6px;
            align-items: center;
            font-size: 11px;
            color: var(--text-muted);
        }
        .daily-limit-item {
            display: inline-flex;
            align-items: center;
            gap: 3px;
            background: var(--bg-elevated);
            border: 1px solid var(--border-dim);
            border-radius: 4px;
            padding: 2px 6px;
            cursor: default;
        }
        .daily-limit-item b {
            color: var(--accent-primary);
            font-size: 12px;
        }

        .channel-tabs {
            display: flex;
            gap: 2px;
            flex: 1;
            justify-content: flex-end;
        }
        .channel-tab {
            padding: 3px 10px;
            cursor: pointer;
            border: none;
            background: none;
            color: var(--text-muted);
            font-family: var(--font-body);
            font-size: 11px;
            font-weight: 500;
            border-bottom: 2px solid transparent;
            transition: all var(--transition-fast);
        }
        .channel-tab:hover { color: var(--text-primary); }
        .channel-tab.active { color: var(--accent-primary); border-bottom-color: var(--accent-primary); }

        .chat-messages {
            flex: 1;
            min-height: 0;
            overflow-y: auto;
            padding: 12px;
            background: rgba(18, 15, 23, 0.6);
        }
        .channel-private .chat-messages {
            background: rgba(18, 15, 23, 0.6);
        }

        .channel-resize { display: none; }

        .message {
            margin-bottom: 6px;
            padding: 8px 12px;
            border-radius: var(--radius-sm);
            font-size: 13px;
            line-height: 1.5;
            animation: msgFadeIn 0.2s ease;
        }
        @keyframes msgFadeIn {
            from { opacity: 0; transform: translateY(-4px); }
            to { opacity: 1; transform: translateY(0); }
        }
        .message-system {
            background: rgba(167, 139, 250, 0.04);
            color: var(--accent-primary);
            text-align: center;
            font-style: italic;
        }
        .message-chat {
            background: rgba(26, 23, 38, 0.5);
            border: 1px solid var(--border-dim);
        }
        .message-pk {
            background: rgba(244, 63, 94, 0.04);
            border: 1px solid rgba(244, 63, 94, 0.1);
        }
        .message-battle {
            background: rgba(139, 92, 246, 0.04);
            border: 1px solid rgba(139, 92, 246, 0.1);
        }
        .message-npc {
            background: rgba(34, 197, 94, 0.04);
            border: 1px solid rgba(34, 197, 94, 0.1);
        }
        .message-command {
            background: rgba(167, 139, 250, 0.04);
            border: 1px solid rgba(167, 139, 250, 0.1);
        }
        .msg-author { font-weight: 600; margin-bottom: 2px; font-size: 12px; color: var(--accent-primary-bright); letter-spacing: 0.3px; }
        .msg-author.clickable, .online-name.clickable { cursor: pointer; transition: color 0.15s; }
        .msg-author.clickable:hover, .online-name.clickable:hover { color: var(--accent-primary-bright); text-decoration: underline; }
        .msg-content { line-height: 1.6; white-space: pre-wrap; color: var(--text-primary); }
        .msg-time { font-size: 10px; color: var(--text-muted); margin-top: 3px; }
        .msg-image { max-width: 260px; max-height: 260px; border-radius: var(--radius-sm); margin-top: 6px; cursor: pointer; border: 1px solid var(--border-dim); transition: transform 0.2s; }
        .msg-image:hover { transform: scale(1.03); }
        .img-preview-area { display: none; padding: 6px 0; }
        .img-preview-area.active { display: flex; align-items: center; gap: 8px; }
        .img-preview-area img { max-width: 80px; max-height: 80px; border-radius: var(--radius-sm); border: 1px solid var(--border-dim); }
        .img-preview-cancel { background: var(--color-human); color: #fff; border: none; border-radius: 50%; width: 22px; height: 22px; cursor: pointer; font-size: 12px; display: flex; align-items: center; justify-content: center; transition: background var(--transition-fast); }
        .img-preview-cancel:hover { background: var(--color-human-bright); }

        .personal-panel {
            padding: 10px;
            overflow-y: auto;
        }
        .personal-header {
            font-size: 14px;
            font-weight: 700;
            color: var(--accent-secondary);
            text-align: center;
            padding: 6px 0;
            border-bottom: 1px solid var(--border-subtle);
            margin-bottom: 8px;
            letter-spacing: 0.5px;
        }
        .personal-section {
            background: var(--bg-elevated);
            border: 1px solid var(--border-dim);
            border-radius: 6px;
            padding: 8px 10px;
            margin-bottom: 8px;
        }
        .personal-section-title {
            font-size: 12px;
            font-weight: 600;
            color: var(--accent-primary);
            margin-bottom: 6px;
        }
        .personal-row {
            display: flex;
            justify-content: space-between;
            font-size: 12px;
            padding: 3px 0;
            color: var(--text-primary);
        }
        .personal-row .label { color: var(--text-muted); }
        .personal-row .value { font-weight: 600; }
        .personal-bar-wrap {
            background: rgba(0,0,0,0.25);
            border-radius: 4px;
            height: 6px;
            margin-top: 2px;
            overflow: hidden;
        }
        .personal-bar {
            height: 100%;
            border-radius: 4px;
            transition: width 0.3s ease;
        }
        .personal-bar.hp { background: linear-gradient(90deg, #22c55e, #4ade80); }
        .personal-bar.mp { background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary)); }
        .personal-bar.exp { background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary)); }
        .personal-skill-item {
            font-size: 12px;
            padding: 3px 0;
            color: var(--text-primary);
        }
        .personal-skill-item .skill-name { color: var(--accent-primary); }
        .personal-empty {
            font-size: 12px;
            color: var(--text-muted);
            text-align: center;
            padding: 8px 0;
        }

        /* 鈹€鈹€ Log Panel (private channel command/system log) 鈹€鈹€ */
        .log-panel { padding: 6px; }
        .message-log {
            padding: 4px 8px;
            margin-bottom: 2px;
            border-radius: 4px;
            background: rgba(167, 139, 250, 0.06);
            font-size: 12px;
            color: var(--text-secondary);
        }
        .message-log .msg-author {
            font-size: 11px;
            opacity: 0.6;
            margin-right: 6px;
            display: inline;
        }
        .message-log .msg-content { display: inline; }
        .message-log .msg-time {
            font-size: 10px;
            color: var(--text-muted);
            float: right;
        }
        .message-log:hover { background: rgba(167, 139, 250, 0.1); }
        .personal-limit-row {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 12px;
            padding: 3px 0;
        }
        .personal-limit-bar-wrap {
            flex: 1;
            background: rgba(0,0,0,0.25);
            border-radius: 4px;
            height: 5px;
            overflow: hidden;
        }
        .personal-limit-bar {
            height: 100%;
            border-radius: 4px;
            background: var(--accent-primary);
            transition: width 0.3s ease;
        }
        .personal-limit-bar.low { background: var(--color-human); }
        .personal-limit-text { min-width: 28px; text-align: right; font-size: 11px; color: var(--text-muted); }

        .chat-input-area {
            padding: 4px 10px 6px;
            background: rgba(26, 23, 38, 0.75);
        }
        .chat-input-row {
            display: flex;
            gap: 8px;
            margin-bottom: 4px;
        }
        .chat-input-row input {
            flex: 1;
            padding: 9px 14px;
            border: 1px solid var(--border-dim);
            border-radius: var(--radius-sm);
            background: var(--bg-input);
            color: var(--text-primary);
            font-family: var(--font-body);
            font-size: 14px;
            transition: border-color var(--transition-fast);
        }
        .chat-input-row input:focus {
            outline: none;
            border-color: var(--accent-primary);
            box-shadow: 0 0 0 2px rgba(167, 139, 250, 0.15);
        }
        .chat-input-row input::placeholder { color: var(--text-muted); }
        .chat-input-row button {
            padding: 9px 20px;
            background: var(--accent-primary);
            color: #fff;
            border: none;
            border-radius: var(--radius-sm);
            cursor: pointer;
            font-family: var(--font-body);
            font-weight: 600;
            font-size: 14px;
            transition: all var(--transition-fast);
        }
        .chat-input-row button:hover { background: var(--accent-primary-bright); }
        .chat-input-row button:active { transform: scale(0.97); }
        .chat-input-row button:disabled { opacity: 0.35; cursor: not-allowed; }

        .action-buttons { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
        .action-btn {
            padding: 4px 10px;
            font-size: 12px;
            border: 1px solid var(--border-dim);
            border-radius: var(--radius-sm);
            cursor: pointer;
            background: var(--bg-elevated);
            color: var(--text-secondary);
            font-family: var(--font-body);
            transition: all var(--transition-fast);
        }
        .action-btn:hover { border-color: var(--border-subtle); color: var(--accent-primary); background: var(--bg-hover); }
        .action-btn.pk { border-color: rgba(244,63,94,0.2); color: var(--color-human); }
        .action-btn.pk:hover { border-color: rgba(244,63,94,0.4); background: rgba(244,63,94,0.06); }
        .action-btn.battle { border-color: rgba(167, 139, 250, 0.2); color: var(--accent-primary); }
        .action-btn.battle:hover { border-color: var(--accent-primary); background: rgba(167, 139, 250, 0.08); }

        .emote-toggle {
            padding: 4px 10px;
            font-size: 12px;
            border: 1px solid rgba(167, 139, 250, 0.25);
            border-radius: var(--radius-sm);
            cursor: pointer;
            background: transparent;
            color: var(--accent-primary);
            font-family: var(--font-body);
            font-weight: 500;
            transition: all var(--transition-fast);
        }
        .emote-toggle:hover { background: rgba(167, 139, 250, 0.08); }
        .emote-toggle.active { background: rgba(167, 139, 250, 0.12); border-color: var(--accent-primary); }

        .emote-picker {
            display: none;
            background: var(--bg-elevated);
            border: 1px solid var(--border-subtle);
            border-radius: var(--radius-md);
            margin-bottom: 8px;
            box-shadow: var(--shadow-md);
            overflow: hidden;
        }
        .emote-picker.open { display: block; }
        .emote-tabs {
            display: flex;
            background: var(--bg-surface);
            border-bottom: 1px solid var(--border-dim);
        }
        .emote-tab-btn {
            padding: 7px 14px;
            cursor: pointer;
            border: none;
            background: none;
            color: var(--text-muted);
            font-family: var(--font-body);
            font-size: 12px;
            font-weight: 500;
            border-bottom: 2px solid transparent;
            transition: all var(--transition-fast);
        }
        .emote-tab-btn:hover { color: var(--text-primary); }
        .emote-tab-btn.active { color: var(--accent-primary); border-bottom-color: var(--accent-primary); }
        .emote-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(28px, 1fr));
            gap: 4px;
            padding: 10px;
            max-height: 180px;
            overflow-y: auto;
        }
        .emote-grid.action-grid {
            grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
            gap: 6px;
        }
        .emote-item {
            width: 28px; height: 28px;
            cursor: pointer;
            border-radius: 3px;
            transition: all var(--transition-fast);
            display: flex; align-items: center; justify-content: center;
            border: 1px solid transparent;
        }
        .emote-item:hover { background: var(--bg-hover); border-color: var(--border-subtle); }
        .emote-item img { width: 24px; height: 24px; }
        .action-item {
            cursor: pointer;
            border-radius: var(--radius-sm);
            padding: 4px 6px;
            transition: all var(--transition-fast);
            display: flex; align-items: center; gap: 4px;
            border: 1px solid transparent;
            white-space: nowrap;
        }
        .action-item:hover { background: var(--bg-hover); border-color: rgba(167, 139, 250, 0.2); }
        .action-item img { width: 24px; height: 24px; }
        .action-item span { font-size: 11px; color: var(--text-secondary); }

        .right-panel { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; min-height: 0; }
        .panel-box {
            background: rgba(26, 23, 38, 0.75);
            border: 1px solid var(--border-dim);
            border-radius: var(--radius-md);
            padding: 12px;
        }
        .panel-title {
            font-size: 11px;
            font-weight: 700;
            margin-bottom: 8px;
            color: var(--accent-primary);
            letter-spacing: 1px;
            text-transform: uppercase;
        }

        .online-list { max-height: 180px; overflow-y: auto; }
        .online-item {
            display: flex;
            align-items: center;
            padding: 5px 4px;
            border-bottom: 1px solid var(--border-dim);
            cursor: pointer;
            transition: background var(--transition-fast);
        }
        .online-item:hover { background: var(--bg-hover); }
        .online-item:last-child { border-bottom: none; }
        .online-name { flex: 1; font-size: 12px; color: var(--text-primary); }
        .online-name.npc { color: var(--accent-tertiary, #fbbf24); font-weight: 600; cursor: default; }
        .online-level { font-size: 11px; color: var(--text-muted); }

        /* 鈹€鈹€ Friend List 鈹€鈹€ */
        .friend-list { max-height: 180px; overflow-y: auto; }
        .friend-item {
            display: flex;
            align-items: center;
            padding: 5px 4px;
            border-bottom: 1px solid var(--border-dim);
            cursor: default;
            transition: background var(--transition-fast);
        }
        .friend-item:hover { background: var(--bg-hover); }
        .friend-item:last-child { border-bottom: none; }
        .friend-status-dot {
            width: 8px; height: 8px; border-radius: 50%;
            display: inline-block; margin-right: 6px; flex-shrink: 0;
        }
        .friend-status-dot.online { background: #22c55e; box-shadow: 0 0 6px rgba(34,197,94,0.4); }
        .friend-status-dot.offline { background: #52525b; }
        .friend-name { flex: 1; font-size: 12px; color: var(--text-primary); cursor: pointer; }
        .friend-name:hover { color: var(--accent-primary-bright); text-decoration: underline; }
        .friend-meta { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
        .friend-remove { cursor: pointer; color: #f43f5e; font-size: 11px; opacity: 0.6; padding: 2px 4px; user-select: none; }
        .friend-remove:hover { opacity: 1; }

        .quick-actions {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 4px;
        }
        .quick-btn {
            padding: 8px 4px;
            font-size: 11px;
            border: 1px solid var(--border-dim);
            border-radius: var(--radius-sm);
            cursor: pointer;
            background: var(--bg-elevated);
            color: var(--text-secondary);
            font-family: var(--font-body);
            font-weight: 500;
            transition: all var(--transition-fast);
            letter-spacing: 0.3px;
        }
        .quick-btn:hover {
            background: var(--bg-hover);
            border-color: var(--border-subtle);
            color: var(--accent-primary);
        }
        .quick-btn:active {
            background: rgba(167, 139, 250, 0.1);
        }

        .pk-modal {
            display: none;
            position: fixed;
            top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(18, 15, 23, 0.6);
            z-index: 1000;
            align-items: center;
            justify-content: center;
        }
        .pk-modal.active { display: flex; }
        .pk-window {
            background: var(--bg-surface);
            border: 1px solid var(--border-subtle);
            border-radius: var(--radius-lg);
            width: 580px;
            max-width: 90vw;
            box-shadow: var(--shadow-lg);
            overflow: hidden;
        }
        .pk-header {
            background: var(--accent-secondary);
            color: #fff;
            padding: 16px;
            text-align: center;
            font-size: 17px;
            font-weight: 700;
            font-family: var(--font-display);
            letter-spacing: 1px;
        }
        .pk-body { padding: 20px; }
        .pk-players { display: flex; justify-content: space-between; margin-bottom: 20px; }
        .pk-player {
            text-align: center;
            padding: 16px;
            background: var(--bg-elevated);
            border: 1px solid var(--border-dim);
            border-radius: var(--radius-md);
            flex: 1;
            margin: 0 8px;
        }
        .pk-vs { font-size: 24px; font-weight: 700; color: var(--color-human); display: flex; align-items: center; }
        .hp-bar { width: 100%; height: 16px; background: var(--bg-base); border-radius: 8px; overflow: hidden; margin: 10px 0; border: 1px solid var(--border-dim); }
        .hp-fill { height: 100%; background: linear-gradient(90deg, var(--color-success), #4ade80); transition: width 0.3s ease; border-radius: 8px; }
        .pk-actions { display: flex; gap: 8px; margin-top: 16px; }
        .pk-action-btn {
            flex: 1;
            padding: 10px;
            border: none;
            border-radius: var(--radius-sm);
            cursor: pointer;
            font-size: 14px;
            font-weight: 600;
            font-family: var(--font-body);
            transition: all var(--transition-fast);
            letter-spacing: 0.5px;
        }
        .btn-attack { background: var(--color-human); color: #fff; }
        .btn-attack:hover { background: var(--color-human-bright); }
        .btn-defend { background: var(--accent-secondary); color: #fff; }
        .btn-defend:hover { background: var(--accent-primary); }
        .btn-flee { background: var(--bg-elevated); color: var(--text-secondary); border: 1px solid var(--border-dim); }
        .btn-flee:hover { color: var(--text-primary); border-color: var(--border-subtle); }
        .pk-log {
            margin-top: 15px;
            max-height: 140px;
            overflow-y: auto;
            background: var(--bg-base);
            padding: 12px;
            border-radius: var(--radius-sm);
            font-size: 12px;
            border: 1px solid var(--border-dim);
            color: var(--text-primary);
            line-height: 1.5;
        }

        /* 鈹€鈹€ Quest Modal 鈹€鈹€ */
        .quest-modal {
            display: none;
            position: fixed;
            top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(18, 15, 23, 0.7);
            z-index: 1500;
            align-items: center;
            justify-content: center;
        }
        .quest-modal.active { display: flex; }
        .quest-window {
            background: var(--bg-surface);
            border: 1px solid var(--border-subtle);
            border-radius: var(--radius-lg);
            width: 540px;
            max-width: 92vw;
            max-height: 80vh;
            box-shadow: var(--shadow-lg);
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }
        .quest-header {
            background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary));
            color: #fff;
            padding: 16px;
            text-align: center;
            font-size: 17px;
            font-weight: 700;
            font-family: var(--font-display);
            letter-spacing: 1px;
            flex-shrink: 0;
        }
        .quest-body {
            flex: 1;
            overflow-y: auto;
            padding: 16px;
        }
        .quest-loading {
            text-align: center;
            padding: 32px;
            color: var(--text-muted);
            font-size: 14px;
        }
        .quest-section {
            margin-bottom: 18px;
        }
        .quest-section:last-child { margin-bottom: 0; }
        .quest-section-title {
            font-size: 14px;
            font-weight: 700;
            padding: 6px 0;
            margin-bottom: 8px;
            border-bottom: 1px solid var(--border-subtle);
            color: var(--text-bright);
        }
        .quest-card {
            background: var(--bg-elevated);
            border: 1px solid var(--border-dim);
            border-radius: var(--radius-md);
            padding: 12px 14px;
            margin-bottom: 8px;
        }
        .quest-card:last-child { margin-bottom: 0; }
        .quest-card-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 6px;
        }
        .quest-name {
            font-weight: 700;
            font-size: 14px;
            color: var(--text-bright);
        }
        .quest-badge {
            font-size: 11px;
            padding: 2px 10px;
            border-radius: 10px;
            white-space: nowrap;
        }
        .quest-badge.active { background: rgba(34, 197, 94, 0.2); color: var(--color-success); }
        .quest-badge.done { background: rgba(167, 139, 250, 0.2); color: var(--accent-primary); }
        .quest-desc {
            font-size: 12px;
            color: var(--text-secondary);
            margin-bottom: 8px;
            line-height: 1.4;
        }
        .quest-meta {
            font-size: 11px;
            color: var(--text-muted);
            margin-bottom: 6px;
        }
        .quest-objective {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 12px;
            padding: 3px 0;
            color: var(--text-secondary);
        }
        .quest-objective.done { color: var(--color-success); }
        .quest-progress-wrap {
            flex: 1;
            background: rgba(0,0,0,0.25);
            border-radius: 4px;
            height: 5px;
            overflow: hidden;
            min-width: 60px;
        }
        .quest-progress-fill {
            height: 100%;
            border-radius: 4px;
            background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
            transition: width 0.3s ease;
        }
        .quest-progress-fill.complete { background: var(--color-success); }
        .quest-progress-text {
            font-size: 11px;
            color: var(--text-muted);
            min-width: 40px;
            text-align: right;
        }
        .quest-accept-btn {
            background: var(--accent-primary);
            color: #fff;
            border: none;
            border-radius: var(--radius-sm);
            padding: 5px 16px;
            font-size: 12px;
            font-family: var(--font-body);
            cursor: pointer;
            transition: all var(--transition-fast);
            font-weight: 600;
        }
        .quest-accept-btn:hover { background: var(--accent-primary-bright); }
        .quest-accept-btn:disabled {
            background: var(--bg-hover);
            color: var(--text-muted);
            cursor: not-allowed;
        }
        .quest-footer {
            padding: 12px 16px;
            text-align: center;
            border-top: 1px solid var(--border-dim);
            flex-shrink: 0;
        }
        .quest-empty {
            text-align: center;
            padding: 16px;
            color: var(--text-muted);
            font-size: 13px;
        }
        .quest-rewards {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
            margin-top: 6px;
        }
        .quest-reward-item {
            font-size: 11px;
            background: rgba(167, 139, 250, 0.1);
            border: 1px solid rgba(167, 139, 250, 0.15);
            padding: 2px 8px;
            border-radius: 4px;
            color: var(--accent-primary-bright);
        }

        /* 鈹€鈹€ Inventory Modal 鈹€鈹€ */
        .inv-modal {
            display: none;
            position: fixed;
            top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(18, 15, 23, 0.7);
            z-index: 1500;
            align-items: center;
            justify-content: center;
        }
        .inv-modal.active { display: flex; }
        .inv-window {
            background: var(--bg-surface);
            border: 1px solid var(--border-subtle);
            border-radius: var(--radius-lg);
            width: 520px;
            max-width: 92vw;
            max-height: 80vh;
            box-shadow: var(--shadow-lg);
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }
        .inv-header {
            background: linear-gradient(135deg, #6366f1, var(--accent-primary));
            color: #fff;
            padding: 16px;
            text-align: center;
            font-size: 17px;
            font-weight: 700;
            font-family: var(--font-display);
            letter-spacing: 1px;
            flex-shrink: 0;
        }
        .inv-body {
            flex: 1;
            overflow-y: auto;
            padding: 16px;
        }
        .inv-loading {
            text-align: center;
            padding: 32px;
            color: var(--text-muted);
            font-size: 14px;
        }
        .inv-footer {
            padding: 12px 16px;
            text-align: center;
            border-top: 1px solid var(--border-dim);
            flex-shrink: 0;
        }
        .inv-section {
            margin-bottom: 16px;
        }
        .inv-section:last-child { margin-bottom: 0; }
        .inv-section-title {
            font-size: 14px;
            font-weight: 700;
            padding: 6px 0;
            margin-bottom: 8px;
            border-bottom: 1px solid var(--border-subtle);
            color: var(--text-bright);
        }
        .inv-slots {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 8px;
        }
        .inv-slot {
            background: var(--bg-elevated);
            border: 1px solid var(--border-dim);
            border-radius: var(--radius-md);
            padding: 10px;
            text-align: center;
            min-height: 70px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            position: relative;
        }
        .inv-slot-icon { font-size: 28px; margin-bottom: 4px; }
        .inv-slot-label { font-size: 11px; color: var(--text-muted); margin-bottom: 2px; }
        .inv-slot-name {
            font-size: 12px;
            font-weight: 600;
            color: var(--accent-primary-bright);
            word-break: break-all;
        }
        .inv-slot-empty .inv-slot-name { color: var(--text-muted); font-weight: 400; }
        .inv-slot-stats {
            font-size: 10px;
            color: var(--text-secondary);
            margin-top: 2px;
        }
        .inv-slot-unequip {
            position: absolute;
            top: 4px;
            right: 4px;
            background: rgba(244,63,94,0.2);
            border: none;
            color: var(--color-human);
            font-size: 11px;
            padding: 1px 6px;
            border-radius: 3px;
            cursor: pointer;
            font-family: var(--font-body);
        }
        .inv-slot-unequip:hover { background: rgba(244,63,94,0.3); }
        .inv-item {
            display: flex;
            align-items: center;
            gap: 10px;
            background: var(--bg-elevated);
            border: 1px solid var(--border-dim);
            border-radius: var(--radius-md);
            padding: 10px 12px;
            margin-bottom: 6px;
        }
        .inv-item:last-child { margin-bottom: 0; }
        .inv-item-icon { font-size: 24px; width: 32px; text-align: center; flex-shrink: 0; }
        .inv-item-info { flex: 1; min-width: 0; }
        .inv-item-name { font-size: 13px; font-weight: 600; color: var(--text-bright); }
        .inv-item-type { font-size: 11px; color: var(--text-muted); }
        .inv-item-stats { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
        .inv-item-qty { font-size: 11px; color: var(--text-muted); background: rgba(0,0,0,0.2); padding: 0 6px; border-radius: 3px; }
        .inv-item-equip-btn {
            background: var(--accent-primary);
            color: #fff;
            border: none;
            border-radius: var(--radius-sm);
            padding: 4px 12px;
            font-size: 11px;
            font-family: var(--font-body);
            cursor: pointer;
            font-weight: 600;
            white-space: nowrap;
            transition: all var(--transition-fast);
        }
        .inv-item-equip-btn:hover { background: var(--accent-primary-bright); }
        .inv-empty {
            text-align: center;
            padding: 24px;
            color: var(--text-muted);
            font-size: 13px;
        }

        /* 鈹€鈹€ Map Modal 鈹€鈹€ */
        .map-modal {
            display: none;
            position: fixed;
            top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(18, 15, 23, 0.7);
            z-index: 1500;
            align-items: center;
            justify-content: center;
        }
        .map-modal.active { display: flex; }
        .map-window {
            background: var(--bg-surface);
            border: 1px solid var(--border-subtle);
            border-radius: var(--radius-lg);
            width: 480px;
            max-width: 92vw;
            max-height: 80vh;
            box-shadow: var(--shadow-lg);
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }
        .map-header {
            background: linear-gradient(135deg, #059669, #10b981);
            color: #fff;
            padding: 16px;
            text-align: center;
            font-size: 17px;
            font-weight: 700;
            font-family: var(--font-display);
            letter-spacing: 1px;
            flex-shrink: 0;
        }
        .map-body {
            flex: 1;
            overflow-y: auto;
            padding: 16px;
        }
        .map-loading {
            text-align: center;
            padding: 32px;
            color: var(--text-muted);
            font-size: 14px;
        }
        .map-footer {
            padding: 12px 16px;
            text-align: center;
            border-top: 1px solid var(--border-dim);
            flex-shrink: 0;
        }
        .map-location {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px 14px;
            background: var(--bg-elevated);
            border: 1px solid var(--border-dim);
            border-radius: var(--radius-md);
            margin-bottom: 8px;
            transition: all var(--transition-fast);
            cursor: default;
        }
        .map-location:last-child { margin-bottom: 0; }
        .map-location.current {
            border-color: var(--accent-primary);
            background: rgba(167, 139, 250, 0.1);
        }
        .map-location.locked { opacity: 0.5; }
        .map-location-icon { font-size: 28px; flex-shrink: 0; }
        .map-location-info { flex: 1; min-width: 0; }
        .map-location-name {
            font-size: 14px;
            font-weight: 700;
            color: var(--text-bright);
        }
        .map-location-desc {
            font-size: 12px;
            color: var(--text-secondary);
            margin-top: 2px;
        }
        .map-location-req {
            font-size: 11px;
            color: var(--text-muted);
            white-space: nowrap;
        }
        .map-location-status {
            font-size: 11px;
            padding: 2px 8px;
            border-radius: 8px;
            white-space: nowrap;
        }
        .map-location-status.at { background: rgba(167, 139, 250, 0.2); color: var(--accent-primary); }
        .map-location-status.go-btn {
            background: var(--accent-primary);
            color: #fff;
            padding: 4px 14px;
            border-radius: var(--radius-sm);
            cursor: pointer;
            font-family: var(--font-body);
            font-weight: 600;
            border: none;
            font-size: 12px;
            transition: all var(--transition-fast);
        }
        .map-location-status.go-btn:hover { background: var(--accent-primary-bright); }
        .map-connector {
            text-align: center;
            color: var(--border-subtle);
            font-size: 16px;
            line-height: 1;
            margin: -4px 0;
        }

        /* 鈹€鈹€ NPC Dialog 鈹€鈹€ */
        .npc-modal {
            display: none;
            position: fixed;
            top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(18, 15, 23, 0.7);
            z-index: 1500;
            align-items: center;
            justify-content: center;
        }
        .npc-modal.active { display: flex; }
        .npc-window {
            background: var(--bg-surface);
            border: 1px solid var(--border-subtle);
            border-radius: var(--radius-lg);
            width: 400px;
            max-width: 88vw;
            box-shadow: var(--shadow-lg);
            overflow: hidden;
        }
        .npc-body { padding: 0; }
        .npc-loading { text-align: center; padding: 32px; color: var(--text-muted); font-size: 14px; }
        .npc-portrait {
            text-align: center;
            padding: 24px 20px 12px;
            background: linear-gradient(180deg, rgba(167,139,250,0.1), transparent);
        }
        .npc-portrait-icon { font-size: 56px; display: block; margin-bottom: 6px; }
        .npc-portrait-name { font-size: 18px; font-weight: 700; color: var(--text-bright); }
        .npc-portrait-title { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
        .npc-greeting {
            padding: 12px 20px;
            font-size: 13px;
            color: var(--text-secondary);
            line-height: 1.6;
            text-align: center;
            border-bottom: 1px solid var(--border-dim);
        }
        .npc-actions {
            padding: 12px 16px;
            display: flex;
            flex-direction: column;
            gap: 6px;
        }
        .npc-action-btn {
            display: flex;
            align-items: center;
            gap: 10px;
            width: 100%;
            padding: 10px 14px;
            background: var(--bg-elevated);
            border: 1px solid var(--border-dim);
            border-radius: var(--radius-md);
            color: var(--text-primary);
            font-size: 13px;
            font-family: var(--font-body);
            cursor: pointer;
            transition: all var(--transition-fast);
            text-align: left;
        }
        .npc-action-btn:hover {
            background: var(--bg-hover);
            border-color: var(--border-subtle);
        }
        .npc-action-btn .action-icon { font-size: 20px; flex-shrink: 0; }
        .npc-action-btn .action-label { font-weight: 600; }
        .npc-action-btn .action-desc { font-size: 11px; color: var(--text-muted); }
        .npc-close-area {
            padding: 10px 16px 14px;
            text-align: center;
        }
        .npc-close-btn {
            background: transparent;
            border: 1px solid var(--border-dim);
            color: var(--text-secondary);
            padding: 6px 20px;
            border-radius: var(--radius-sm);
            font-size: 12px;
            font-family: var(--font-body);
            cursor: pointer;
            transition: all var(--transition-fast);
        }
        .npc-close-btn:hover { border-color: var(--border-subtle); color: var(--text-primary); }

        .login-overlay {
            position: fixed;
            top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(18, 15, 23, 0.7);
            z-index: 2000;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .login-overlay.hidden { display: none; }
        .login-card {
            background: var(--bg-surface);
            border: 1px solid var(--border-subtle);
            padding: 32px;
            border-radius: var(--radius-lg);
            width: 380px;
            text-align: center;
            box-shadow: var(--shadow-lg);
        }
        .login-card h2 {
            font-family: var(--font-display);
            font-size: 22px;
            margin: 0 0 24px;
            color: var(--text-bright);
            letter-spacing: 1px;
            border: none;
        }
        .login-card input {
            width: 100%;
            padding: 10px 14px;
            border: 1px solid var(--border-dim);
            border-radius: var(--radius-sm);
            margin-bottom: 10px;
            background: var(--bg-input);
            color: var(--text-primary);
            font-family: var(--font-body);
            font-size: 14px;
            transition: border-color var(--transition-fast);
            box-sizing: border-box;
        }
        .login-card input:focus {
            outline: none;
            border-color: var(--accent-primary);
            box-shadow: 0 0 0 2px rgba(167, 139, 250, 0.15);
        }
        .login-card input::placeholder { color: var(--text-muted); }
        .login-btn {
            width: 100%;
            padding: 11px;
            background: var(--accent-primary);
            color: #fff;
            border: none;
            border-radius: var(--radius-sm);
            font-size: 15px;
            cursor: pointer;
            font-family: var(--font-body);
            font-weight: 600;
            letter-spacing: 0.5px;
            transition: all var(--transition-fast);
        }
        .login-btn:hover { background: var(--accent-primary-bright); }
        .login-btn:active { transform: scale(0.98); }
        .login-card .btn-row { display: flex; gap: 10px; }
        .login-card .btn-row a {
            flex: 1;
            padding: 10px;
            border-radius: var(--radius-sm);
            color: #fff;
            text-decoration: none;
            text-align: center;
            font-weight: 600;
            font-size: 13px;
            transition: all var(--transition-fast);
        }
        .login-card .btn-row a:hover { opacity: 0.85; }
        .login-card .btn-row a:first-child { background: var(--color-human); }
        .login-card .btn-row a:last-child { background: var(--accent-primary); }

        footer { display: none; }

        /* 鈹€鈹€ Responsive: Tablet (768-1024px) 鈹€鈹€ */
        @media (max-width: 1024px) {
            .game-container {
                grid-template-columns: 200px 1fr 240px;
                gap: 6px;
                padding: 6px;
            }
            .player-avatar { width: 48px; height: 48px; font-size: 28px; }
            .player-card { padding: 14px 12px; }
            .menu-btn { font-size: 12px; padding: 7px 8px; }
        }

        /* 鈹€鈹€ Responsive: Mobile (<768px) 鈹€鈹€ */
        @media (max-width: 768px) {
            body { overflow-y: auto; }
            .game-container {
                grid-template-columns: 1fr;
                grid-template-rows: 1fr;
                gap: 0; padding: 0;
                height: 100vh; height: 100dvh;
            }

            .left-panel,
            .right-panel {
                display: none;
                position: fixed; top: 0; left: 0; z-index: 300;
                width: 100%; height: 100%; height: 100dvh;
                border-radius: 0; border: none;
                overflow-y: auto;
                background: var(--bg-base);
                padding: 16px 16px 60px;
                -webkit-overflow-scrolling: touch;
            }
            .left-panel.open,
            .right-panel.open { display: block; }

            .main-panel {
                display: flex; flex-direction: column;
                height: 100vh; height: 100dvh;
                border-radius: 0;
            }

            .top-bar {
                border-radius: 0;
                padding: 6px 10px;
                font-size: 11px;
                flex-shrink: 0;
            }
            .top-bar .announcement { display: none; }

            .chat-area {
                flex: 1; min-height: 0;
                display: flex; flex-direction: column;
                padding-bottom: 52px;
            }

            .chat-channel.public,
            .chat-channel.private { min-height: 0; }

            .channel-header { padding: 6px 10px; font-size: 12px; }
            .channel-tab { font-size: 11px; padding: 3px 8px; }

            .chat-messages { padding: 6px 8px; }

            .chat-input-area {
                border-radius: 0;
                padding: 6px 8px;
                flex-shrink: 0;
            }
            .chat-input-row input { font-size: 16px; }
            .chat-input-row button { font-size: 13px; padding: 8px 14px; }

            .action-buttons { gap: 4px; }
            .action-btn, .emote-toggle { font-size: 11px; padding: 5px 10px; }

            .daily-limits { font-size: 11px; }

            .mobile-nav {
                position: fixed; bottom: 0; left: 0; z-index: 400;
                width: 100%;
                display: flex;
                background: rgba(26, 23, 38, 0.96);
                border-top: 1px solid var(--border-subtle);
                backdrop-filter: blur(12px);
                -webkit-backdrop-filter: blur(12px);
                padding-bottom: env(safe-area-inset-bottom, 0);
            }
            .mobile-nav-btn {
                flex: 1;
                display: flex; flex-direction: column; align-items: center;
                gap: 1px;
                padding: 6px 4px;
                background: none; border: none;
                color: var(--text-muted);
                font-size: 10px;
                font-family: var(--font-body);
                cursor: pointer;
                transition: color var(--transition-fast);
                -webkit-tap-highlight-color: transparent;
            }
            .mobile-nav-btn .nav-icon { font-size: 22px; line-height: 1; }
            .mobile-nav-btn.active { color: var(--accent-primary); }
            .mobile-nav-btn:active { opacity: 0.6; }

            .mobile-back {
                display: flex; align-items: center; gap: 6px;
                margin-bottom: 14px;
                background: none; border: none;
                color: var(--accent-primary); font-size: 14px;
                cursor: pointer; font-family: var(--font-body);
                padding: 8px 0;
                -webkit-tap-highlight-color: transparent;
            }

            .pk-window { width: 94%; max-height: 85vh; }
            .pk-players { flex-direction: column; gap: 10px; }
            .pk-vs { font-size: 20px; }
            .pk-action-btn { font-size: 14px; padding: 12px 20px; }
            .pk-log { max-height: 100px; }

            .quest-window { max-width: 96vw; max-height: 90vh; }
            .quest-body { padding: 12px; }
            .quest-card { padding: 10px 12px; }

            .inv-window { max-width: 96vw; max-height: 90vh; }
            .inv-body { padding: 12px; }
            .inv-slots { grid-template-columns: repeat(3, 1fr); gap: 4px; }
            .inv-item { padding: 8px 10px; }
            .inv-slot { min-height: 60px; padding: 8px; }

            .map-window { max-width: 96vw; max-height: 90vh; }
            .map-body { padding: 12px; }
            .map-location { padding: 10px 12px; gap: 8px; }

            .npc-window { max-width: 94vw; }
            .npc-portrait { padding: 18px 16px 10px; }
            .npc-portrait-icon { font-size: 44px; }
            .npc-greeting { padding: 10px 16px; font-size: 12px; }
            .npc-actions { padding: 10px 12px; }
            .npc-action-btn { padding: 8px 12px; font-size: 12px; }

            .login-card { width: 92%; padding: 24px 20px; }

            .emote-grid { grid-template-columns: repeat(5, 1fr); }
            .action-grid { grid-template-columns: repeat(3, 1fr); }
        }

        @media (min-width: 769px) {
            .mobile-nav { display: none !important; }
            .mobile-back { display: none !important; }
        }

        /* 鈹€鈹€ Leaderboard Modal (P3) 鈹€鈹€ */
        .lb-modal {
            display: none;
            position: fixed;
            top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(18, 15, 23, 0.7);
            z-index: 1500;
            align-items: center;
            justify-content: center;
        }
        .lb-modal.active { display: flex; }
        .lb-window {
            background: var(--bg-surface);
            border: 1px solid var(--border-subtle);
            border-radius: var(--radius-lg);
            width: 520px;
            max-width: 92vw;
            max-height: 80vh;
            box-shadow: var(--shadow-lg);
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }
        .lb-header {
            background: linear-gradient(135deg, #f59e0b, var(--accent-primary));
            color: #fff;
            padding: 16px;
            text-align: center;
            font-size: 17px;
            font-weight: 700;
            font-family: var(--font-display);
            letter-spacing: 1px;
            flex-shrink: 0;
        }
        .lb-tabs {
            display: flex;
            background: var(--bg-surface);
            border-bottom: 1px solid var(--border-dim);
            flex-shrink: 0;
        }
        .lb-tab {
            flex: 1;
            padding: 10px;
            cursor: pointer;
            border: none;
            background: none;
            color: var(--text-muted);
            font-family: var(--font-body);
            font-size: 13px;
            font-weight: 500;
            border-bottom: 2px solid transparent;
            transition: all var(--transition-fast);
        }
        .lb-tab:hover { color: var(--text-primary); }
        .lb-tab.active { color: var(--accent-primary); border-bottom-color: var(--accent-primary); }
        .lb-body {
            flex: 1;
            overflow-y: auto;
            padding: 12px 16px;
        }
        .lb-empty {
            text-align: center;
            padding: 24px;
            color: var(--text-muted);
            font-size: 13px;
        }
        .lb-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 8px 10px;
            background: var(--bg-elevated);
            border: 1px solid var(--border-dim);
            border-radius: var(--radius-md);
            margin-bottom: 6px;
            transition: background var(--transition-fast);
        }
        .lb-item:hover { background: var(--bg-hover); }
        .lb-rank {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            font-size: 13px;
            flex-shrink: 0;
        }
        .lb-rank.gold { background: linear-gradient(135deg, #f59e0b, #fbbf24); color: #fff; }
        .lb-rank.silver { background: linear-gradient(135deg, #9ca3af, #d1d5db); color: #fff; }
        .lb-rank.bronze { background: linear-gradient(135deg, #b45309, #d97706); color: #fff; }
        .lb-rank.normal { background: var(--bg-base); color: var(--text-muted); font-size: 12px; }
        .lb-avatar { font-size: 24px; flex-shrink: 0; }
        .lb-info { flex: 1; min-width: 0; }
        .lb-name { font-size: 13px; font-weight: 600; color: var(--text-bright); }
        .lb-meta { font-size: 11px; color: var(--text-muted); }
        .lb-value { font-size: 14px; font-weight: 700; color: var(--accent-primary-bright); text-align: right; }
        .lb-loading {
            text-align: center;
            padding: 32px;
            color: var(--text-muted);
            font-size: 14px;
        }
        .lb-footer {
            padding: 12px 16px;
            text-align: center;
            border-top: 1px solid var(--border-dim);
            flex-shrink: 0;
        }

        /* 鈹€鈹€ Player Profile Modal (P3) 鈹€鈹€ */
        .profile-modal {
            display: none;
            position: fixed;
            top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(18, 15, 23, 0.7);
            z-index: 1500;
            align-items: center;
            justify-content: center;
        }
        .profile-modal.active { display: flex; }
        .profile-window {
            background: var(--bg-surface);
            border: 1px solid var(--border-subtle);
            border-radius: var(--radius-lg);
            width: 440px;
            max-width: 90vw;
            max-height: 80vh;
            box-shadow: var(--shadow-lg);
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }
        .profile-header {
            text-align: center;
            padding: 24px 20px 16px;
            background: linear-gradient(180deg, rgba(167,139,250,0.1), transparent);
            flex-shrink: 0;
        }
        .profile-avatar { font-size: 56px; display: block; margin-bottom: 6px; }
        .profile-name { font-size: 18px; font-weight: 700; color: var(--text-bright); }
        .profile-title { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
        .profile-body {
            flex: 1;
            overflow-y: auto;
            padding: 12px 20px 20px;
        }
        .profile-section {
            background: var(--bg-elevated);
            border: 1px solid var(--border-dim);
            border-radius: var(--radius-md);
            padding: 12px 14px;
            margin-bottom: 10px;
        }
        .profile-section-title {
            font-size: 12px;
            font-weight: 600;
            color: var(--accent-primary);
            margin-bottom: 8px;
        }
        .profile-row {
            display: flex;
            justify-content: space-between;
            font-size: 12px;
            padding: 3px 0;
            color: var(--text-primary);
        }
        .profile-row .label { color: var(--text-muted); }
        .profile-row .value { font-weight: 600; }
        .profile-bio {
            font-size: 12px;
            color: var(--text-secondary);
            line-height: 1.5;
            padding: 4px 0;
        }
        .profile-equip-item {
            font-size: 12px;
            padding: 3px 0;
            color: var(--text-primary);
        }
        .profile-equip-item .eq-icon { margin-right: 6px; }
        .profile-equip-item .eq-name { color: var(--accent-primary-bright); }
        .profile-equip-item .eq-stats { font-size: 11px; color: var(--text-muted); margin-left: 20px; }
        .profile-empty { text-align: center; padding: 16px; color: var(--text-muted); font-size: 13px; }
        .profile-footer {
            padding: 12px 16px;
            text-align: center;
            border-top: 1px solid var(--border-dim);
            flex-shrink: 0;
        }
        .profile-actions {
            display: flex;
            gap: 8px;
            justify-content: center;
            padding: 8px 16px 14px;
            flex-shrink: 0;
        }
        .profile-action-btn {
            padding: 6px 18px;
            border-radius: var(--radius-sm);
            border: 1px solid var(--border-subtle);
            background: var(--bg-elevated);
            color: var(--text-secondary);
            font-family: var(--font-body);
            font-size: 12px;
            cursor: pointer;
            transition: all var(--transition-fast);
        }
        .profile-action-btn:hover { border-color: var(--accent-primary); color: var(--accent-primary); }

        /* 鈹€鈹€ Mail Modal (P3) 鈹€鈹€ */
        .mail-modal {
            display: none;
            position: fixed;
            top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(18, 15, 23, 0.7);
            z-index: 1500;
            align-items: center;
            justify-content: center;
        }
        .mail-modal.active { display: flex; }
        .mail-window {
            background: var(--bg-surface);
            border: 1px solid var(--border-subtle);
            border-radius: var(--radius-lg);
            width: 560px;
            max-width: 92vw;
            max-height: 80vh;
            box-shadow: var(--shadow-lg);
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }
        .mail-header {
            background: linear-gradient(135deg, #6366f1, var(--accent-primary));
            color: #fff;
            padding: 14px 16px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            flex-shrink: 0;
        }
        .mail-header-title { font-size: 17px; font-weight: 700; font-family: var(--font-display); letter-spacing: 1px; }
        .mail-header-actions { display: flex; gap: 6px; }
        .mail-header-btn {
            padding: 5px 14px;
            border-radius: var(--radius-sm);
            border: 1px solid rgba(255,255,255,0.2);
            background: rgba(255,255,255,0.1);
            color: #fff;
            font-family: var(--font-body);
            font-size: 12px;
            cursor: pointer;
            transition: all var(--transition-fast);
        }
        .mail-header-btn:hover { background: rgba(255,255,255,0.2); }
        .mail-body {
            flex: 1;
            overflow-y: auto;
            padding: 12px 16px;
        }
        .mail-list { display: flex; flex-direction: column; gap: 4px; }
        .mail-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 12px;
            background: var(--bg-elevated);
            border: 1px solid var(--border-dim);
            border-radius: var(--radius-md);
            cursor: pointer;
            transition: all var(--transition-fast);
        }
        .mail-item:hover { background: var(--bg-hover); border-color: var(--border-subtle); }
        .mail-item.unread { border-left: 3px solid var(--accent-primary); }
        .mail-item-icon { font-size: 18px; flex-shrink: 0; }
        .mail-item-info { flex: 1; min-width: 0; }
        .mail-item-title {
            font-size: 13px;
            font-weight: 600;
            color: var(--text-bright);
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .mail-item-title.unread { color: var(--accent-primary-bright); }
        .mail-item-sender { font-size: 11px; color: var(--text-muted); }
        .mail-item-time { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
        .mail-empty { text-align: center; padding: 32px; color: var(--text-muted); font-size: 13px; }
        .mail-detail { display: flex; flex-direction: column; gap: 12px; }
        .mail-detail-header { padding-bottom: 10px; border-bottom: 1px solid var(--border-dim); }
        .mail-detail-title { font-size: 15px; font-weight: 700; color: var(--text-bright); }
        .mail-detail-meta { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
        .mail-detail-content {
            font-size: 13px;
            color: var(--text-primary);
            line-height: 1.7;
            white-space: pre-wrap;
            padding: 8px 0;
        }
        .mail-detail-actions { display: flex; gap: 8px; padding-top: 10px; }
        .mail-compose textarea {
            width: 100%;
            padding: 10px 12px;
            border: 1px solid var(--border-dim);
            border-radius: var(--radius-sm);
            background: var(--bg-input);
            color: var(--text-primary);
            font-family: var(--font-body);
            font-size: 13px;
            resize: vertical;
            min-height: 100px;
            box-sizing: border-box;
            transition: border-color var(--transition-fast);
        }
        .mail-compose textarea:focus { outline: none; border-color: var(--accent-primary); }
        .mail-compose input[type="text"] {
            width: 100%;
            padding: 9px 12px;
            border: 1px solid var(--border-dim);
            border-radius: var(--radius-sm);
            background: var(--bg-input);
            color: var(--text-primary);
            font-family: var(--font-body);
            font-size: 13px;
            box-sizing: border-box;
            transition: border-color var(--transition-fast);
        }
        .mail-compose input[type="text"]:focus { outline: none; border-color: var(--accent-primary); }
        .mail-btn {
            padding: 8px 20px;
            border-radius: var(--radius-sm);
            border: none;
            background: var(--accent-primary);
            color: #fff;
            font-family: var(--font-body);
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            transition: all var(--transition-fast);
        }
        .mail-btn:hover { background: var(--accent-primary-bright); }
        .mail-btn:disabled { opacity: 0.4; cursor: not-allowed; }
        .mail-loading { text-align: center; padding: 32px; color: var(--text-muted); font-size: 14px; }

        /* 鈹€鈹€ Search UI (P3) 鈹€鈹€ */
        .search-bar {
            display: flex;
            gap: 4px;
            margin-bottom: 4px;
        }
        .search-bar.hidden { display: none; }
        .search-bar input {
            flex: 1;
            padding: 6px 10px;
            border: 1px solid var(--border-dim);
            border-radius: var(--radius-sm);
            background: var(--bg-input);
            color: var(--text-primary);
            font-family: var(--font-body);
            font-size: 12px;
            transition: border-color var(--transition-fast);
        }
        .search-bar input:focus { outline: none; border-color: var(--accent-primary); }
        .search-bar input::placeholder { color: var(--text-muted); }
        .search-bar .search-close {
            padding: 6px 10px;
            border: none;
            background: none;
            color: var(--text-muted);
            cursor: pointer;
            font-size: 14px;
        }
        .search-bar .search-close:hover { color: var(--text-primary); }
        .search-result-item {
            padding: 6px 10px;
            margin-bottom: 4px;
            border-radius: var(--radius-sm);
            background: rgba(167, 139, 250, 0.06);
            font-size: 12px;
            cursor: pointer;
            transition: background var(--transition-fast);
        }
        .search-result-item:hover { background: rgba(167, 139, 250, 0.1); }
        .search-result-item .srauthor { color: var(--accent-primary); font-weight: 600; }
        .search-result-item .srcontent { color: var(--text-primary); }
        .search-result-item .srtime { color: var(--text-muted); font-size: 10px; }
        .search-noresult {
            text-align: center;
            padding: 16px;
            color: var(--text-muted);
            font-size: 12px;
        }
        .chat-search-toggle {
            padding: 3px 8px;
            border: 1px solid var(--border-dim);
            border-radius: var(--radius-sm);
            background: transparent;
            color: var(--text-muted);
            cursor: pointer;
            font-size: 11px;
            font-family: var(--font-body);
            transition: all var(--transition-fast);
        }
        .chat-search-toggle:hover { color: var(--accent-primary); border-color: var(--border-subtle); }

        /* 鈹€鈹€ Mail badge 鈹€鈹€ */
        .mail-badge {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-width: 16px;
            height: 16px;
            padding: 0 4px;
            border-radius: 8px;
            background: var(--color-human);
            color: #fff;
            font-size: 10px;
            font-weight: 700;
            margin-left: 4px;
        }
        .mail-badge.hidden { display: none; }

        @media (max-width: 768px) {
            .lb-window { max-width: 96vw; max-height: 90vh; }
            .lb-body { padding: 10px; }
            .lb-item { padding: 7px 8px; }

            .profile-window { max-width: 94vw; }
            .profile-body { padding: 10px 14px; }

            .mail-window { max-width: 96vw; max-height: 90vh; }
            .mail-body { padding: 10px; }
            .mail-item { padding: 8px 10px; }
        }


