* { box-sizing: border-box; } body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; margin: 0; background: #f2f4f8; color: #222; } header { background: #24344d; color: #fff; padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; } header h1 { font-size: 20px; margin: 0; } nav#menu { display: flex; gap: 6px; flex-wrap: wrap; } nav#menu a { color: #fff; text-decoration: none; padding: 6px 14px; border-radius: 6px; background: rgba(255,255,255,.12); } nav#menu a:hover { background: rgba(255,255,255,.25); } nav#menu a.nav-active { background: #ffb703 !important; color: #1b2430 !important; font-weight: bold; box-shadow: 0 0 0 2px rgba(255,255,255,.45) inset; } nav#menu a.nav-active::after { content: ' ●'; font-size: 11px; vertical-align: middle; } main { max-width: 100%; margin: 10px auto; padding: 0 10px; } .lobby { background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 2px 8px rgba(0,0,0,.06); } .lobby-hero { display: flex; gap: 16px; align-items: center; } .lobby-hero img { width: 120px; height: 120px; object-fit: cover; border-radius: 10px; } .lobby-actions { display: flex; gap: 10px; margin-top: 18px; } .btn { padding: 8px 18px; border: 1px solid #24344d; background: #fff; color: #24344d; border-radius: 8px; cursor: pointer; font-size: 14px; } .btn.primary { background: #24344d; color: #fff; } .btn:disabled { opacity: .5; cursor: default; } .hide { display: none; } input { padding: 8px; border: 1px solid #ccc; border-radius: 6px; } #room-status { margin-top: 10px; color: #2a7; } .board { display: inline-block; background: #f6deac; border: 2px solid #b8860b; border-radius: 8px; touch-action: manipulation; } .cell { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; font-size: 22px; } .chess-piece { width: 88%; height: 88%; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; box-shadow: 0 2px 3px rgba(0,0,0,.3); font-size: 20px; } .chess-piece.r { background: #fff; color: #c00; border: 2px solid #c00; } .chess-piece.b { background: #efe6d5; color: #333; border: 2px solid #333; } .cell.sel { background: #ffe9a0 !important; } .cell.hint { background: #bfe3bf !important; border-radius: 8px; } .cell.lastmv { box-shadow: inset 0 0 0 2px #f90; } .toolbar { display: flex; flex-direction: column; gap: 10px; min-width: 120px; } .toolbar .btn.wide { width: 100%; padding: 12px 0; font-size: 16px; } .game-shell { min-height: 480px; } .gomoku-board { background: #dea560; } .gomoku-stone { width: 70%; height: 70%; border-radius: 50%; } .gomoku-stone.b { background: radial-gradient(circle at 30% 30%, #666, #000); } .gomoku-stone.w { background: radial-gradient(circle at 30% 30%, #fff, #ccc); } .gok { margin: 10px 0; } .gok span { margin-right: 10px; } .badge { background: #eee; border-radius: 999px; padding: 2px 12px; font-size: 13px; } .tag-r { background: #ffe4e4; color: #c00; } .tag-b { background: #e0f0ff; color: #06c; } .junqi-cell { cursor: pointer; } .junqi-cell.facedown { color: #337; background: #6a89cc; color: #fff; } .ludo-root { display: flex; gap: 20px; flex-wrap: wrap; } .dice-btn { font-size: 40px; padding: 10px 24px; } .statusline { margin: 10px 0; color: #555; } .msg { color: #c00; margin: 8px 0; min-height: 20px; } .logbox { background: #fff; padding: 12px; border-radius: 8px; max-height: 300px; overflow: auto; width: 260px; } /* ===== 手机适配 ===== */ html, body { width: 100%; min-height: 100%; } main { max-width: 100%; margin: 8px auto; padding: 0 8px; } header { padding: 10px 12px; } header h1 { font-size: 17px; } .lobby { padding: 14px; border-radius: 10px; } /* 游戏页:棋盘居上自适应,工具按钮横排在下方 */ .game-shell .lobby { padding: 10px; } .game-shell > div { gap: 10px !important; } #game-canvas { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; overflow-x: auto; } #game-canvas > * { max-width: 100%; height: auto; } /* 象棋 10x9 格用 vw 缩放 */ .chess-board .cell, #chess-b .cell { width: min(9vw, 44px); height: min(9vw, 44px); } .chess-piece { font-size: min(4.4vw, 20px); } /* 军棋 10x6 */ .junqi-cell { width: min(14vw, 56px) !important; height: min(14vw, 56px) !important; font-size: min(4.5vw, 16px) !important; } /* 五子棋 SVG 自适应 */ #gok-board { width: 100% !important; height: auto !important; max-width: 92vw; display: block; } /* 工具栏在手机上转为横排 */ .toolbar { flex-direction: row !important; min-width: 0 !important; width: 100%; } .toolbar .btn.wide { width: auto; flex: 1; padding: 12px 8px; font-size: 15px; } /* 状态栏可换行 */ .statusline { font-size: 14px; word-break: break-all; } @media (hover: hover) and (pointer: fine) { /* 桌面还原固定尺寸 */ .chess-board .cell, #chess-b .cell { width: 44px; height: 44px; } .junqi-cell { width: 56px !important; height: 56px !important; } } .chess-board .crow { display: flex; } .chess-board .cell { margin: 0; } .diff-box { display:flex; align-items:center; gap:8px; background:#fff; border:1px solid #ccc; border-radius:8px; padding:8px 12px; } .diff-box label { font-size:14px; color:#24344d; font-weight:bold; } .diff-box select { border:none; font-size:15px; outline:none; background:transparent; } .ai-box { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; z-index: 99; } .ai-inner { background: #fff; padding: 18px; border-radius: 10px; display: flex; flex-direction: column; gap: 10px; width: min(90vw, 380px); } .ai-inner input { padding: 10px; border: 1px solid #ccc; border-radius: 6px; font-size: 14px; } .ai-hintbox { background: #fffbe6; border: 1px solid #f0d060; border-radius: 8px; padding: 10px 14px; margin: 10px 0; font-size: 15px; line-height: 1.6; } .toolbar .btn.wide { white-space: nowrap; font-size: 14px; } /* 浮动工具栏右侧 */ .float-toolbar { position: fixed; right: 10px; top: 50%; transform: translateY(-50%); z-index: 50; display: flex; flex-direction: column; gap: 8px; background: rgba(255,255,255,.94); border: 1px solid #d0d0d0; border-radius: 12px; padding: 10px; box-shadow: 0 4px 16px rgba(0,0,0,.14); width: 128px; } .float-toolbar .diff-box { flex-direction: column; gap: 4px; padding: 6px 8px; } .float-toolbar .diff-box select { font-size: 14px; } .float-toolbar .btn.wide { padding: 8px 6px; font-size: 13px; } .game-shell { width: 100%; max-width: 100% !important; } @media (max-width: 560px) { .float-toolbar { width: 76px; padding: 6px; top: auto; bottom: 10px; transform: none; max-height: 76vh; overflow: auto; } .float-toolbar .btn.wide { font-size: 11px; padding: 6px 2px; } .float-toolbar .diff-box label { font-size: 11px; } .float-toolbar .diff-box select { font-size: 12px; } .game-shell { width: 100%; max-width: 100% !important; } } .game-head .btn { padding: 8px 14px; } .game-head .diff-box { padding: 6px 10px; } .game-shall { margin-bottom: 8px; } .game-head { margin-bottom: 10px; } .status-banner { background: linear-gradient(90deg, #24344d, #3b547a); color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 16px; font-weight: bold; letter-spacing: 0.5px; box-shadow: 0 2px 6px rgba(36,52,77,.25); margin-bottom: 4px; text-align: center; } .status-banner:empty::before { content: '…'; opacity: .4; } .btn.start-big { display: block; width: min(92vw, 420px); margin: 18px auto 8px; padding: 14px 0; font-size: 19px; font-weight: bold; letter-spacing: 1px; border: none; border-radius: 12px; background: linear-gradient(90deg, #1e6ef0, #3b82f6); color: #fff; box-shadow: 0 4px 14px rgba(30,110,240,.35); cursor: pointer; } .btn.start-big:hover { filter: brightness(1.08); } .btn.start-big:active { transform: scale(.98); } .btn.start-two { display: block; width: min(92vw, 420px); margin: 12px auto 8px; padding: 13px 0; font-size: 17px; font-weight: bold; letter-spacing: 1px; border: none; border-radius: 12px; background: linear-gradient(90deg, #0ea56a, #22c98a); color: #fff; box-shadow: 0 4px 12px rgba(14,165,106,.3); cursor: pointer; } .btn.start-two:hover { filter: brightness(1.08); } /* 军棋竖版棋盘:按屏幕自适应(不超出视口高度) */ #junqi-b { width: auto !important; height: auto !important; max-width: min(100%, 400px) !important; max-height: calc(100vh - 258px) !important; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.12); } #game-canvas { align-items: center; } @media (max-width: 560px) { .game-shell:has(#junqi-b) { max-width: 100% !important; } #junqi-b { max-height: calc(100vh - 286px) !important; } /* 手机上头部按钮单行横向滑动,省出竖向空间 */ .game-head { flex-wrap: nowrap !important; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 6px; width: 100%; } .game-head > * { flex: 0 0 auto; } .game-head .btn { padding: 6px 9px !important; font-size: 12px !important; white-space: nowrap; } .game-head select { font-size: 12px !important; } .game-head .diff-box { padding: 3px 6px !important; } } /* 大厅卡片保持居中限宽;游戏页满屏 100% */ #view > .lobby:not(.game-shell) { max-width: 1100px; margin: 0 auto; } .game-shell { width: 100% !important; max-width: 100% !important; box-sizing: border-box; } .game-shell > * { max-width: 100%; } /* 手机上禁用下拉刷新,避免对局中误刷新 */ html, body { overscroll-behavior-y: contain; } /* ===== 全站页脚:版权 / 友情链接 / 开源地址 ===== */ .site-footer { margin: 22px 0 0; padding: 18px 14px 26px; border-top: 1px solid rgba(127,140,160,.25); background: rgba(255,255,255,.45); text-align: center; color: #5b6b80; font-size: 13px; line-height: 1.9; } .site-footer a { color: #1e6ef0; text-decoration: none; } .site-footer a:hover { text-decoration: underline; } .site-footer .sf-line { margin: 2px 0; } .site-footer .sf-links { margin-top: 6px; } .site-footer .sf-links-title { display: block; color: #43536b; font-weight: 600; margin-bottom: 6px; } .site-footer .sf-links a { display: inline-block; margin: 3px 5px; padding: 4px 12px; white-space: nowrap; background: #eef4ff; border: 1px solid #d5e3fb; border-radius: 15px; color: #1e5fd0; font-weight: 600; transition: all .15s; } .site-footer .sf-links a:hover { background: #1e6ef0; border-color: #1e6ef0; color: #fff; text-decoration: none; } .site-footer .sf-copy { color: #8a97a8; font-size: 12.5px; } .site-footer .sf-oss { color: #8a97a8; font-size: 12.5px; } .site-footer .sf-lic { display: inline-block; margin-left: 8px; padding: 0 7px; border: 1px solid #cfd8e3; border-radius: 5px; font-size: 12px; color: #7b8797; } @media (max-width: 560px) { .site-footer { font-size: 12.5px; padding: 14px 10px 22px; } .site-footer .sf-links a { margin: 0 6px; } } /* 主推推广项:呼吸式微光(只在主推项上,避免整页闪烁) */ @keyframes sfTitleGlow { from { text-shadow: 0 0 0 rgba(255,140,0,0); } to { text-shadow: 0 0 12px rgba(255,142,0,.75), 0 0 3px rgba(255,190,60,.95); } } @keyframes sfHotGlow { from { box-shadow: 0 0 0 rgba(255,140,0,0); } to { box-shadow: 0 0 11px rgba(255,140,0,.6), 0 0 2px rgba(255,180,60,.8); } } @keyframes sfShine { 0% { transform: translateX(-120%) skewX(-18deg); } 100% { transform: translateX(240%) skewX(-18deg); } } .site-footer .sf-links-title { color: #b35c00; animation: sfTitleGlow 1.9s ease-in-out infinite alternate; } .site-footer .sf-links a.hot { position: relative; overflow: hidden; background: linear-gradient(135deg, #fff4dc, #ffe2b8); border-color: #ffc766; color: #a85500; animation: sfHotGlow 1.9s ease-in-out infinite alternate; } .site-footer .sf-links a.hot::after { /* 掠过式光泽 */ content: ''; position: absolute; top: 0; left: 0; width: 40%; height: 100%; background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,.85), rgba(255,255,255,0)); animation: sfShine 3.6s ease-in-out infinite; pointer-events: none; } .site-footer .sf-links a.hot:hover { background: linear-gradient(135deg, #ff9a1f, #ff6a00); border-color: #ff6a00; color: #fff; animation: none; box-shadow: 0 0 14px rgba(255,120,0,.75); } @media (prefers-reduced-motion: reduce) { .site-footer .sf-links-title, .site-footer .sf-links a.hot, .site-footer .sf-links a.hot::after { animation: none !important; } } /* ===== 版本角标 · 公告条 · 更新提示 ===== */ .ver-chip{margin-left:10px;padding:3px 10px;border-radius:12px;background:rgba(255,255,255,.18);color:inherit;font-size:12px;font-weight:700;cursor:pointer;user-select:none;white-space:nowrap;border:1px dashed rgba(255,255,255,.45)} .ver-chip:hover{background:rgba(255,255,255,.3)} .ver-chip.has-update{background:#ff6a00;color:#fff;border:1px solid #ffd0a8;box-shadow:0 0 8px rgba(255,106,0,.6);animation:verpulse 1.6s ease-in-out infinite} .upd-dot{display:inline-block;margin-left:4px;padding:0 5px;border-radius:8px;background:#fff;color:#ff6a00;font-size:10px;font-weight:900} @keyframes verpulse{0%,100%{box-shadow:0 0 6px rgba(255,106,0,.5)}50%{box-shadow:0 0 14px rgba(255,106,0,.95)}} .ver-pop{position:fixed;z-index:999;min-width:230px;max-width:320px;background:#fff;color:#333;border-radius:12px;box-shadow:0 8px 30px rgba(0,0,0,.25);padding:10px 12px;font-size:13px;line-height:1.55} .vp-row{margin:2px 0}.vp-new{color:#ff6a00;font-weight:700} .vp-cl{margin-top:6px;padding-top:6px;border-top:1px dashed #ddd;color:#666;font-size:12px;max-height:150px;overflow:auto} .vp-btn{display:inline-block;margin-top:8px;padding:6px 12px;border-radius:8px;background:#1e6ef0;color:#fff;text-decoration:none;font-weight:700} .vp-tip{margin-top:6px;color:#999;font-size:11px} .notice-bar{background:#fff7e0;color:#7a5200;font-size:13px;padding:6px 14px;text-align:center;border-bottom:1px solid #ffe2a0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis} .notice-bar .nb-sep{color:#d9a441;margin:0 8px} .nb-item b{color:#a05a00} .upd-overlay{position:fixed;inset:0;z-index:1000;background:rgba(0,0,0,.45);display:flex;align-items:center;justify-content:center} .upd-box{background:#fff;color:#333;border-radius:14px;max-width:420px;width:calc(100% - 40px);padding:18px 20px;box-shadow:0 12px 40px rgba(0,0,0,.3)} .upd-box h3{margin:0 0 8px;font-size:17px} .upd-cl{color:#555;font-size:13px;line-height:1.6;max-height:220px;overflow:auto} .upd-ok{margin-top:12px;padding:7px 18px;border:0;border-radius:8px;background:#1e6ef0;color:#fff;font-weight:700;cursor:pointer} /* ===== 右上角公告图标 + 面板 ===== */ .notice-icon{position:relative;margin-left:10px;cursor:pointer;font-size:16px;user-select:none;line-height:1;display:inline-block;transition:transform .15s} .notice-icon:hover{transform:scale(1.15)} .notice-dot{position:absolute;top:-5px;right:-8px;min-width:15px;height:15px;padding:0 3px;border-radius:8px;background:#e53935;color:#fff;font-size:10px;font-weight:700;line-height:15px;text-align:center;box-shadow:0 0 3px rgba(0,0,0,.35)} .notice-panel{position:fixed;z-index:999;min-width:280px;max-width:340px;max-height:60vh;overflow:auto;background:#fff;color:#333;border-radius:12px;box-shadow:0 8px 30px rgba(0,0,0,.25);padding:10px 12px;font-size:13px} .np-title{font-weight:700;margin-bottom:6px;border-bottom:1px dashed #ddd;padding-bottom:6px} .np-cnt{color:#999;font-weight:400;font-size:12px;margin-left:4px} .np-item{padding:6px 4px;border-radius:8px;cursor:pointer} .np-item:hover{background:#f5f7fa} .np-unread{background:#fff8f0} .np-h{display:flex;align-items:center;gap:6px} .np-h b{flex:1} .np-time{color:#999;font-size:11px;font-weight:400} .np-dot{width:7px;height:7px;border-radius:4px;background:#e53935;display:inline-block;flex:none} .np-body{color:#666;font-size:12px;margin-top:2px;line-height:1.5} .np-empty{color:#999;text-align:center;padding:14px 0} .np-foot{border-top:1px dashed #ddd;margin-top:6px;padding-top:6px;text-align:right} .np-read{border:0;background:#1e6ef0;color:#fff;border-radius:7px;padding:4px 10px;font-size:12px;cursor:pointer} /* ===== 战况面板(被吃棋子):手机在棋盘下方,桌面(≥900px)在棋盘右侧 ===== */ .eaten-tray{max-width:min(100%,380px);width:100%;margin:12px auto 0;background:#fffdf6;border:2px solid #f0c674;border-left:6px solid #e8a33d;border-radius:14px;box-shadow:0 4px 14px rgba(0,0,0,.12);padding:12px 14px;font-size:15px;color:#444;text-align:left} .eaten-title{font-size:17px;font-weight:800;color:#8a5a00;margin-bottom:8px;display:flex;align-items:center;gap:8px;flex-wrap:wrap} .eaten-total{background:#ffefc2;color:#8a5a00;border-radius:10px;padding:2px 10px;font-size:16px;font-weight:900} .eaten-row{display:flex;align-items:center;gap:7px;flex-wrap:wrap;margin:7px 0} .eaten-lbl{min-width:76px;font-weight:800;font-size:15px} .eaten-chip{display:inline-flex;align-items:center;justify-content:center;min-width:34px;height:34px;padding:0 6px;border-radius:17px;background:#fff;border:2px solid #ddd;font-family:Kaiti,"STKaiti",serif;font-weight:800;font-size:18px;box-shadow:0 1px 2px rgba(0,0,0,.15)} .eaten-chip sup{font-size:11px;font-weight:800;margin-left:1px} .ec-red{color:#b0181c;border-color:#d98b8b;background:#fff5f5} .ec-black{color:#222;border-color:#999;background:#f4f4f4} .ec-blue{color:#2f4f80;border-color:#8fa9cf;background:#eef3fb} .eaten-none{color:#b9b2a2;font-size:14px;font-style:italic} @media (min-width:900px){ #game-canvas{display:grid;grid-template-columns:1fr auto 1fr;align-items:start;align-content:start} #game-canvas>*:not(.eaten-tray){grid-column:2} #game-canvas>.eaten-tray{grid-column:3;align-self:start;margin:14px 0 0 20px;max-width:380px;width:calc(100% - 20px)} /* 军棋svg是width:auto高度约束型,grid里auto轨道按内容定宽会循环归零 → 给确定高度,宽度走viewBox比例 */ #game-canvas>svg#junqi-b{height:calc(100vh - 258px) !important;width:auto} /* 象棋/五子棋的width:100%在grid auto轨道里退化成intrinsic 300px → 给确定宽度 */ #game-canvas>svg#chess-b{width:520px !important} #game-canvas>svg#gok-board{width:520px !important} }