:root{--ws-bg:#f6f7f3;--ws-ink:#1e2925;--ws-muted:#5c6b63;--ws-line:#dce5dd;--ws-accent:#156b57;--ws-accent-dark:#0e5142;--ws-surface:#fff;--ws-soft:#e8f1ea}
html{scroll-behavior:smooth}
body{font-family:Inter,"PingFang SC","Microsoft YaHei",system-ui,sans-serif!important;background:var(--ws-bg)!important;color:var(--ws-ink)!important}
*{box-sizing:border-box}
[hidden]{display:none!important}.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
a:focus-visible,button:focus-visible,input:focus-visible,textarea:focus-visible{outline:3px solid #74b69c!important;outline-offset:3px}
.ws-nav{position:relative;z-index:50;display:flex;align-items:center;justify-content:space-between;gap:24px;max-width:1180px;margin:auto;padding:18px 28px;border-bottom:1px solid var(--ws-line);font-size:14px}
.ws-brand{display:inline-flex;align-items:center;gap:10px;color:var(--ws-ink)!important;text-decoration:none!important;font-size:18px;font-weight:750;white-space:nowrap;letter-spacing:.02em}
.ws-brand-mark{display:grid;place-items:center;width:32px;height:32px;border-radius:10px;background:var(--ws-accent);color:white;font-size:20px;font-weight:500}
.ws-links{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.ws-links a{padding:8px 11px;border-radius:8px;color:var(--ws-muted)!important;text-decoration:none!important;font-weight:600}
.ws-links a:hover,.ws-links a[aria-current=page]{background:var(--ws-soft);color:var(--ws-accent-dark)!important}
.ws-shell{max-width:1180px;margin:auto;padding:0 28px}
.ws-hero{display:grid;grid-template-columns:1.12fr .88fr;align-items:center;gap:56px;padding:92px 0 86px}
.ws-eyebrow{display:inline-flex;align-items:center;gap:8px;color:var(--ws-accent);font-size:13px;font-weight:750;letter-spacing:.11em;text-transform:uppercase}
.ws-eyebrow:before{content:"";width:18px;height:2px;background:currentColor}
.ws-hero h1{max-width:760px;margin:18px 0 20px;font-size:clamp(42px,5.7vw,72px);line-height:1.13;letter-spacing:-.045em;font-weight:780}
.ws-lead{max-width:640px;color:var(--ws-muted);font-size:18px;line-height:1.85}
.ws-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-top:30px}
.ws-button{display:inline-flex;align-items:center;justify-content:center;gap:9px;min-height:45px;padding:11px 20px;border:1px solid var(--ws-accent);border-radius:10px;background:var(--ws-accent);color:#fff!important;text-decoration:none!important;font-size:14px;font-weight:700;transition:transform .2s,background .2s}
.ws-button:hover{transform:translateY(-2px);background:var(--ws-accent-dark)}
.ws-button.secondary{background:transparent;color:var(--ws-accent-dark)!important;border-color:#b7cabf}
.ws-button.secondary:hover{background:var(--ws-soft)}
.ws-visual{min-height:390px;border:1px solid #cddfd2;border-radius:22px;background:linear-gradient(155deg,#e8f2e8,#d9e8dc);position:relative;overflow:hidden;box-shadow:0 18px 60px rgba(34,73,56,.08)}
.ws-visual:before,.ws-visual:after{content:"";position:absolute;border:1px solid rgba(21,107,87,.2);border-radius:50%;width:560px;height:560px;left:15%;top:-35%}
.ws-visual:after{width:390px;height:390px;left:32%;top:-12%}
.ws-visual-inner{position:absolute;inset:35px;display:flex;flex-direction:column;justify-content:space-between;z-index:1}
.ws-visual-top{display:flex;justify-content:space-between;color:#245b49;font-size:12px;font-weight:700;letter-spacing:.1em}
.ws-visual-main{font-family:Georgia,"Songti SC",serif;color:#1b5945;font-size:clamp(64px,8vw,112px);line-height:1.04;letter-spacing:-.08em}
.ws-visual-bottom{display:flex;justify-content:space-between;align-items:end;color:#46705a;font-size:13px;line-height:1.7}
.ws-section{padding:74px 0;border-top:1px solid var(--ws-line)}
.ws-section-head{display:flex;justify-content:space-between;align-items:end;gap:24px;margin-bottom:28px}
.ws-section h2{margin:9px 0 0;font-size:clamp(29px,3vw,40px);letter-spacing:-.035em;line-height:1.25}
.ws-section-intro{margin:0;color:var(--ws-muted);line-height:1.75;max-width:650px}
.ws-text-link{color:var(--ws-accent-dark)!important;text-decoration:none!important;font-size:14px;font-weight:750;white-space:nowrap}
.ws-text-link:hover{text-decoration:underline!important}
.ws-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.ws-grid.two{grid-template-columns:repeat(2,minmax(0,1fr))}
.ws-card{display:flex;flex-direction:column;min-height:215px;padding:28px;border:1px solid var(--ws-line);border-radius:16px;background:var(--ws-surface);color:var(--ws-ink)!important;text-decoration:none!important;transition:transform .2s,border-color .2s,box-shadow .2s}
.ws-card:hover{transform:translateY(-3px);border-color:#9dc4ad;box-shadow:0 14px 32px rgba(27,70,49,.08)}
.ws-card-index{color:var(--ws-accent);font-size:12px;font-weight:800;letter-spacing:.11em}
.ws-card h3{margin:22px 0 8px;font-size:20px;line-height:1.4;letter-spacing:-.02em}
.ws-card p{margin:0;color:var(--ws-muted);font-size:14px;line-height:1.75}
.ws-card-arrow{margin-top:auto;padding-top:24px;color:var(--ws-accent);font-size:18px}
.ws-list{display:grid;gap:0;border-top:1px solid var(--ws-line)}
.ws-list a{display:grid;grid-template-columns:110px 1fr 32px;gap:20px;align-items:center;padding:21px 0;border-bottom:1px solid var(--ws-line);color:var(--ws-ink)!important;text-decoration:none!important}
.ws-list a:hover .ws-list-title{color:var(--ws-accent)}
.ws-list-tag{font-size:12px;color:var(--ws-accent);font-weight:750}.ws-list-title{font-size:17px;font-weight:680;line-height:1.5}
.ws-about{display:grid;grid-template-columns:1fr 1fr;gap:40px;align-items:start}.ws-about p{margin:0 0 15px;color:var(--ws-muted);line-height:1.85}
.ws-footer{border-top:1px solid var(--ws-line);padding:28px 0 45px;color:var(--ws-muted);font-size:13px}.ws-footer-inner{display:flex;justify-content:space-between;gap:20px;flex-wrap:wrap}.ws-footer a{color:var(--ws-accent-dark);text-decoration:none}
.ws-search{width:100%;max-width:430px;min-height:46px;padding:10px 15px;border:1px solid #b7cabf;border-radius:10px;background:white;color:var(--ws-ink);font:inherit;font-size:14px}
.ws-filters{display:flex;gap:8px;flex-wrap:wrap;margin:20px 0 28px}.ws-filter{border:1px solid var(--ws-line);border-radius:99px;background:white;color:var(--ws-muted);padding:8px 15px;cursor:pointer;font:inherit;font-size:13px}.ws-filter[aria-pressed=true]{background:var(--ws-accent);color:white;border-color:var(--ws-accent)}
.ws-detail-nav{background:var(--ws-bg);border-bottom:1px solid var(--ws-line);margin-bottom:24px}.ws-detail-nav .ws-nav{border:0}.ws-detail-note{max-width:1000px;margin:25px auto 45px;padding:18px 22px;background:#e8f1ea;border:1px solid #cbded0;border-radius:12px;color:#315848;font-size:13px;line-height:1.7}
.ws-upload-notice{margin:0 0 18px;padding:13px 16px;border:1px solid #cbded0;border-radius:10px;background:#e8f1ea;color:#315848;font-size:13px;line-height:1.7}
body:not(.ws-landing) .panel,body:not(.ws-landing) .tool-content{border:1px solid var(--ws-line)!important;box-shadow:0 8px 28px rgba(28,65,43,.05)!important;border-radius:14px!important}
body:not(.ws-landing) .header h1,body:not(.ws-landing) .game-title{color:var(--ws-ink)!important}
body:not(.ws-landing) .back-link,body:not(.ws-landing) .header a{color:var(--ws-accent)!important}
body:not(.ws-landing) button:not(.secondary):not(.tab-btn):not(.theme-toggle):not(.menu-toggle){background:var(--ws-accent)!important;color:white!important;border-radius:9px!important}
body:not(.ws-landing) button:not(.secondary):not(.tab-btn):hover{background:var(--ws-accent-dark)!important}
@media(max-width:800px){.ws-hero{grid-template-columns:1fr;padding:64px 0;gap:35px}.ws-visual{min-height:290px}.ws-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.ws-about{grid-template-columns:1fr}.ws-section{padding:55px 0}}
@media(max-width:600px){.ws-nav{padding:14px 18px;align-items:flex-start;flex-direction:column;gap:10px}.ws-links{gap:2px}.ws-links a{font-size:13px;padding:7px 9px}.ws-shell{padding:0 18px}.ws-hero h1{font-size:41px}.ws-lead{font-size:16px}.ws-visual{min-height:245px}.ws-grid,.ws-grid.two{grid-template-columns:1fr}.ws-card{min-height:180px}.ws-section-head{align-items:start;flex-direction:column}.ws-list a{grid-template-columns:1fr 24px;gap:4px}.ws-list-tag{grid-column:1/-1}.ws-list-title{font-size:15px}}
@media(max-width:500px){.ws-game-2048 .grid{grid-template-columns:repeat(4,min(17vw,80px));grid-template-rows:repeat(4,min(17vw,80px))}.ws-game-2048 .cell{width:min(17vw,80px);height:min(17vw,80px);font-size:1.25em}.ws-game-2048 .container{padding:34px 16px}.ws-game-2048 .game-container{max-width:100%}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important;animation:none!important}}

/* Shared treatment for tool and game detail pages. Legacy page CSS stays in place for mechanics. */
body.ws-tool-detail,body.ws-game-detail{margin:0!important;padding:0!important;min-height:100vh;line-height:1.65;letter-spacing:0;font-family:Inter,"PingFang SC","Microsoft YaHei",system-ui,sans-serif!important;background:var(--ws-bg)!important;color:var(--ws-ink)!important}
body.ws-game-detail{display:block!important;text-align:left!important}
body.ws-tool-detail .ws-detail-nav,body.ws-game-detail .ws-detail-nav{width:100%;margin:0 0 38px;background:#f6f7f3;border-bottom:1px solid var(--ws-line)}
body.ws-tool-detail .container,body.ws-game-detail .container{width:min(100%,1120px);max-width:1120px!important;margin:0 auto!important;padding:0 28px 60px!important;background:transparent!important}
body.ws-game-detail .container{max-width:760px!important;text-align:center}
body.ws-tool-detail .header,body.ws-game-detail .header{display:block!important;height:auto!important;margin:0 0 28px!important;padding:0 0 23px!important;background:transparent!important;border:0!important;border-bottom:1px solid var(--ws-line)!important;box-shadow:none!important;color:var(--ws-ink)!important;text-align:left!important;position:static!important}
body.ws-game-detail .header{text-align:left!important}
body.ws-tool-detail .header a,body.ws-game-detail .back-link{display:inline-block;margin:0 0 12px!important;color:var(--ws-accent-dark)!important;font:600 13px/1.5 Inter,"PingFang SC",system-ui,sans-serif!important;text-decoration:none!important}
body.ws-tool-detail .header a:hover,body.ws-game-detail .back-link:hover{text-decoration:underline!important}
body.ws-tool-detail .header h1,body.ws-tool-detail .page-title,body.ws-game-detail .game-title,body.ws-game-detail h1{margin:0 0 6px!important;color:var(--ws-ink)!important;font-family:Inter,"PingFang SC",system-ui,sans-serif!important;font-size:clamp(27px,3.6vw,39px)!important;line-height:1.24!important;font-weight:760!important;letter-spacing:-.04em!important}
body.ws-tool-detail .page-desc,body.ws-game-detail .game-desc{color:var(--ws-muted)!important;font-family:Inter,"PingFang SC",system-ui,sans-serif!important;font-size:15px!important;line-height:1.75!important}
body.ws-tool-detail .panel,body.ws-tool-detail .main-panel,body.ws-tool-detail .result-panel,body.ws-tool-detail .editor,body.ws-game-detail .stats,body.ws-game-detail .score,body.ws-game-detail .status,body.ws-game-detail .message,body.ws-game-detail .controls,body.ws-game-detail .instructions{border:1px solid var(--ws-line)!important;border-radius:16px!important;background:#fff!important;color:var(--ws-ink)!important;box-shadow:0 10px 32px rgba(24,58,42,.045)!important}
body.ws-tool-detail .panel,body.ws-tool-detail .main-panel,body.ws-tool-detail .result-panel{padding:24px!important}
body.ws-tool-detail .panel-title,body.ws-tool-detail .result-title,body.ws-tool-detail .panel h3{color:var(--ws-ink)!important;font-size:16px!important;font-weight:720!important;border-color:var(--ws-line)!important}
body.ws-tool-detail .panel-title::before{background:var(--ws-accent)!important}
body.ws-tool-detail label,body.ws-tool-detail .form-group label{color:var(--ws-muted)!important;font-family:Inter,"PingFang SC",system-ui,sans-serif!important}
body.ws-tool-detail textarea,body.ws-tool-detail input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]),body.ws-tool-detail select,body.ws-tool-detail .output,body.ws-tool-detail .output-box,body.ws-tool-detail .output-area,body.ws-tool-detail .result-box,body.ws-tool-detail .preview{border:1px solid #cbd9ce!important;border-radius:10px!important;background:#fbfcf9!important;color:var(--ws-ink)!important;box-shadow:none!important}
body.ws-tool-detail textarea:focus,body.ws-tool-detail input:focus,body.ws-tool-detail select:focus{border-color:var(--ws-accent)!important;outline:3px solid #cce6d7!important;outline-offset:1px}
body.ws-tool-detail button,body.ws-tool-detail .btn,body.ws-game-detail button,body.ws-game-detail .btn{font-family:Inter,"PingFang SC",system-ui,sans-serif!important;font-weight:650!important;letter-spacing:0;border-radius:10px!important;box-shadow:none!important}
body.ws-tool-detail button:not(.secondary):not(.tab-btn):not(.template-btn),body.ws-tool-detail .btn-primary,body.ws-game-detail .btn,body.ws-game-detail .restart-btn,body.ws-game-detail .start-btn{background:var(--ws-accent)!important;color:#fff!important;border:1px solid var(--ws-accent)!important}
body.ws-tool-detail button:not(.secondary):not(.tab-btn):not(.template-btn):hover,body.ws-game-detail .btn:hover{background:var(--ws-accent-dark)!important;border-color:var(--ws-accent-dark)!important;transform:translateY(-1px)}
body.ws-tool-detail button.secondary,body.ws-tool-detail .btn-secondary,body.ws-tool-detail .template-btn,body.ws-tool-detail .tab-btn,body.ws-game-detail .diff-btn{background:#fff!important;color:var(--ws-accent-dark)!important;border:1px solid #abc9b8!important}
body.ws-tool-detail .tab-btn.active,body.ws-game-detail .diff-btn.active{background:var(--ws-soft)!important;color:var(--ws-accent-dark)!important;border-color:var(--ws-accent)!important}
body.ws-tool-detail .upload-area{background:#f7faf6!important;border:2px dashed #a8c4b1!important;border-radius:14px!important}
body.ws-tool-detail .upload-area:hover,body.ws-tool-detail .upload-area.dragover{background:#e8f1ea!important;border-color:var(--ws-accent)!important}
body.ws-tool-detail .progress-fill{background:var(--ws-accent)!important}
body.ws-game-detail .stats,body.ws-game-detail .score,body.ws-game-detail .status,body.ws-game-detail .message,body.ws-game-detail .controls,body.ws-game-detail .instructions{padding:16px 20px!important;margin-bottom:16px!important}
body.ws-game-detail .stat-label,body.ws-game-detail .score-label,body.ws-game-detail .game-desc{color:var(--ws-muted)!important}
body.ws-game-detail .stat-value,body.ws-game-detail .score-value{color:var(--ws-accent)!important}
body.ws-game-detail .game-container,body.ws-game-detail .board-container,body.ws-game-detail .canvas-container,body.ws-game-detail .game-board{border-radius:16px!important;box-shadow:0 14px 35px rgba(23,54,39,.08)!important}
body.ws-game-detail .game-container,body.ws-game-detail .board-container,body.ws-game-detail .canvas-container{background:#244a3d!important}
body.ws-game-detail .game-board{background:#244a3d!important;border-color:#244a3d!important}
body.ws-game-detail .cell{border-radius:7px}
body.ws-game-detail .mobile-btn{background:var(--ws-accent)!important;color:white!important;border-color:var(--ws-accent)!important}
body.ws-game-detail .difficulty-bar{justify-content:center;flex-wrap:wrap}
body.ws-game-detail .ws-detail-note,body.ws-tool-detail .ws-detail-note{max-width:1120px;margin:8px auto 54px}
@media(max-width:700px){body.ws-tool-detail .container,body.ws-game-detail .container{padding:0 18px 45px!important}body.ws-tool-detail .panel,body.ws-tool-detail .main-panel,body.ws-tool-detail .result-panel{padding:18px!important}body.ws-tool-detail .main-grid{grid-template-columns:1fr!important}body.ws-game-detail .game-board{max-width:calc(100vw - 36px);overflow:auto}body.ws-game-detail .ws-detail-note,body.ws-tool-detail .ws-detail-note{margin:8px 18px 40px}}

/* One page frame for every tool and game. Individual canvases keep their own controls. */
body.ws-tool-detail .container > .header,body.ws-game-detail .container > .header{margin-bottom:24px!important}
body.ws-tool-detail .container > .header .page-desc,body.ws-game-detail .container > .header .game-desc{margin:6px 0 0!important}
body.ws-tool-detail .container > .header .back-link,body.ws-game-detail .container > .header .back-link{margin-bottom:14px!important}
body.ws-tool-detail .container > .panel,body.ws-tool-detail .container > .main-panel,body.ws-tool-detail .container > .result-panel{margin-bottom:18px!important}
body.ws-tool-detail .container > .panel .panel-title,body.ws-tool-detail .container > .main-panel .panel-title{margin:0 0 16px!important}
body.ws-tool-detail .container > .panel .panel-title::before,body.ws-tool-detail .container > .main-panel .panel-title::before{content:"";display:inline-block;width:4px;height:18px;margin-right:9px;border-radius:4px;background:var(--ws-accent);vertical-align:-3px}
body.ws-tool-simple .container > .panel textarea{display:block;width:100%;min-height:170px;padding:15px!important;font-family:"SFMono-Regular",Consolas,Monaco,monospace!important;font-size:14px!important;line-height:1.65!important;resize:vertical}
body.ws-tool-simple .container > .panel .btn-group{display:flex;flex-wrap:wrap;gap:10px;margin:16px 0 0}
body.ws-tool-simple .container > .panel button{margin:0!important;padding:10px 18px!important}
body.ws-tool-simple .container > .panel.output{margin-top:0}
body.ws-tool-color .ws-picker-panel{padding:24px!important}
body.ws-tool-color .picker-row{gap:24px}
body.ws-tool-color .sv-canvas-wrap,body.ws-tool-color .hue-wrap{border-color:#cbd9ce}
body.ws-tool-color .value-row{background:#f5f8f3;border:1px solid var(--ws-line);border-radius:10px}
body.ws-tool-color .value-row label,body.ws-tool-color .rgb-input-group span,body.ws-tool-color .hsl-input-group span,body.ws-tool-color .native-picker-row label,body.ws-tool-color .history-section h3{color:var(--ws-muted)!important}
body.ws-tool-color .value-row input,body.ws-tool-color .rgb-input-group input,body.ws-tool-color .hsl-input-group input{min-width:0;font-family:"SFMono-Regular",Consolas,Monaco,monospace!important}
body.ws-tool-color .preview-box{border-color:var(--ws-line)}
body.ws-tool-color .history-swatch{border-color:var(--ws-line)}
body.ws-tool-markdown .editor{max-width:1120px;gap:18px}
body.ws-tool-markdown .editor > .panel{min-width:0}
body.ws-tool-markdown .toolbar{background:#f5f8f3;border-color:var(--ws-line)}
body.ws-tool-detail.ws-tool-markdown .toolbar button:not(.secondary):not(.tab-btn):not(.template-btn){background:#fff!important;color:var(--ws-accent-dark)!important;border:1px solid #abc9b8!important;padding:6px 10px!important}
body.ws-tool-detail.ws-tool-markdown .toolbar button:not(.secondary):not(.tab-btn):not(.template-btn):hover{background:var(--ws-soft)!important;color:var(--ws-accent-dark)!important}
body.ws-tool-markdown .preview-wrap{border-color:var(--ws-line)}
body.ws-tool-markdown .preview a{color:var(--ws-accent)}
body.ws-tool-markdown .preview blockquote{border-left-color:var(--ws-accent);background:var(--ws-soft)}
body.ws-game-minesweeper .difficulty-bar{justify-content:flex-start;margin-bottom:16px}
body.ws-game-minesweeper .controls{justify-content:center;max-width:500px;margin:0 auto 18px!important}
body.ws-game-minesweeper .ws-board-scroll{max-width:100%;overflow-x:auto;padding-bottom:12px}
body.ws-game-minesweeper .game-board{width:max-content;max-width:none!important;margin:0 auto;overflow:visible!important}
body.ws-game-minesweeper .message,body.ws-game-minesweeper .instructions{max-width:760px;margin:12px auto!important}
body.ws-game-airplane .game-container{width:min(100%,400px);margin:0 auto 18px;background:transparent!important;box-shadow:none!important}
body.ws-game-airplane #gameCanvas{display:block;width:100%;height:auto;border:0;border-radius:16px;box-shadow:0 14px 35px rgba(23,54,39,.12)}
body.ws-game-airplane .instructions{max-width:440px;margin:0 auto!important}
body.ws-game-snake .canvas-container{max-width:100%;padding:4px!important}
body.ws-game-snake #gameCanvas{display:block;max-width:100%;height:auto}
body.ws-game-gomoku .board-container{max-width:100%;padding:12px!important}
body.ws-game-gomoku .board{--ws-cell:min(30px,calc((100vw - 84px)/15));grid-template-columns:repeat(15,var(--ws-cell));grid-template-rows:repeat(15,var(--ws-cell))}
body.ws-game-gomoku .board .cell{width:var(--ws-cell);height:var(--ws-cell)}
body.ws-game-gomoku .board .stone{width:calc(var(--ws-cell) - 4px);height:calc(var(--ws-cell) - 4px)}
@media(max-width:700px){body.ws-tool-color .ws-picker-panel{padding:18px!important}body.ws-tool-color .picker-area{min-width:0}body.ws-tool-color .controls-area{flex-basis:100%}body.ws-tool-markdown .editor{height:auto;min-height:0;flex-direction:column}body.ws-tool-markdown .editor > .panel{min-height:360px}body.ws-game-minesweeper .difficulty-bar{justify-content:center}}
.ws-seo-guide{width:calc(100% - 36px);max-width:1120px;margin:0 auto 54px;padding:22px 26px;border:1px solid #d8e2da;border-radius:14px;background:#fff;color:#30443c;font:15px/1.8 -apple-system,BlinkMacSystemFont,'PingFang SC','Microsoft YaHei',sans-serif}
.ws-seo-guide h2{margin:0 0 8px;color:#193d30;font-size:19px;line-height:1.4}
.ws-seo-guide p{margin:0}
