driver / static /index.html
bevisssssss's picture
fix: recover from expired admin token instead of showing a load error
79dca2e
Raw History Blame Contribute Delete
53.8 kB
<!DOCTYPE html> <html lang="en" data-theme="cool"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width,initial-scale=1.0"> <title>MES Info Query</title> <link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ctext y='.9em' font-size='90'%3E%F0%9F%93%A6%3C/text%3E%3C/svg%3E"> <style> /* โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• Design System โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• */ :root { --bg-page:#f0f4f8; --bg-card:#fff; --bg-subtle:#f8fafc; --text-primary:#0f172a; --text-secondary:#475569; --text-muted:#94a3b8; --border-light:#e2e8f0; --border-subtle:#f1f5f9; --shadow-card:0 1px 3px rgba(0,0,0,.04),0 1px 2px rgba(0,0,0,.06); --shadow-hover:0 10px 30px -5px rgba(0,0,0,.1),0 4px 6px -2px rgba(0,0,0,.05); --header-start:#0b1426; --header-mid:#14203a; --header-end:#0b1426; --header-text:#f1f5f9; --header-sub:#64748b; --glow-1:rgba(59,130,246,.08); --glow-2:rgba(139,92,246,.08); --accent:#3b82f6; --accent-strong:#2563eb; --chip-bg:#eff6ff; --chip-text:#1d4ed8; --muted-bg:#f1f5f9; --ok:#16a34a; --err:#dc2626; --bg-pattern:rgba(59,130,246,.015); } [data-theme="warm"] { --bg-page:#fef7ee; --bg-card:#fff; --bg-subtle:#fffbeb; --text-primary:#1c1917; --text-secondary:#57534e; --text-muted:#a8a29e; --border-light:#e7e5e4; --border-subtle:#f5f5f4; --shadow-card:0 1px 3px rgba(120,80,40,.04),0 1px 2px rgba(120,80,40,.06); --shadow-hover:0 10px 30px -5px rgba(120,80,40,.1),0 4px 6px -2px rgba(120,80,40,.05); --header-start:#1c130d; --header-mid:#2d1f14; --header-end:#1c130d; --header-text:#fefce8; --header-sub:#a8a29e; --glow-1:rgba(245,158,11,.07); --glow-2:rgba(239,68,68,.06); --accent:#d97706; --accent-strong:#b45309; --chip-bg:#fef3c7; --chip-text:#92400e; --muted-bg:#fef3c7; --ok:#15803d; --err:#dc2626; --bg-pattern:rgba(245,158,11,.015); } *{margin:0;padding:0;box-sizing:border-box} body{ font-family:"PingFang SC","Microsoft YaHei","Noto Sans SC","Helvetica Neue",Arial,sans-serif; background:var(--bg-page);color:var(--text-primary);min-height:100vh; transition:background .4s ease,color .3s ease; } body::before{ content:'';position:fixed;inset:0;z-index:-1; background-image:linear-gradient(var(--bg-pattern) 1px,transparent 1px), linear-gradient(90deg,var(--bg-pattern) 1px,transparent 1px); background-size:60px 60px; } .hidden{display:none!important} a{color:inherit} /* โ”€โ”€ Theme toggle โ”€โ”€ */ .theme-toggle{ position:fixed;top:18px;right:18px;z-index:100;width:42px;height:42px;border-radius:50%; border:2px solid var(--border-light);background:var(--bg-card);cursor:pointer;font-size:19px; display:flex;align-items:center;justify-content:center;transition:all .3s cubic-bezier(.4,0,.2,1); box-shadow:0 2px 12px rgba(0,0,0,.08); } .theme-toggle:hover{transform:scale(1.1);box-shadow:0 4px 20px rgba(0,0,0,.12)} /* โ”€โ”€ Header โ”€โ”€ */ .header{ background:linear-gradient(135deg,var(--header-start) 0%,var(--header-mid) 50%,var(--header-end) 100%); color:var(--header-text);padding:30px 0 26px;position:relative;overflow:hidden; transition:background .4s ease; } .header::before{ content:'';position:absolute;top:-50%;left:-50%;width:200%;height:200%; background:radial-gradient(ellipse at 30% 50%,var(--glow-1) 0%,transparent 60%), radial-gradient(ellipse at 70% 50%,var(--glow-2) 0%,transparent 60%); } .header-inner{ position:relative;max-width:1100px;margin:0 auto;padding:0 24px; display:flex;align-items:center;justify-content:space-between;gap:20px;flex-wrap:wrap; } .brand h1{font-size:26px;font-weight:700;letter-spacing:.5px} .brand .sub{color:var(--header-sub);font-size:13px;margin-top:6px} .top-nav{display:flex;align-items:center;gap:8px;flex-wrap:wrap} .top-nav a,.lang-btn{ font-size:13px;color:var(--header-text);text-decoration:none;padding:8px 14px;border-radius:8px; background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.14); transition:background .2s;cursor:pointer;font-family:inherit; } .top-nav a:hover,.lang-btn:hover{background:rgba(255,255,255,.18)} .lang-btn{font-weight:600;min-width:64px} /* โ”€โ”€ Layout โ”€โ”€ */ .wrap{max-width:1100px;margin:0 auto;padding:28px 24px 60px} .card{ background:var(--bg-card);border:1px solid var(--border-light);border-radius:14px; box-shadow:var(--shadow-card);padding:22px; } /* โ”€โ”€ Gate โ”€โ”€ */ .gate{max-width:440px;margin:40px auto;text-align:center} .gate h2{font-size:20px;margin-bottom:10px} .gate p{color:var(--text-secondary);font-size:13px;line-height:1.6;margin-bottom:18px} .gate .row{display:flex;gap:10px} input[type=text],input[type=password]{ flex:1;padding:12px 14px;border:1px solid var(--border-light);border-radius:10px; font-size:15px;font-family:inherit;background:var(--bg-subtle);color:var(--text-primary);outline:none; transition:border-color .2s,box-shadow .2s; } input[type=text]:focus,input[type=password]:focus{border-color:var(--accent);box-shadow:0 0 0 3px var(--glow-1)} .btn{ padding:12px 22px;border:none;border-radius:10px;background:var(--accent);color:#fff; font-size:15px;font-weight:600;font-family:inherit;cursor:pointer;transition:background .2s,transform .1s; white-space:nowrap; } .btn:hover{background:var(--accent-strong)} .btn:active{transform:scale(.98)} .btn:disabled{opacity:.55;cursor:not-allowed} .btn-ghost{ padding:8px 14px;border:1px solid var(--border-light);border-radius:9px;background:var(--bg-card); color:var(--text-secondary);font-size:13px;font-weight:600;font-family:inherit;cursor:pointer;transition:all .2s; } .btn-ghost:hover{border-color:var(--accent);color:var(--accent)} /* โ”€โ”€ Query โ”€โ”€ */ .query-card{margin-top:6px} .query-row{display:flex;gap:12px} .err{color:var(--err);font-size:13px;margin-top:12px} .progress-wrap{margin-top:18px} .progress-bar{height:8px;background:var(--muted-bg);border-radius:6px;overflow:hidden} .progress-bar > div{height:100%;width:0;background:linear-gradient(90deg,var(--accent),var(--accent-strong));transition:width .35s ease} .progress-msg{font-size:13px;color:var(--text-secondary);margin-top:8px} /* โ”€โ”€ Result toolbar โ”€โ”€ */ .result-toolbar{ display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:20px 0 14px; } .search-input{flex:1;min-width:180px} .toggle-label{display:flex;align-items:center;gap:7px;font-size:13px;color:var(--text-secondary);cursor:pointer;user-select:none} .toggle-label input{width:16px;height:16px;cursor:pointer} .badge-cached{ font-size:12px;padding:4px 10px;border-radius:20px;background:var(--muted-bg);color:var(--text-secondary);font-weight:600; } .badge-sn{font-size:12px;padding:4px 10px;border-radius:20px;background:var(--chip-bg);color:var(--chip-text);font-weight:600} /* โ”€โ”€ Sections โ”€โ”€ */ .sect{margin-bottom:16px;padding:0;overflow:hidden} .sect-title{ font-size:14px;font-weight:700;padding:14px 20px;border-bottom:1px solid var(--border-subtle); color:var(--text-primary);letter-spacing:.3px; } .sect.summary{background:linear-gradient(135deg,var(--chip-bg),transparent 70%)} .frows{display:grid;grid-template-columns:repeat(auto-fill,minmax(320px,1fr));gap:0} .frow{ display:flex;align-items:baseline;gap:10px;padding:11px 20px;border-bottom:1px solid var(--border-subtle); min-width:0; } .flabel{flex:0 0 132px;font-size:12.5px;color:var(--text-muted);font-weight:600;word-break:break-word} .fval{ flex:1;min-width:0;font-size:13.5px;color:var(--text-primary);word-break:break-word;cursor:copy; padding:2px 6px;border-radius:6px;transition:background .15s; } .fval:hover{background:var(--bg-subtle)} .fval.muted{color:var(--text-muted);cursor:default} .fval.muted:hover{background:none} /* Wide modules: full-width rows so long OS strings stay on few lines */ .sect.wide .frows{grid-template-columns:1fr} .sect.wide .flabel{flex:0 0 150px} .sect.wide .fval{font-size:13px;line-height:1.6} /* Collapsed secondary fields */ .sect.more>summary{cursor:pointer;list-style:none;user-select:none} .sect.more>summary::-webkit-details-marker{display:none} .sect.more>summary::before{content:'โ–ธ ';color:var(--text-muted)} .sect.more[open]>summary::before{content:'โ–พ '} .more-body{border-top:1px solid var(--border-subtle)} .more-body .sect{border:none;border-radius:0;box-shadow:none;margin:0;border-bottom:1px solid var(--border-subtle)} .more-body .sect-title{font-size:13px;padding:12px 20px;color:var(--text-secondary)} /* โ”€โ”€ Raw JSON โ”€โ”€ */ .raw-box{margin-top:8px;border:1px solid var(--border-light);border-radius:12px;overflow:hidden;background:var(--bg-card)} .raw-box summary{padding:14px 20px;font-size:13px;font-weight:600;cursor:pointer;color:var(--text-secondary);list-style:none} .raw-box summary::-webkit-details-marker{display:none} .raw-box summary::before{content:'{ } ';color:var(--accent)} .raw-box pre{ margin:0;padding:16px 20px;background:var(--bg-subtle);font-family:"SFMono-Regular",Consolas,"Liberation Mono",monospace; font-size:12px;line-height:1.6;max-height:480px;overflow:auto;white-space:pre;color:var(--text-secondary); border-top:1px solid var(--border-subtle); } /* โ”€โ”€ Toast โ”€โ”€ */ .toast{ position:fixed;bottom:28px;left:50%;transform:translateX(-50%) translateY(20px);opacity:0; background:#0f172a;color:#fff;padding:11px 22px;border-radius:10px;font-size:13.5px;pointer-events:none; transition:all .25s ease;z-index:200;box-shadow:0 8px 24px rgba(0,0,0,.2); } .toast.show{opacity:1;transform:translateX(-50%) translateY(0)} .toast.err{background:var(--err)} /* โ”€โ”€ MEGA manual search โ”€โ”€ */ .mega-card{margin-top:8px;padding:20px} .mega-card h3{font-size:14.5px;font-weight:700;margin-bottom:4px} .mega-hint{font-size:12.5px;color:var(--text-muted);margin-bottom:12px;line-height:1.5} .mega-chips{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:12px} .chip{border:1px solid var(--border-light);background:var(--bg-subtle);color:var(--text-secondary);font:inherit;font-size:11.5px;padding:5px 10px;border-radius:999px;cursor:pointer;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;transition:border-color .15s,color .15s} .chip:hover{border-color:var(--accent);color:var(--accent)} .chip-k{font-weight:700;color:var(--accent);margin-right:5px} .mega-row{display:flex;gap:10px;align-items:center} .mega-row input{flex:1;min-width:0;padding:11px 14px;border:1px solid var(--border-light);border-radius:10px;font:inherit;font-size:13.5px;background:var(--bg-card);color:var(--text-primary)} .mega-results{margin-top:14px;display:flex;flex-direction:column;gap:8px} .mega-item{display:flex;align-items:center;gap:12px;padding:11px 14px;border:1px solid var(--border-light);border-radius:10px;background:var(--bg-subtle)} .mega-name{flex:1;min-width:0;font-size:12.5px;word-break:break-all;font-family:"SFMono-Regular",Consolas,"Liberation Mono",monospace} .mega-size{font-size:11.5px;color:var(--text-muted);margin-top:2px} .mega-act{display:flex;gap:6px;flex-shrink:0} .mega-none{font-size:12.5px;color:var(--text-muted);padding:4px 0} .map-list{display:flex;flex-direction:column;gap:8px} .map-item{display:flex;align-items:center;gap:10px;padding:10px 12px;border:1px solid var(--border-light);border-radius:10px;background:var(--bg-subtle)} .map-item .mega-name{flex:1} .map-none{font-size:12.5px;color:var(--text-muted);padding:2px 0} .map-actions{margin-top:14px} .modal{position:fixed;inset:0;background:rgba(15,23,42,.55);display:flex;align-items:center;justify-content:center;z-index:200;padding:20px} .modal.hidden{display:none} .modal-box{background:var(--bg-card);border:1px solid var(--border-light);border-radius:14px;padding:22px;width:100%;max-width:520px;max-height:90vh;overflow:auto} .modal-box h3{margin:0 0 6px;font-size:16px} .modal-box label{display:block;font-size:12px;color:var(--text-secondary);margin:14px 0 6px} .modal-box select,.modal-box textarea,.modal-box input{width:100%;box-sizing:border-box;padding:10px 12px;border:1px solid var(--border-light);border-radius:9px;font:inherit;font-size:13px;background:var(--bg-card);color:var(--text-primary)} .modal-box textarea{min-height:100px;resize:vertical} .modal-actions{display:flex;gap:10px;justify-content:flex-end;margin-top:20px} @media(max-width:640px){ .mega-row{flex-direction:column;align-items:stretch} .map-item{flex-direction:column;align-items:flex-start} .mega-item{flex-direction:column;align-items:flex-start} } @media(max-width:640px){ .theme-toggle{top:12px;right:12px;width:38px;height:38px;font-size:16px} .brand h1{font-size:21px} .wrap{padding:18px 14px 50px} .frows{grid-template-columns:1fr} .frow{padding:10px 16px} .flabel{flex-basis:104px;font-size:12px} .query-row{flex-direction:column} } </style> </head> <body> <button class="theme-toggle" id="themeToggle" title="Theme">โ„๏ธ</button> <div class="header"> <div class="header-inner"> <div class="brand"> <h1 id="appTitle">MES Info Query</h1> <div class="sub" id="appSub"></div> </div> <nav class="top-nav"> <a href="admin.html" id="navAdmin"></a> <button class="lang-btn" id="langToggle" onclick="toggleLang()">ไธญๆ–‡</button> </nav> </div> </div> <div class="wrap"> <!-- Access gate --> <section id="gate" class="card gate hidden"> <h2 id="gateTitle"></h2> <p id="gateDesc"></p> <div class="row"> <input type="password" id="codeInput" autocomplete="off"> <button class="btn" id="accessBtn" onclick="verifyCode()"></button> </div> <div class="err hidden" id="gateError"></div> </section> <!-- Query --> <section id="queryCard" class="card query-card hidden"> <div class="query-row"> <input type="text" id="snInput" autocomplete="off" spellcheck="false"> <button class="btn" id="queryBtn" onclick="doQuery()"></button> </div> <div class="progress-wrap hidden" id="progressWrap"> <div class="progress-bar"><div id="progressFill"></div></div> <div class="progress-msg" id="progressMsg"></div> </div> <div class="err hidden" id="queryError"></div> </section> <!-- Results --> <section id="results" class="hidden"> <div class="result-toolbar"> <input type="text" class="search-input" id="fieldSearch" oninput="applyFilter()"> <label class="toggle-label"><input type="checkbox" id="emptyToggle" onchange="applyFilter()"><span id="showEmptyLabel"></span></label> <button class="btn-ghost" id="copyJsonBtn" onclick="copyJson()"></button> <button class="btn-ghost" id="downloadJsonBtn" onclick="downloadJson()"></button> <button class="btn-ghost" id="relockBtn" onclick="relock()"></button> <span class="badge-sn hidden" id="snBadge"></span> <span class="badge-cached hidden" id="cachedBadge"></span> </div> <div id="sections"></div> <!-- MEGA manual search --> <section class="card mega-card" id="megaCard"> <h3 id="megTitle"></h3> <div class="mega-hint" id="megHint"></div> <div class="mega-chips" id="megChips"></div> <div class="mega-row"> <input type="text" id="megInput" autocomplete="off" spellcheck="false"> <button class="btn" id="megBtn" onclick="doMegaSearch()"></button> </div> <div class="mega-results" id="megResults"></div> </section> <!-- OS name mapping --> <section class="card mega-card" id="mapCard"> <h3 id="mapTitle"></h3> <div class="mega-hint" id="mapHint"></div> <div class="map-list" id="mapList"></div> <div class="map-actions"><button class="btn-ghost" id="reportBtn" onclick="openReport()"></button></div> </section> <details class="raw-box" id="rawBox"> <summary id="rawSummary"></summary> <pre id="rawPre"></pre> </details> </section> </div> <div class="modal hidden" id="reportModal"> <div class="modal-box"> <h3 id="repTitle"></h3> <label id="repTypeLabel" for="repType"></label> <select id="repType" onchange="onReportTypeChange()"></select> <label id="repFieldLabel" for="repField"></label> <select id="repField" onchange="onReportFieldChange()"></select> <label id="repOsLabel" for="repOs"></label> <input type="text" id="repOs" autocomplete="off"> <label id="repDescLabel" for="repDesc"></label> <textarea id="repDesc"></textarea> <div class="modal-actions"> <button class="btn-ghost" id="repCancel" onclick="closeReport()"></button> <button class="btn" id="repSubmit" onclick="submitReport()"></button> </div> </div> </div> <div class="toast" id="toast"></div> <script> /* โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• i18n โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• */ const I18N = { en: { title:"MES Info Query", sub:"Query device production & system info by SN", navAdmin:"Admin", gateTitle:"Access Code Required", gateDesc:"Enter the access code to use MES query. You only need to do this once per browser.", codePh:"Access code", verifyBtn:"Verify", accessError:"Invalid access code", serverError:"Server error, please retry", networkError:"Network error, please retry", snPh:"Enter SN, e.g. M1TA688A0NXA25M0356", queryBtn:"Query", queueing:"Submitting...", querying:"Querying...", showEmpty:"Show empty fields", searchPh:"Search fields...", copyJson:"Copy JSON", downloadJson:"Download JSON", relock:"Change code", cached:"cached", summary:"Device Summary", additional:"Additional Fields", noData:"No data returned", copied:"Copied", copyFail:"Copy failed", rawJson:"Raw JSON", emptyNote:"No matching fields", megTitle:"Manual MEGA Search", megHint:"MES OS names often carry dirty prefixes. Click a detected name below, or paste the correct file name, then search MEGA for the download link.", megSearchPh:"Paste or edit an OS file name, e.g. SCD_20250610_...", megSearchBtn:"Search MEGA", megSearching:"Searching MEGA...", megNoResult:"No matching file in MEGA", megRefreshing:"Refreshing MEGA index (about 30s)...", megIndexRefreshed:"MEGA index refreshed", megResultCount:"{n} result(s)", megDownload:"Open", megCopy:"Copy", megLinkFail:"Link generation failed", megNoCand:"No OS name detected โ€” paste one manually", mapTitle:"OS Name Mapping", mapHint:"Some MES OS names are non-standard. Admins map them to real MEGA file names; mapped files are listed here.", mapNone:"No mapping registered for this OS name yet", mapMapped:"Mapped", reportBtn:"Report an Issue", repTitle:"Report an Issue", repTypeLabel:"Issue type", repFieldLabel:"Which field", repOsLabel:"Field content / file name", repDescLabel:"Details", repDescPh:"Describe the problem, e.g. this OS name has no mapping, or the file is missing on MEGA", repCancel:"Cancel", repSubmit:"Submit", repOk:"Report submitted, thank you!", repFail:"Submit failed, please retry" }, zh: { title:"MES ไฟกๆฏๆŸฅ่ฏข", sub:"้€š่ฟ‡ SN ๆŸฅ่ฏข่ฎพๅค‡็”ŸไบงไธŽ็ณป็ปŸไฟกๆฏ", navAdmin:"็ฎก็†ๅŽๅฐ", gateTitle:"้œ€่ฆ่ฎฟ้—ฎ็ ", gateDesc:"่พ“ๅ…ฅ่ฎฟ้—ฎ็ ๅณๅฏไฝฟ็”จ MES ๆŸฅ่ฏขใ€‚ๆฏไธชๆต่งˆๅ™จๅช้œ€่พ“ๅ…ฅไธ€ๆฌกใ€‚", codePh:"่ฎฟ้—ฎ็ ", verifyBtn:"้ชŒ่ฏ", accessError:"่ฎฟ้—ฎ็ ้”™่ฏฏ", serverError:"ๆœๅŠกๅ™จ้”™่ฏฏ๏ผŒ่ฏท้‡่ฏ•", networkError:"็ฝ‘็ปœ้”™่ฏฏ๏ผŒ่ฏท้‡่ฏ•", snPh:"่ฏท่พ“ๅ…ฅ SN๏ผŒไพ‹ๅฆ‚ M1TA688A0NXA25M0356", queryBtn:"ๆŸฅ่ฏข", queueing:"ๆไบคไธญ...", querying:"ๆŸฅ่ฏขไธญ...", showEmpty:"ๆ˜พ็คบ็ฉบๅญ—ๆฎต", searchPh:"ๆœ็ดขๅญ—ๆฎต...", copyJson:"ๅคๅˆถ JSON", downloadJson:"ไธ‹่ฝฝ JSON", relock:"ๆ›ดๆข่ฎฟ้—ฎ็ ", cached:"ๆฅ่‡ช็ผ“ๅญ˜", summary:"่ฎพๅค‡ๆฆ‚่ฆ", additional:"ๅ…ถไป–ๅญ—ๆฎต", noData:"ๆœช่ฟ”ๅ›žๆ•ฐๆฎ", copied:"ๅทฒๅคๅˆถ", copyFail:"ๅคๅˆถๅคฑ่ดฅ", rawJson:"ๅŽŸๅง‹ JSON", emptyNote:"ๆ— ๅŒน้…ๅญ—ๆฎต", megTitle:"ๆ‰‹ๅŠจ MEGA ๆฃ€็ดข", megHint:"MES ่ฟ”ๅ›ž็š„ OS ๅ็งฐๅธธๅธฆ่„ๆ•ฐๆฎใ€‚็‚นๅ‡ปไธ‹ๆ–น่ฏ†ๅˆซๅ‡บ็š„ๅ็งฐ๏ผŒๆˆ–็ฒ˜่ดดๆญฃ็กฎ็š„ๆ–‡ไปถๅ๏ผŒๅ†ไปŽ MEGA ๆฃ€็ดขไธ‹่ฝฝ้“พๆŽฅใ€‚", megSearchPh:"็ฒ˜่ดดๆˆ–ไฟฎๆ”น OS ๆ–‡ไปถๅ๏ผŒไพ‹ๅฆ‚ SCD_20250610_...", megSearchBtn:"ๆฃ€็ดข MEGA", megSearching:"ๆญฃๅœจๆฃ€็ดข MEGA...", megNoResult:"MEGA ไธญๆฒกๆœ‰ๅŒน้…ๆ–‡ไปถ", megRefreshing:"ๆญฃๅœจๅˆทๆ–ฐ MEGA ็ดขๅผ•๏ผˆ็บฆ 30 ็ง’๏ผ‰โ€ฆ", megIndexRefreshed:"ๅทฒๅˆทๆ–ฐ MEGA ็ดขๅผ•", megResultCount:"ๅ…ฑ {n} ๆก็ป“ๆžœ", megDownload:"ๆ‰“ๅผ€", megCopy:"ๅคๅˆถ", megLinkFail:"้“พๆŽฅ็”Ÿๆˆๅคฑ่ดฅ", megNoCand:"ๆœช่ฏ†ๅˆซๅˆฐ OS ๅ็งฐ๏ผŒ่ฏทๆ‰‹ๅŠจ็ฒ˜่ดด", mapTitle:"OS ๅ็งฐๆ˜ ๅฐ„", mapHint:"้ƒจๅˆ† MES OS ๅ็งฐไธ่ง„่Œƒ๏ผŒ็ฎก็†ๅ‘˜ไผšๅฐ†ๅ…ถๆ˜ ๅฐ„ไธบ็œŸๅฎž็š„ MEGA ๆ–‡ไปถๅ๏ผŒๆ˜ ๅฐ„็ป“ๆžœๅœจๆญคๆ˜พ็คบใ€‚", mapNone:"่ฏฅ OS ๅ็งฐๅฐšๆœช็™ป่ฎฐๆ˜ ๅฐ„", mapMapped:"ๅทฒๆ˜ ๅฐ„", reportBtn:"้—ฎ้ข˜ไธŠๆŠฅ", repTitle:"้—ฎ้ข˜ไธŠๆŠฅ", repTypeLabel:"้—ฎ้ข˜็ฑปๅž‹", repFieldLabel:"้—ฎ้ข˜ๅญ—ๆฎต", repOsLabel:"ๅญ—ๆฎตๅ†…ๅฎน / ๆ–‡ไปถๅ", repDescLabel:"่ฏฆ็ป†่ฏดๆ˜Ž", repDescPh:"่ฏทๆ่ฟฐ้—ฎ้ข˜๏ผŒไพ‹ๅฆ‚่ฏฅ OS ๅ็งฐๆฒกๆœ‰ๆ˜ ๅฐ„๏ผŒๆˆ–ๆ–‡ไปถๆœชไธŠไผ ๅˆฐ MEGA", repCancel:"ๅ–ๆถˆ", repSubmit:"ๆไบค", repOk:"ไธŠๆŠฅๅทฒๆไบค๏ผŒๆ„Ÿ่ฐขๅ้ฆˆ๏ผ", repFail:"ๆไบคๅคฑ่ดฅ๏ผŒ่ฏท้‡่ฏ•" } }; /* โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• Main field groups [key, en, zh] โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• */ /* 3 primary modules. `wide:true` gives long OS strings the full card width. */ const GROUPS = [ {en:"Work Order", zh:"ๅทฅๅ•ไฟกๆฏ", fields:[ ["ASD_SN","Serial Number","ๅบๅˆ—ๅท"],["MACHINECODE","Machine Code","ๆœบๅ™จ็ผ–็ "],["ASD_MACHINETYPE","Machine Type","ๆœบๅž‹"], ["DPI","Resolution","ๅˆ†่พจ็އ"],["MID_IMEI","IMEI (MID)","IMEI(MID)"],["ASD_IMEI","IMEI (ASD)","IMEI(ASD)"], ["OSTYPE","OS Type","็ณป็ปŸ็ฑปๅž‹"] ]}, {en:"Neutral System", zh:"ไธญๆ€ง็ณป็ปŸ", wide:true, fields:[ ["MID_OSVERSION","OS Version","็ณป็ปŸ็‰ˆๆœฌ"],["MID_BIOSVERSION","BIOS","BIOS"],["MID_EC","EC","EC"] ]}, {en:"Custom System", zh:"ๅฎขๅˆถ็ณป็ปŸ", wide:true, fields:[ ["ASD_OS","OS Version","็ณป็ปŸ็‰ˆๆœฌ"],["ASD_BIOS","BIOS","BIOS"],["ASD_EC","EC","EC"] ]} ]; /* โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• Secondary groups (collapsed under "ๅ…ถไป–ๅญ—ๆฎต") โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• */ const MORE_GROUPS = [ {en:"Device", zh:"่ฎพๅค‡", fields:[ ["MODEL","Model","ๅž‹ๅท"],["MID_SN","SN (MID)","SN(MID)"],["GENERATION","Generation","ไปฃ็ณป"], ["ASD_KIND","Kind","็ฑปๅˆซ"],["ASD_STATUS","Status","็Šถๆ€"] ]}, {en:"System (extra)", zh:"็ณป็ปŸไฟกๆฏ(ๆ‰ฉๅฑ•)", fields:[ ["MID_DRIVERVERSION","Driver Version","้ฉฑๅŠจ็‰ˆๆœฌ"],["MID_OSPRODUCTID","OS Product ID","็ณป็ปŸไบงๅ“ID"], ["MID_OSPRODUCTKEY","OS Product Key","็ณป็ปŸไบงๅ“ๅฏ†้’ฅ"],["MID_PROCESSID","Process ID","ๅŠ ๅทฅๅ•ๅท"] ]}, {en:"Hardware", zh:"็กฌไปถ้…็ฝฎ", fields:[ ["ASD_CONFIG","Config","็กฌไปถ้…็ฝฎ"],["RAM","RAM","ๅ†…ๅญ˜"],["ROM","ROM","ๅญ˜ๅ‚จ"],["CPU","CPU","CPU"], ["LCD","LCD","ๆถฒๆ™ถๅฑ"],["TP","Touch Panel","่งฆๆ‘ธๅฑ"],["CAMERA","Camera","ๆ‘„ๅƒๅคด"],["BAT","Battery","็”ตๆฑ "], ["MAINBOARDVER","Mainboard Ver","ไธปๆฟ็‰ˆๆœฌ"],["SUBBOARDVER","Subboard Ver","ๅ‰ฏๆฟ็‰ˆๆœฌ"],["MCU","MCU","MCU"], ["BRIDGEIC","Bridge IC","ๆกฅๆŽฅIC"],["MID_HARDDISKMODEL","Disk Model","็กฌ็›˜ๅž‹ๅท"],["MID_HARDDISKSN","Disk SN","็กฌ็›˜ๅบๅˆ—ๅท"] ]}, {en:"Sensors & Peripherals", zh:"ไผ ๆ„Ÿๅ™จไธŽๅค–่ฎพ", fields:[ ["WIFI","WiFi","WiFiๆจกๅ—"],["NFC","NFC","NFC"],["GPS","GPS","GPS"],["MAGNETOMETER","Magnetometer","็ฃๅŠ›่ฎก"], ["GYROSCOPE","Gyroscope","้™€่žบไปช"],["LIGHTSENSOR","Light Sensor","ๅ…‰ๆ„Ÿ"],["ACCELEROMETER","Accelerometer","ๅŠ ้€Ÿๅบฆ่ฎก"], ["FINGERPRINT","Fingerprint","ๆŒ‡็บน"],["IDENTITYMODULE","Identity Module","่บซไปฝๆจกๅ—"] ]}, {en:"Connection IDs", zh:"้€šไฟกๆ ‡่ฏ†", fields:[ ["MID_WIFIMAC","WiFi MAC","WiFi MAC"],["MID_BTMAC","Bluetooth MAC","่“็‰™MAC"] ]}, {en:"Order", zh:"่ฎขๅ•ไฟกๆฏ", fields:[ ["MID_ORDERCODE","Order Code","่ฎขๅ•็ผ–ๅท"],["ORDERNUMBER","Order Number","่ฎขๅ•ๅท"],["ORDERQUANTITY","Order Qty","่ฎขๅ•ๆ•ฐ้‡"], ["ASD_QTY","Qty","ๆ•ฐ้‡"],["ASD_CUSTNAME","Customer Name","ๅฎขๆˆทๅ็งฐ"],["CUSTOMER","Customer","ๅฎขๆˆท"] ]}, {en:"Production", zh:"็”Ÿไบงๆต็จ‹", fields:[ ["ASD_RECIVETIME","Received","ๆ”ถๅ•ๆ—ถ้—ด"],["ASD_FINISHTIME","Finished","ๅฎŒๅทฅๆ—ถ้—ด"],["ASD_INDATE","Inbound","ๅ…ฅๅบ“ๆ—ถ้—ด"], ["MID_CREATETIME","Created","ๅˆ›ๅปบๆ—ถ้—ด"],["ASD_DEALMAN","Handler","ๅค„็†ไบบ"],["ASD_SALEER","Sales","ไธšๅŠกๅ‘˜"], ["ASD_SENDMAN","Sender","ๅ‘่ดงไบบ"],["ASD_CONTENT","Content","ไฝœไธšๅ†…ๅฎน"],["ASD_ACTREMAKETIME","Actual Rework Time","ๅฎž้™…่ฟ”ๅทฅๆ—ถ้—ด"] ]}, {en:"Delivery", zh:"ๅ‡บๅ…ฅๅบ“", fields:[ ["OUT_DELIVERY","Out Delivery","ๅ‡บ่ดงๅ•ๅท"],["IN_DELIVERY","In Delivery","ๅ…ฅๅบ“ๅ•ๅท"],["IN_SALES","In Sales","้”€ๅ”ฎๅ…ฅๅบ“"], ["OUT_SALES","Out Sales","้”€ๅ”ฎๅ‡บๅบ“"],["IN_CUSTOMER","In Customer","ๅ…ฅๅบ“ๅฎขๆˆท"],["OUT_CUSTOMER","Out Customer","ๅ‡บ่ดงๅฎขๆˆท"], ["MID_ID","MID ID","MID ID"],["OUT_SN","Out SN","ๅ‡บ่ดงSN"],["IN_SN","In SN","ๅ…ฅๅบ“SN"], ["OUT_IMEI","Out IMEI","ๅ‡บ่ดงIMEI"],["IN_IMEI","In IMEI","ๅ…ฅๅบ“IMEI"] ]}, {en:"Repair (RMD)", zh:"็ปดไฟฎ่ฎฐๅฝ•", fields:[ ["RMD_SN","Repair SN","็ปดไฟฎSN"],["RMD_MACHINETYPE","Repair Machine Type","็ปดไฟฎๆœบๅž‹"],["RMD_STATUS","Status","็Šถๆ€"], ["RMD_TYPE","Type","็ฑปๅž‹"],["RMD_BADTYPE","Defect Type","ไธ่‰ฏ็ฑปๅž‹"],["RMD_BADNAME","Defect Name","ไธ่‰ฏๅ็งฐ"], ["RMD_BADREASON","Defect Reason","ไธ่‰ฏๅŽŸๅ› "],["RMD_BADCONFRM","Defect Confirm","ไธ่‰ฏ็กฎ่ฎค"],["RMD_ANAREASON","Analysis Reason","ๅˆ†ๆžๅŽŸๅ› "], ["RMD_REPAIR","Repair","็ปดไฟฎ"],["RMD_REPAIRKIND","Repair Kind","็ปดไฟฎ็ฑปๅˆซ"],["RMD_DETNO","Detail No","ๆ˜Ž็ป†ๅ•ๅท"], ["RMD_RECIVETIME","Received","ๆ”ถๆœบๆ—ถ้—ด"],["RMD_FINISHTIME","Finished","ๅฎŒๆˆๆ—ถ้—ด"],["RMD_SALEER","Sales","ไธšๅŠกๅ‘˜"], ["RMD_DEALMAN","Handler","ๅค„็†ไบบ"],["RMD_ASSISTANT","Assistant","ๅๅŠฉไบบ"],["RMD_QTY","Qty","ๆ•ฐ้‡"], ["RMD_CUSTNAME","Customer","ๅฎขๆˆท"],["RMD_DAYS","Days","ๅคฉๆ•ฐ"],["RMD_MDM","MDM","MDM"],["RMD_REMARK","Remark","ๅค‡ๆณจ"] ]}, {en:"Other", zh:"ๅ…ถไป–ๅค‡ๆณจ", fields:[ ["REMARK","Remark","ๅค‡ๆณจ"],["ASD_REMARK","Remark (ASD)","ๅค‡ๆณจ(ASD)"],["BARCODE","Barcode","ๆก็ "], ["ASD_DETNO","Detail No (ASD)","ๆ˜Ž็ป†ๅ•ๅท(ASD)"],["MID_DETNO","Detail No (MID)","ๆ˜Ž็ป†ๅ•ๅท(MID)"],["MID_MIID","MIID","MIID"] ]} ]; /* โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• State โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• */ let LANG = localStorage.getItem('mes_lang') || 'en'; let TOKEN = localStorage.getItem('mes_token') || ''; let PROFILE = null; try { PROFILE = JSON.parse(localStorage.getItem('mes_profile') || 'null'); } catch(e){ PROFILE = null; } let pendingAction = null; let currentResult = null; let VALUES = []; let pollTimer = null; const $ = (id) => document.getElementById(id); /* โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• Demo sample โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• */ const SAMPLE = {"ASD_STATUS":"CLOSE","ASD_BIOS":null,"MID_OSVERSION":"M10X_OneRuggedEEA_MT6789_PCB_V3.0_A14_LCD_hx8279_TP_GT9271_SE4710_HDMI_yongbang_20250619_093557_M01A","RMD_MACHINETYPE":null,"RMD_ANAREASON":null,"MID_ID":"","CUSTOMER":null,"RMD_REPAIR":null,"RMD_BADCONFRM":null,"MID_ORDERCODE":"XX-WK202500594-1","MID_BTMAC":"00E004740858","OUT_DELIVERY":null,"RMD_BADNAME":null,"ASD_CONFIG":"8GB+128GB+WIFI+GPS+NFC+LTE FHD ้’็ฐ่‰ฒ (EU) Android 14(Onerugged)","ASD_QTY":"30","CAMERA":"HC-T17XB-V2.0","RMD_CUSTNAME":null,"RMD_BADREASON":null,"RMD_REMARK":null,"RMD_STATUS":null,"ASD_RECIVETIME":"2026-03-05 00:00:00.0","GENERATION":"ๅฅ—็‰‡","DPI":"1920*1200","WIFI":null,"ASD_DETNO":null,"MAINBOARDVER":"M10T/MV0258CDE81D_V3.0-3","MAGNETOMETER":null,"ASD_CUSTNAME":"็‹ฌ็ซ‹็ซ™ๆตทๅค–ไป“้œ€ๅค‡่ดง","ASD_CONTENT":"ๆ”น2D ๅˆทๅฎ‰ๅ“ๅฎ‰ๅ“14้žๆฌง็‰ˆGMS/ๅ“็‰Œ","MID_HARDDISKMODEL":null,"ORDERNUMBER":"XX-WK202500594-1","ASD_ACTREMAKETIME":"3","RMD_DETNO":null,"MID_SN":"M1TA688A0NXA25M0356","ASD_KIND":"G+S","REMARK":null,"ASD_DEALMAN":"ๆ™ฏๆ–‡ๅ…จ/้ซ˜ๅจ‡ๅจ‡/ๆž—ๅฐ‘้ธฟ","BRIDGEIC":null,"ORDERQUANTITY":"500","GYROSCOPE":null,"RMD_RECIVETIME":null,"MODEL":"M10T","RMD_FINISHTIME":null,"ASD_OS":"\\\\192.168.0.74ไบฟ้“ไฟกๆฏReleaseMTKM10Tๅ“็‰Œๅคฉๅฅ•่พพไธปๆฟAndroid14_NOEEAHDMIM10X_OneRuggedNOEEA_MT6789_PCB_V3.0_A14_LCD_hx8279_TP_GT9271_SE4710_HDMI_yongbang_20250624_153430_M01A(user)","LIGHTSENSOR":null,"ACCELEROMETER":null,"IN_DELIVERY":null,"IN_SALES":null,"TP":"10.1ๅฏธTP_M10J","IN_CUSTOMER":null,"MCU":null,"MID_HARDDISKSN":null,"RMD_SALEER":null,"RMD_BADTYPE":null,"MID_DRIVERVERSION":null,"BARCODE":null,"CPU":null,"NFC":"ๅฅ—็‰‡","GPS":"ๅฅ—็‰‡","FINGERPRINT":null,"OSTYPE":"Android14","ASD_FINISHTIME":"2026-03-08 00:00:00.0","OUT_IMEI":null,"RMD_TYPE":null,"IN_SN":null,"MID_EC":null,"OUT_SALES":null,"MID_MIID":null,"MID_WIFIMAC":"00E0047404BE","ASD_SENDMAN":"ไน”","OUT_SN":null,"RMD_DAYS":null,"LCD":"3AMM101PP05-X0","ASD_IMEI":"861143061995615|861143061990616","IDENTITYMODULE":null,"ASD_SALEER":"ๆจๅฐๆ™ด","ROM":"128GB","RMD_REPAIRKIND":null,"MID_IMEI":"861143061990616","MID_PROCESSID":null,"RMD_SN":null,"IN_IMEI":null,"SUBBOARDVER":null,"OUT_CUSTOMER":null,"RMD_DEALMAN":null,"MACHINECODE":"03.DMH.M10T881001A","ASD_MACHINETYPE":"M10T","RMD_QTY":null,"RMD_MDM":null,"RMD_ASSISTANT":null,"MID_BIOSVERSION":null,"MID_OSPRODUCTID":null,"ASD_INDATE":"2026-04-20 10:30:53.0","MID_OSPRODUCTKEY":null,"MID_DETNO":null,"ASD_SN":"M1TA688A0NXA25M0356","MID_CREATETIME":"2026-05-08 11:28:42.0","BAT":"489569_1S2P_3.8V_10000mAh","ASD_REMARK":null,"RAM":"8GB"}; /* โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• Helpers โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• */ function t(k){ return (I18N[LANG] && I18N[LANG][k]) || I18N.en[k] || k; } function esc(v){ return String(v).replace(/[&<>"']/g, c => ({'&':'&amp;','<':'&lt;','>':'&gt;','"':'&quot;',"'":'&#39;'}[c])); } function hasVal(v){ return !(v===null || v===undefined || v==='' || v==='null' || v==='None'); } function fmt(v){ if(typeof v === 'string'){ const m = v.match(/^(\d{4}-\d{2}-\d{2})[ T](\d{2}:\d{2}:\d{2})(?:\.\d+)?$/); if(m) return m[2] === '00:00:00' ? m[1] : m[1] + ' ' + m[2]; } return v; } function labelOf(en, zh){ return LANG === 'zh' ? zh : en; } /* โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• i18n apply โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• */ function applyI18n(){ document.documentElement.lang = LANG === 'zh' ? 'zh-CN' : 'en'; document.title = t('title'); $('appTitle').textContent = t('title'); $('appSub').textContent = t('sub'); $('navAdmin').textContent = t('navAdmin'); $('langToggle').textContent = LANG === 'zh' ? 'English' : 'ไธญๆ–‡'; $('gateTitle').textContent = t('gateTitle'); $('gateDesc').textContent = t('gateDesc'); $('codeInput').placeholder = t('codePh'); $('accessBtn').textContent = t('verifyBtn'); $('snInput').placeholder = t('snPh'); $('queryBtn').textContent = t('queryBtn'); $('fieldSearch').placeholder = t('searchPh'); $('showEmptyLabel').textContent = t('showEmpty'); $('copyJsonBtn').textContent = t('copyJson'); $('downloadJsonBtn').textContent = t('downloadJson'); $('relockBtn').textContent = t('relock'); $('cachedBadge').textContent = t('cached'); $('rawSummary').textContent = t('rawJson'); $('megTitle').textContent = t('megTitle'); $('megHint').textContent = t('megHint'); $('megBtn').textContent = t('megSearchBtn'); $('megInput').placeholder = t('megSearchPh'); $('mapTitle').textContent = t('mapTitle'); $('mapHint').textContent = t('mapHint'); $('reportBtn').textContent = t('reportBtn'); $('repTitle').textContent = t('repTitle'); $('repTypeLabel').textContent = t('repTypeLabel'); $('repFieldLabel').textContent = t('repFieldLabel'); $('repOsLabel').textContent = t('repOsLabel'); $('repDescLabel').textContent = t('repDescLabel'); $('repDesc').placeholder = t('repDescPh'); $('repCancel').textContent = t('repCancel'); $('repSubmit').textContent = t('repSubmit'); $('repType').innerHTML = REPORT_TYPES.map(([v,en,zh]) => '<option value="' + v + '">' + esc(labelOf(en, zh)) + '</option>').join(''); } function toggleLang(){ LANG = LANG === 'en' ? 'zh' : 'en'; localStorage.setItem('mes_lang', LANG); applyI18n(); if(currentResult) renderResult(currentResult); } /* โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• Theme โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• */ function initTheme(){ const saved = localStorage.getItem('drivers_theme'); if(saved === 'warm'){ document.documentElement.setAttribute('data-theme','warm'); $('themeToggle').textContent = 'โ˜€๏ธ'; } } function toggleTheme(){ const warm = document.documentElement.getAttribute('data-theme') === 'warm'; document.documentElement.setAttribute('data-theme', warm ? 'cool' : 'warm'); localStorage.setItem('drivers_theme', warm ? 'cool' : 'warm'); $('themeToggle').textContent = warm ? 'โ„๏ธ' : 'โ˜€๏ธ'; } /* โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• Toast โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• */ let toastTimer = null; function toast(msg, isErr){ const el = $('toast'); el.textContent = msg; el.classList.toggle('err', !!isErr); el.classList.add('show'); clearTimeout(toastTimer); toastTimer = setTimeout(() => el.classList.remove('show'), 1600); } /* โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• Access gate โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• */ function showGate(){ $('gate').classList.remove('hidden'); $('queryCard').classList.add('hidden'); $('results').classList.add('hidden'); } function hideGate(){ $('gate').classList.add('hidden'); $('queryCard').classList.remove('hidden'); } function relock(){ TOKEN = ''; PROFILE = null; localStorage.removeItem('mes_token'); localStorage.removeItem('mes_profile'); clearInterval(pollTimer); hideProgress(); $('results').classList.add('hidden'); $('gateError').classList.add('hidden'); showGate(); } async function verifyCode(){ const code = $('codeInput').value.trim(); const errEl = $('gateError'); errEl.classList.add('hidden'); if(!code){ errEl.textContent = t('accessError'); errEl.classList.remove('hidden'); return; } $('accessBtn').disabled = true; try{ const r = await fetch('/api/drivers/mes-access', { method:'POST', headers:{'Content-Type':'application/json'}, body:JSON.stringify({code}) }); if(r.ok){ const d = await r.json(); TOKEN = d.token; localStorage.setItem('mes_token', TOKEN); PROFILE = d.profile || null; localStorage.setItem('mes_profile', JSON.stringify(PROFILE)); $('codeInput').value = ''; hideGate(); const act = pendingAction; pendingAction = null; if(act) act(); } else if(r.status === 403){ errEl.textContent = t('accessError'); errEl.classList.remove('hidden'); } else { errEl.textContent = t('serverError'); errEl.classList.remove('hidden'); } }catch(e){ errEl.textContent = t('networkError'); errEl.classList.remove('hidden'); }finally{ $('accessBtn').disabled = false; } } /* โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• Query โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• */ async function apiFetch(path, opts){ opts = opts || {}; opts.headers = Object.assign({'Content-Type':'application/json','Authorization':'Bearer ' + TOKEN}, opts.headers || {}); const ctrl = new AbortController(); const timeoutMs = opts.timeoutMs || 30000; delete opts.timeoutMs; const to = setTimeout(() => ctrl.abort(), timeoutMs); try{ return await fetch(path, Object.assign({signal:ctrl.signal}, opts)); } finally { clearTimeout(to); } } function showProgress(pct, msg){ $('progressWrap').classList.remove('hidden'); $('progressFill').style.width = (pct||0) + '%'; $('progressMsg').textContent = msg || ''; } function hideProgress(){ $('progressWrap').classList.add('hidden'); } function showQueryError(msg){ hideProgress(); const el = $('queryError'); el.textContent = msg; el.classList.remove('hidden'); } async function doQuery(){ const sn = $('snInput').value.trim(); if(!sn) return; $('queryError').classList.add('hidden'); $('results').classList.add('hidden'); $('queryBtn').disabled = true; showProgress(0, t('queueing')); try{ const r = await apiFetch('/api/drivers/mes-query', {method:'POST', body:JSON.stringify({sn})}); if(r.status === 401){ $('queryBtn').disabled = false; pendingAction = doQuery; relock(); return; } if(!r.ok){ showQueryError(t('serverError')); return; } const d = await r.json(); poll(d.task_id); }catch(e){ showQueryError(t('networkError')); }finally{ $('queryBtn').disabled = false; } } function poll(taskId){ let tries = 0; clearInterval(pollTimer); pollTimer = setInterval(async () => { tries++; if(tries > 90){ clearInterval(pollTimer); showQueryError(t('serverError')); return; } try{ const r = await apiFetch('/api/drivers/mes-query/status/' + taskId); if(r.status === 401){ clearInterval(pollTimer); pendingAction = doQuery; relock(); return; } if(!r.ok){ return; } const d = await r.json(); showProgress(d.progress, d.message); if(d.status === 'done'){ clearInterval(pollTimer); hideProgress(); renderResult(d.result || {sn:'', data:{}, cached:false}); } else if(d.status === 'error'){ clearInterval(pollTimer); showQueryError(d.error || t('serverError')); } }catch(e){ /* transient, keep polling */ } }, 700); } /* โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• Render โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• */ function rowHTML(label, key, val){ const idx = VALUES.length; VALUES.push(hasVal(val) ? String(val) : ''); const ok = hasVal(val); const disp = ok ? esc(String(fmt(val))) : 'โ€”'; const search = esc((label + ' ' + key + ' ' + (ok ? String(val) : '')).toLowerCase()); return '<div class="frow" data-idx="' + idx + '" data-search="' + search + '" data-empty="' + (ok ? 0 : 1) + '">' + '<span class="flabel">' + esc(label) + '</span>' + '<span class="fval' + (ok ? '' : ' muted') + '" data-idx="' + idx + '">' + disp + '</span></div>'; } function sectionHTML(title, rows, extraClass){ return '<section class="card sect ' + (extraClass || '') + '"><h3 class="sect-title">' + esc(title) + '</h3>' + '<div class="frows">' + rows + '</div></section>'; } function renderResult(res){ currentResult = res; const data = (res && res.data) || {}; VALUES = []; const known = new Set(); GROUPS.forEach(g => g.fields.forEach(f => known.add(f[0]))); MORE_GROUPS.forEach(g => g.fields.forEach(f => known.add(f[0]))); // ๅ—้™่ฎฟ้—ฎ็ ๏ผšๆœๅŠก็ซฏๅทฒๅ‰”้™คไธๅฏ่งๅญ—ๆฎต๏ผŒ่ฟ™้‡ŒๅŒๆญฅ่ทณ่ฟ‡็ฉบๅˆ†็ป„๏ผŒ้ฟๅ…ๆšด้œฒๅญ—ๆฎตๅ const restricted = !!(PROFILE && !PROFILE.is_admin); const keep = f => !restricted || Object.prototype.hasOwnProperty.call(data, f[0]); let html = ''; GROUPS.forEach((g, i) => { const fields = g.fields.filter(keep); if(!fields.length) return; const rows = fields.map(([k,en,zh]) => rowHTML(labelOf(en,zh), k, data[k])).join(''); const cls = (i === 0 ? 'summary ' : '') + (g.wide ? 'wide' : ''); html += sectionHTML(labelOf(g.en, g.zh), rows, cls); }); let more = ''; MORE_GROUPS.forEach(g => { const fields = g.fields.filter(keep); if(!fields.length) return; const sec = sectionHTML(labelOf(g.en, g.zh), fields.map(([k,en,zh]) => rowHTML(labelOf(en,zh), k, data[k])).join('')); if(restricted) html += sec; else more += sec; }); const extras = Object.keys(data).filter(k => !known.has(k)); if(extras.length){ const sec = sectionHTML(labelOf("Additional", "ๅ…ถไป–ๅญ—ๆฎต"), extras.map(k => rowHTML(k, k, data[k])).join('')); if(restricted) html += sec; else more += sec; } if(more){ html += '<details class="card sect more"><summary class="sect-title">' + esc(labelOf("Other Fields", "ๅ…ถไป–ๅญ—ๆฎต")) + '</summary><div class="more-body">' + more + '</div></details>'; } $('sections').innerHTML = html; $('megInput').value = ''; $('megResults').innerHTML = ''; renderMegaCandidates(data); renderMapping(); $('rawPre').textContent = JSON.stringify(data, null, 2); $('snBadge').textContent = res.sn || ''; $('snBadge').classList.toggle('hidden', !res.sn); $('cachedBadge').classList.toggle('hidden', !res.cached); $('results').classList.remove('hidden'); $('results').querySelectorAll('.fval').forEach(el => el.addEventListener('click', onValueClick)); applyFilter(); } function onValueClick(e){ const idx = e.currentTarget.getAttribute('data-idx'); const val = VALUES[Number(idx)]; if(!val) return; copyText(val); } function applyFilter(){ const q = $('fieldSearch').value.trim().toLowerCase(); const showEmpty = $('emptyToggle').checked; document.querySelectorAll('#sections .sect').forEach(sec => { let visible = 0; sec.querySelectorAll('.frow').forEach(r => { const okQ = !q || (r.getAttribute('data-search') || '').indexOf(q) !== -1; const okE = showEmpty || r.getAttribute('data-empty') === '0'; const show = okQ && okE; r.style.display = show ? '' : 'none'; if(show) visible++; }); sec.style.display = visible ? '' : 'none'; }); } /* โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• Copy / Download โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• */ function copyText(text){ const done = () => toast(t('copied')); const fail = () => toast(t('copyFail'), true); if(navigator.clipboard && navigator.clipboard.writeText){ navigator.clipboard.writeText(text).then(done).catch(() => { fallbackCopy(text, done, fail); }); } else { fallbackCopy(text, done, fail); } } function fallbackCopy(text, done, fail){ try{ const ta = document.createElement('textarea'); ta.value = text; ta.style.position = 'fixed'; ta.style.opacity = '0'; document.body.appendChild(ta); ta.select(); document.execCommand('copy'); document.body.removeChild(ta); done(); }catch(e){ fail(); } } function copyJson(){ const data = currentResult ? currentResult.data : null; if(!data){ return; } copyText(JSON.stringify(data, null, 2)); } function downloadJson(){ const data = currentResult ? currentResult.data : null; if(!data){ return; } const sn = (currentResult && currentResult.sn) || 'mes'; const blob = new Blob([JSON.stringify(data, null, 2)], {type:'application/json'}); const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = sn + '.json'; document.body.appendChild(a); a.click(); document.body.removeChild(a); URL.revokeObjectURL(url); } /* โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• MEGA manual search โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• */ function extractOsCandidates(data){ const out = []; const seen = new Set(); const add = (tag, val) => { val = (val || '').trim(); if(!val || seen.has(val)) return; seen.add(val); out.push({tag: tag, value: val}); }; const scan = (str) => { if(typeof str !== 'string') return; const scd = str.match(/SCD_\d{8}_[\w.\-]+/g) || []; const rcd = str.match(/RCD_\d{8}_[\w.\-]+/g) || []; scd.forEach(v => add('SCD', v)); rcd.forEach(v => add('RCD', v)); }; scan(data.ASD_OS); scan(data.MID_OSVERSION); if(!out.length){ [['ASD_OS','ASD'], ['MID_OSVERSION','MID']].forEach(([key, tag]) => { const v = data[key]; if(typeof v === 'string' && v.trim()){ add(tag, v.replace(/^.*[\\/]/, '')); } }); } return out; } function renderMegaCandidates(data){ const box = $('megChips'); box.innerHTML = ''; const cands = extractOsCandidates(data || {}); if(!cands.length){ const none = document.createElement('span'); none.className = 'mega-none'; none.textContent = t('megNoCand'); box.appendChild(none); return; } cands.forEach(c => { const btn = document.createElement('button'); btn.type = 'button'; btn.className = 'chip'; btn.title = c.value; const k = document.createElement('span'); k.className = 'chip-k'; k.textContent = c.tag; btn.appendChild(k); btn.appendChild(document.createTextNode(c.value)); btn.addEventListener('click', () => { $('megInput').value = c.value; doMegaSearch(); }); box.appendChild(btn); }); } function fmtSize(n){ n = Number(n) || 0; if(n <= 0) return ''; const units = ['B','KB','MB','GB','TB']; let i = 0, x = n; while(x >= 1024 && i < units.length - 1){ x /= 1024; i++; } return (i === 0 ? String(x) : x.toFixed(1)) + ' ' + units[i]; } function renderMegaResults(items){ const box = $('megResults'); box.innerHTML = ''; if(!items.length){ const none = document.createElement('div'); none.className = 'mega-none'; none.textContent = t('megNoResult'); box.appendChild(none); return; } const head = document.createElement('div'); head.className = 'mega-none'; head.textContent = t('megResultCount').replace('{n}', items.length); box.appendChild(head); items.forEach(it => { const row = document.createElement('div'); row.className = 'mega-item'; const nameEl = document.createElement('div'); nameEl.className = 'mega-name'; nameEl.textContent = it.name || ''; const size = fmtSize(it.size); if(size){ const s = document.createElement('div'); s.className = 'mega-size'; s.textContent = size; nameEl.appendChild(s); } row.appendChild(nameEl); const act = document.createElement('div'); act.className = 'mega-act'; if(it.link){ const a = document.createElement('a'); a.className = 'btn-ghost'; a.href = it.link; a.target = '_blank'; a.rel = 'noopener'; a.textContent = t('megDownload'); const c = document.createElement('button'); c.type = 'button'; c.className = 'btn-ghost'; c.textContent = t('megCopy'); c.addEventListener('click', () => copyText(it.link)); act.appendChild(a); act.appendChild(c); } else { const s = document.createElement('span'); s.className = 'mega-size'; s.textContent = t('megLinkFail'); act.appendChild(s); } row.appendChild(act); box.appendChild(row); }); } async function doMegaSearch(){ const q = $('megInput').value.trim(); const box = $('megResults'); if(!q) return; box.innerHTML = ''; const loading = document.createElement('div'); loading.className = 'mega-none'; loading.textContent = t('megSearching'); box.appendChild(loading); $('megBtn').disabled = true; const slowTimer = setTimeout(() => { loading.textContent = t('megRefreshing'); }, 4000); try{ const r = await apiFetch('/api/drivers/mes-mega-search', { method:'POST', body:JSON.stringify({query:q, limit:10}), timeoutMs:180000 }); if(r.status === 401){ $('megBtn').disabled = false; pendingAction = doMegaSearch; relock(); return; } if(!r.ok){ box.innerHTML = ''; const err = document.createElement('div'); err.className = 'mega-none'; err.textContent = t('serverError'); box.appendChild(err); return; } const d = await r.json(); renderMegaResults(d.items || []); if(d.refreshed){ const note = document.createElement('div'); note.className = 'mega-none'; note.textContent = t('megIndexRefreshed'); box.appendChild(note); } }catch(e){ box.innerHTML = ''; const err = document.createElement('div'); err.className = 'mega-none'; err.textContent = t('networkError'); box.appendChild(err); }finally{ clearTimeout(slowTimer); $('megBtn').disabled = false; } } /* โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• OS name mapping โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• */ const MAP_CACHE = {}; async function fetchOsMap(osVersion){ if(!osVersion) return null; if(Object.prototype.hasOwnProperty.call(MAP_CACHE, osVersion)) return MAP_CACHE[osVersion]; try{ const r = await fetch('/api/drivers/os-file-maps/lookup?os_version=' + encodeURIComponent(osVersion)); if(!r.ok){ MAP_CACHE[osVersion] = null; return null; } const d = await r.json(); MAP_CACHE[osVersion] = d.map || null; return MAP_CACHE[osVersion]; }catch(e){ return null; } } function currentOsNames(){ const d = (currentResult && currentResult.data) || {}; return [d.MID_OSVERSION, d.ASD_OS].filter(v => typeof v === 'string' && v.trim()); } async function renderMapping(){ const list = $('mapList'); if(!list) return; const names = currentOsNames(); list.innerHTML = '<div class="map-none">' + esc(t('mapNone')) + '</div>'; if(!names.length) return; const maps = await Promise.all(names.map(fetchOsMap)); if(!currentResult) return; const files = []; maps.forEach(m => { if(m && Array.isArray(m.files)){ m.files.forEach(f => { if(f && files.indexOf(f) === -1) files.push(f); }); } }); if(!files.length) return; list.innerHTML = files.map(f => '<div class="map-item"><span class="chip-k">' + esc(t('mapMapped')) + '</span>' + '<span class="mega-name">' + esc(f) + '</span>' + '<span class="mega-act">' + '<button class="btn-ghost" data-file="' + esc(f) + '" onclick="searchMapped(this)">' + esc(t('megSearchBtn')) + '</button>' + '<button class="btn-ghost" data-file="' + esc(f) + '" onclick="copyMapped(this)">' + esc(t('megCopy')) + '</button>' + '</span></div>' ).join(''); } function searchMapped(el){ $('megInput').value = el.getAttribute('data-file') || ''; doMegaSearch(); } function copyMapped(el){ copyText(el.getAttribute('data-file') || ''); } /* โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• Problem report โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• */ const REPORT_TYPES = [ ["missing_mapping","Missing mapping","็ผบๅฐ‘ๆ˜ ๅฐ„"], ["file_not_on_mega","File not on MEGA","ๆ–‡ไปถๆœชไธŠไผ  MEGA"], ["no_match","No MEGA match","MEGA ๆœชๅŒน้…ๅˆฐ"], ["parse_error","Parse error","่งฃๆž้”™่ฏฏ"], ["wrong_link","Wrong link","้“พๆŽฅ้”™่ฏฏ"], ["wrong_file","Wrong file","ๆ–‡ไปถ้”™่ฏฏ"], ["suggestion","Suggestion","ๆ”น่ฟ›ๅปบ่ฎฎ"], ["other","Other","ๅ…ถไป–"] ]; const REPORT_FIELDS = [ ["MID_OSVERSION","Neutral OS version","ไธญๆ€ง็ณป็ปŸ็‰ˆๆœฌ"], ["ASD_OS","Custom OS version","ๅฎขๅˆถ็ณป็ปŸ็‰ˆๆœฌ"], ["MID_BIOSVERSION","Neutral BIOS","ไธญๆ€ง BIOS"], ["ASD_BIOS","Custom BIOS","ๅฎขๅˆถ BIOS"], ["MID_EC","Neutral EC","ไธญๆ€ง EC"], ["ASD_EC","Custom EC","ๅฎขๅˆถ EC"], ["OSTYPE","OS type","็ณป็ปŸ็ฑปๅž‹"], ["MODEL","Model","ๆœบๅž‹"], ["MACHINECODE","Machine code","ๆœบๅ™จ็ผ–็ "], ["ASD_SN","Serial number","ๅบๅˆ—ๅท"] ]; function reportData(){ return (currentResult && currentResult.data) || {}; } function onReportFieldChange(){ const d = reportData(); const k = $('repField').value; $('repOs').value = k && hasVal(d[k]) ? String(d[k]) : ''; } function pickDefaultReportField(){ const d = reportData(); const type = $('repType').value; const prefer = type === 'missing_mapping' ? ['MID_OSVERSION','ASD_OS'] : ['MID_BIOSVERSION','ASD_BIOS','MID_EC','ASD_EC','MID_OSVERSION','ASD_OS']; const opts = Array.from($('repField').options).map(o => o.value); const pick = prefer.find(k => opts.includes(k) && hasVal(d[k])) || prefer.find(k => opts.includes(k)) || opts[0] || ''; if(pick) $('repField').value = pick; onReportFieldChange(); } function onReportTypeChange(){ pickDefaultReportField(); } function openReport(){ const d = reportData(); const avail = REPORT_FIELDS.filter(([k]) => hasVal(d[k])); const list = avail.length ? avail : REPORT_FIELDS; $('repField').innerHTML = list.map(([k,en,zh]) => '<option value="' + k + '">' + esc(labelOf(en, zh)) + ' (' + esc(k) + ')</option>').join(''); $('repType').value = 'missing_mapping'; $('repDesc').value = ''; $('reportModal').classList.remove('hidden'); pickDefaultReportField(); } function closeReport(){ $('reportModal').classList.add('hidden'); } async function submitReport(){ const d = (currentResult && currentResult.data) || {}; const btn = $('repSubmit'); btn.disabled = true; try{ const r = await fetch('/api/drivers/reports', { method:'POST', headers:{'Content-Type':'application/json'}, body: JSON.stringify({ sn: (currentResult && currentResult.sn) || '', problem_type: $('repType').value, os_type: d.OSTYPE || '', field_name: $('repField').value, os_version: $('repOs').value.trim(), matched_filenames: '', description: $('repDesc').value.trim() }) }); const j = await r.json().catch(() => ({})); if(!r.ok || j.error){ toast(j.error || t('repFail'), true); return; } closeReport(); toast(t('repOk')); }catch(e){ toast(t('repFail'), true); }finally{ btn.disabled = false; } } /* โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• Boot โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• */ async function verifyToken(){ const probe = TOKEN; if(!probe) return; try{ const r = await apiFetch('/api/drivers/mes-me'); if(r.status === 401){ if(TOKEN === probe) relock(); return; } if(r.ok){ const d = await r.json(); PROFILE = d.profile || null; localStorage.setItem('mes_profile', JSON.stringify(PROFILE)); if(currentResult) renderResult(currentResult); } }catch(e){ /* keep the cached token when the network is down */ } } function boot(){ initTheme(); applyI18n(); $('themeToggle').addEventListener('click', toggleTheme); $('snInput').addEventListener('keydown', e => { if(e.key === 'Enter') doQuery(); }); $('codeInput').addEventListener('keydown', e => { if(e.key === 'Enter') verifyCode(); }); $('megInput').addEventListener('keydown', e => { if(e.key === 'Enter') doMegaSearch(); }); $('reportModal').addEventListener('click', e => { if(e.target.id === 'reportModal') closeReport(); }); if(/[?&]demo=1/.test(location.search)){ hideGate(); $('snInput').value = 'M1TA688A0NXA25M0356'; renderResult({sn:'M1TA688A0NXA25M0356', data:SAMPLE, cached:false, code:'0', message:'success'}); return; } if(TOKEN){ hideGate(); verifyToken(); } else { showGate(); } } boot(); </script> </body> </html>
<!DOCTYPE html>
<html lang="en" data-theme="cool">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>MES Info Query</title>
<link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ctext y='.9em' font-size='90'%3E%F0%9F%93%A6%3C/text%3E%3C/svg%3E">
<style>
/* โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• Design System โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• */
:root {
--bg-page:#f0f4f8; --bg-card:#fff; --bg-subtle:#f8fafc;
--text-primary:#0f172a; --text-secondary:#475569; --text-muted:#94a3b8;
--border-light:#e2e8f0; --border-subtle:#f1f5f9;
--shadow-card:0 1px 3px rgba(0,0,0,.04),0 1px 2px rgba(0,0,0,.06);
--shadow-hover:0 10px 30px -5px rgba(0,0,0,.1),0 4px 6px -2px rgba(0,0,0,.05);
--header-start:#0b1426; --header-mid:#14203a; --header-end:#0b1426;
--header-text:#f1f5f9; --header-sub:#64748b;
--glow-1:rgba(59,130,246,.08); --glow-2:rgba(139,92,246,.08);
--accent:#3b82f6; --accent-strong:#2563eb;
--chip-bg:#eff6ff; --chip-text:#1d4ed8;
--muted-bg:#f1f5f9;
--ok:#16a34a; --err:#dc2626;
--bg-pattern:rgba(59,130,246,.015);
}
[data-theme="warm"] {
--bg-page:#fef7ee; --bg-card:#fff; --bg-subtle:#fffbeb;
--text-primary:#1c1917; --text-secondary:#57534e; --text-muted:#a8a29e;
--border-light:#e7e5e4; --border-subtle:#f5f5f4;
--shadow-card:0 1px 3px rgba(120,80,40,.04),0 1px 2px rgba(120,80,40,.06);
--shadow-hover:0 10px 30px -5px rgba(120,80,40,.1),0 4px 6px -2px rgba(120,80,40,.05);
--header-start:#1c130d; --header-mid:#2d1f14; --header-end:#1c130d;
--header-text:#fefce8; --header-sub:#a8a29e;
--glow-1:rgba(245,158,11,.07); --glow-2:rgba(239,68,68,.06);
--accent:#d97706; --accent-strong:#b45309;
--chip-bg:#fef3c7; --chip-text:#92400e;
--muted-bg:#fef3c7;
--ok:#15803d; --err:#dc2626;
--bg-pattern:rgba(245,158,11,.015);
}
*{margin:0;padding:0;box-sizing:border-box}
body{
font-family:"PingFang SC","Microsoft YaHei","Noto Sans SC","Helvetica Neue",Arial,sans-serif;
background:var(--bg-page);color:var(--text-primary);min-height:100vh;
transition:background .4s ease,color .3s ease;
}
body::before{
content:'';position:fixed;inset:0;z-index:-1;
background-image:linear-gradient(var(--bg-pattern) 1px,transparent 1px),
linear-gradient(90deg,var(--bg-pattern) 1px,transparent 1px);
background-size:60px 60px;
}
.hidden{display:none!important}
a{color:inherit}
/* โ”€โ”€ Theme toggle โ”€โ”€ */
.theme-toggle{
position:fixed;top:18px;right:18px;z-index:100;width:42px;height:42px;border-radius:50%;
border:2px solid var(--border-light);background:var(--bg-card);cursor:pointer;font-size:19px;
display:flex;align-items:center;justify-content:center;transition:all .3s cubic-bezier(.4,0,.2,1);
box-shadow:0 2px 12px rgba(0,0,0,.08);
}
.theme-toggle:hover{transform:scale(1.1);box-shadow:0 4px 20px rgba(0,0,0,.12)}
/* โ”€โ”€ Header โ”€โ”€ */
.header{
background:linear-gradient(135deg,var(--header-start) 0%,var(--header-mid) 50%,var(--header-end) 100%);
color:var(--header-text);padding:30px 0 26px;position:relative;overflow:hidden;
transition:background .4s ease;
}
.header::before{
content:'';position:absolute;top:-50%;left:-50%;width:200%;height:200%;
background:radial-gradient(ellipse at 30% 50%,var(--glow-1) 0%,transparent 60%),
radial-gradient(ellipse at 70% 50%,var(--glow-2) 0%,transparent 60%);
}
.header-inner{
position:relative;max-width:1100px;margin:0 auto;padding:0 24px;
display:flex;align-items:center;justify-content:space-between;gap:20px;flex-wrap:wrap;
}
.brand h1{font-size:26px;font-weight:700;letter-spacing:.5px}
.brand .sub{color:var(--header-sub);font-size:13px;margin-top:6px}
.top-nav{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.top-nav a,.lang-btn{
font-size:13px;color:var(--header-text);text-decoration:none;padding:8px 14px;border-radius:8px;
background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.14);
transition:background .2s;cursor:pointer;font-family:inherit;
}
.top-nav a:hover,.lang-btn:hover{background:rgba(255,255,255,.18)}
.lang-btn{font-weight:600;min-width:64px}
/* โ”€โ”€ Layout โ”€โ”€ */
.wrap{max-width:1100px;margin:0 auto;padding:28px 24px 60px}
.card{
background:var(--bg-card);border:1px solid var(--border-light);border-radius:14px;
box-shadow:var(--shadow-card);padding:22px;
}
/* โ”€โ”€ Gate โ”€โ”€ */
.gate{max-width:440px;margin:40px auto;text-align:center}
.gate h2{font-size:20px;margin-bottom:10px}
.gate p{color:var(--text-secondary);font-size:13px;line-height:1.6;margin-bottom:18px}