/* ==========================================================
   R.X Online — LOGIN PAGE
   NCS Design Language: black / silver / red accent
   ========================================================== */
/* === 字體（login.html 獨立載入）=== */
/* 2026-05-15 主字體換 LINE Seed TW (4 字重) + OCR A Extended(英文/數字 only) */
@font-face {
  font-family: "OCR A Extended";
  src: url("rx-assets/fonts/ocr-a-extended.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0020-007F;
}
@font-face {
  font-family: "Fusion Pixel 12px";
  src: url("rx-assets/fonts/fusion-pixel-12px-zhhant.ttf") format("truetype");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+3000-303F, U+3400-4DBF, U+4E00-9FFF, U+F900-FAFF, U+FF00-FFEF;
}
@font-face {
  font-family: "LINE Seed TW";
  src: url("rx-assets/fonts/LINESeedTW_OTF_Th.woff2") format("woff2");
  font-weight: 100 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "LINE Seed TW";
  src: url("rx-assets/fonts/LINESeedTW_OTF_Rg.woff2") format("woff2");
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "LINE Seed TW";
  src: url("rx-assets/fonts/LINESeedTW_OTF_Bd.woff2") format("woff2");
  font-weight: 600 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "LINE Seed TW";
  src: url("rx-assets/fonts/LINESeedTW_OTF_Eb.woff2") format("woff2");
  font-weight: 800 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Torono Gothic";
  src: url("rx-assets/fonts/torono-gothic.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Torono Mincho";
  src: url("rx-assets/fonts/torono-mincho.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Torono Glitch Gothic";
  src: url("rx-assets/fonts/torono-glitch-gothic.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Torono Glitch Mincho";
  src: url("rx-assets/fonts/torono-glitch-mincho.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Torono Glitch H1 Sans";
  src: url("rx-assets/fonts/torono-glitch-h1-gothic.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Torono Glitch H1 Serif";
  src: url("rx-assets/fonts/torono-glitch-h1-mincho.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-sans: "OCR A Extended", "Fusion Pixel 12px", "LINE Seed TW", "Torono Glitch H1 Sans", "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "OCR A Extended", "Fusion Pixel 12px", "LINE Seed TW", "Torono Glitch H1 Serif", "Noto Serif TC", "Times New Roman", serif;
  --font-glitch: "OCR A Extended", "Fusion Pixel 12px", "LINE Seed TW", "Torono Glitch Gothic", "Noto Sans TC", sans-serif;
  --font-glitch-serif: "OCR A Extended", "Fusion Pixel 12px", "LINE Seed TW", "Torono Glitch Mincho", "Noto Serif TC", serif;
  --bg-deep:   #020303;
  --bg-mid:    #050708;
  --bg-light:  #0d1014;
  --border:    rgba(215, 220, 225, .45);
  --border-soft: rgba(255, 255, 255, .12);
  --border-faint: rgba(255, 255, 255, .06);
  --text:      #e8e8e8;
  --text-2:    #c7cacd;
  --text-dim:  #a4a7a9;
  --text-faint:#6a6e72;
  --red:       #8c5cdc;
  --red-2:     #b38aff;
  --ok:        #6cd07a;
  --warn:      #d8a14a;
}

* { box-sizing: border-box; }
/* 2026-05-21 自然整頁捲動:註冊/重設內容超出 viewport 時不可被裁切 */
html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}
html {
  scrollbar-width: thin;
  scrollbar-color: rgba(232, 232, 232, .72) #020303;
}
html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track {
  background: #020303;
}
html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(255,255,255,.82), rgba(140,145,150,.62));
  border: 1px solid rgba(0,0,0,.82);
}
html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,.88);
}
body {
  font-family: var(--font-sans);
  letter-spacing: .06em;
  color: var(--text);
  background: #000;
  overflow-x: hidden;
}

/* hide optional fx overlay (cyan/magenta HUD) — login wants pure black */
.fx-overlay { display: none !important; }

/* ===== Background fx ===== */
.bg-noise {
  position: fixed; inset: 0; pointer-events: none; z-index: 1;
  opacity: .18;
  background-image: repeating-radial-gradient(
    circle at 20% 30%, rgba(255,255,255,.10) 0 1px, transparent 1px 4px
  );
  mix-blend-mode: screen;
}
.bg-scanlines {
  position: fixed; inset: 0; pointer-events: none; z-index: 2;
  opacity: .25;
  background: repeating-linear-gradient(
    0deg, rgba(255,255,255,.025) 0 1px, transparent 1px 4px
  );
}

/* ===== Screen layout ===== */
.rx-screen {
  position: relative; z-index: 3;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 22px 28px;
  gap: 18px;
  overflow: visible;
}

/* ===== TOP BAR ===== */
.rx-topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.01));
  position: relative;
}
.rx-topbar::before {
  content: ""; position: absolute; left: -1px; top: -1px; bottom: -1px;
  width: 4px; background: var(--red);
}
.rx-brand {
  display: flex; align-items: center; gap: 14px;
}
.rx-brand-logo {
  width: 48px; height: 48px; object-fit: contain;
  filter: brightness(1.4) contrast(1.2);
}
/* 放大版（首頁登入用）— 約 +60% */
.rx-brand-logo--lg {
  width: 78px; height: 78px;
  filter: brightness(1.4) contrast(1.2) drop-shadow(0 0 8px rgba(255,255,255,.25));
}
@media (max-width: 480px) {
  .rx-brand-logo--lg { width: 58px; height: 58px; }
}
.rx-brand-text {
  display: flex; flex-direction: column; gap: 2px;
}
.rx-brand-text b {
  font-family: "OCR A Extended", "Times New Roman", serif;
  font-size: 18px; letter-spacing: .14em;
  color: #f0f0f0;
}
.rx-brand-text small {
  font-size: 10px; letter-spacing: .28em;
  color: var(--text-dim);
}

.rx-topbar-status {
  display: flex; gap: 28px;
}
.ts-block {
  display: flex; flex-direction: column; gap: 4px;
  text-align: right;
}
.ts-block small {
  font-size: 9px; letter-spacing: .25em;
  color: var(--text-dim);
}
.ts-block b {
  font-family: "OCR A Extended", "Share Tech Mono", "Courier New", monospace;
  font-size: 14px; letter-spacing: .08em;
  color: #d8d8d8;
}
.dot {
  display: inline-block;
  width: 7px; height: 7px; border-radius: 50%;
  margin-right: 4px; vertical-align: middle;
}
.dot.ok { background: var(--ok); box-shadow: 0 0 8px var(--ok); }

/* ===== Center body (panel + sides) ===== */
.rx-screen > main, .rx-screen {
  /* main is .rx-screen, body content */
}
.rx-screen {
  position: relative;
}
.rx-side-left, .rx-side-right {
  position: absolute;
  top: 110px;
  width: 240px;
  display: flex; flex-direction: column; gap: 14px;
  font-family: "OCR A Extended", "Share Tech Mono", "Noto Sans TC", monospace;
  color: var(--text-dim);
  font-size: 11px; letter-spacing: .14em;
  z-index: 4;
}
.rx-side-left { left: 28px; top: calc(110px + 1cm); }
.rx-side-right { right: 28px; align-items: stretch; top: calc(110px + 1cm); }

.meter { display: flex; flex-direction: column; gap: 6px; }
.meter-row {
  display: flex; align-items: baseline; gap: 8px;
  color: var(--text-2);
}
.meter-row span:first-child {
  font-family: var(--font-sans);
  font-size: 12px; color: #d8d8d8; letter-spacing: .12em;
}
.meter-row span:nth-child(2) {
  font-size: 9px; color: var(--text-faint); letter-spacing: .25em;
}
.meter-row b {
  margin-left: auto; font-size: 12px;
  color: var(--text); font-family: "OCR A Extended", "Share Tech Mono", monospace;
}
.meter-bar {
  height: 6px; border: 1px solid var(--border-soft);
  background: rgba(0,0,0,.5); overflow: hidden; position: relative;
}
.meter-bar i {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--text-2), #fff);
  box-shadow: 0 0 8px rgba(255,255,255,.4);
}
.meter-bar.danger i {
  background: linear-gradient(90deg, #5a3aa8, var(--red));
  box-shadow: 0 0 8px rgba(140, 92, 220,.5);
}
.meter.mini .meter-row span:first-child { font-size: 11px; }

.data-row {
  display: flex; flex-direction: column; gap: 3px;
  padding: 8px 0;
  border-top: 1px solid var(--border-faint);
}
.data-row small {
  font-size: 9px; letter-spacing: .28em; color: var(--text-faint);
}
.data-row b {
  font-family: "OCR A Extended", "Share Tech Mono", monospace;
  font-size: 13px; color: #d8d8d8; letter-spacing: .08em;
}
.data-row b.ok { color: var(--ok); }
.data-row b.hi { color: var(--red); font-size: 16px; }
.data-row.right { text-align: right; }

.rx-status-btn {
  margin-top: 4px;
  padding: 8px 14px;
  background: rgba(0,0,0,.5);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-family: "OCR A Extended", "Share Tech Mono", monospace;
  font-size: 11px; letter-spacing: .25em;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  align-self: flex-start;
  transition: border-color .2s, background .2s;
}
.rx-status-btn:hover { border-color: var(--red); }

.rx-barcode {
  margin-top: 4px; height: 36px;
  background: repeating-linear-gradient(
    90deg, rgba(215,220,225,.55) 0 2px, transparent 2px 5px,
    rgba(215,220,225,.3) 5px 6px, transparent 6px 9px
  );
  opacity: .7;
}

/* ===== CENTER PANEL ===== */
.rx-panel {
  position: relative;
  width: min(540px, 92vw);
  margin: 30px auto 20px;
  /* 2026-05-13 — 底部從 40px 縮成 26px：足夠呼吸但不留多餘空白 */
  padding: 60px 56px 26px;
  background: #000;
  box-shadow:
    0 0 60px rgba(0,0,0,.85),
    inset 0 0 80px rgba(0,0,0,.4);
  z-index: 5;
}
/* 2026-05-17 客戶反饋:底部 + 邊框內填滿 + 周圍多餘透明去除 —
   inset 全 0,texture 一路鋪到 panel 4 邊;frame PNG (z-index:4) 仍蓋邊線。 */
.rx-panel::before {
  content: ""; position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0,0,0,.35), rgba(0,0,0,.55)),
    url('rx-assets/assets/rx-panel-bg.png') center/cover no-repeat;
}
/* Frame overlay — 2026-05-17 累計外擴:上 +0.21 / 左右各 +0.11 / 下不變 (相對原始 inset:0) */
.rx-panel::after {
  content: ""; position: absolute;
  inset: -0.52cm -0.42cm -0.25cm;   /* top / horizontal / bottom */
  pointer-events: none; z-index: 4;
  background: url('rx-assets/assets/rx-frame-simple.png') center/100% 100% no-repeat;
}
/* Make sure form/header content sits above the textured ::before */
.rx-panel > * { position: relative; z-index: 1; }

.rx-panel-head {
  text-align: center;
  margin-bottom: 24px;     /* 2026-05-17 整齊節奏:統一 24 */
}
.rx-tagline {
  margin: 0 0 18px;
  font-family: "OCR A Extended", "Times New Roman", serif;
  font-size: 16px; letter-spacing: .35em;
  color: #bfc2c4; white-space: nowrap;
}
.rx-mark {
  display: block; margin: 0 auto 16px;  /* 2026-05-17 logo→副標 從 28 縮到 16 */
  width: 200px; max-width: 60%; height: auto;
  filter: drop-shadow(0 0 14px rgba(255,255,255,.35)) brightness(1.05);
}
.rx-system-title {
  margin: 0 0 8px;
  font-size: 22px; letter-spacing: .35em;
  color: #f0f0f0; font-weight: 400;
}
.rx-system-subtitle {
  margin: 0;
  display: flex; align-items: center; justify-content: center; gap: 14px;
  font-size: 16px; letter-spacing: .25em;
  color: #d8d8d8; font-weight: 500;
}
.rx-system-subtitle span {
  display: block; width: 36px; height: 1px;
  background: rgba(255,255,255,.4);
}

/* ===== PORTAL STRIP ===== */
.rx-portal-strip {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  margin-bottom: 24px;     /* 2026-05-17 同節奏 24 */
}
.rx-portal-strip button {
  padding: 12px 0;
  background: rgba(8,9,10,.7);
  border: 1px solid var(--border-soft);
  color: var(--text-dim);
  font-family: inherit;
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  transition: border-color .2s, color .2s, background .2s;
}
.rx-portal-strip button b {
  font-size: 14px; letter-spacing: .15em; font-weight: 500;
}
.rx-portal-strip button small {
  font-size: 9px; letter-spacing: .25em; color: var(--text-faint);
}
.rx-portal-strip button:hover {
  border-color: var(--border); color: var(--text-2);
}
.rx-portal-strip button.active {
  background: linear-gradient(180deg, rgba(255,255,255,.16), rgba(255,255,255,.04));
  border-color: rgba(255,255,255,.7);
  color: #fff;
  box-shadow: inset -3px 0 var(--red);
}
.rx-portal-strip button.active small { color: var(--text-dim); }

/* ===== Alert ===== */
.alert-box {
  padding: 12px 16px; margin-bottom: 16px;    /* 2026-05-17 alert→form 統一 16 */
  font-size: 13px; letter-spacing: .08em;
  border: 1px solid; display: none;
}
.alert-box.error {
  background: rgba(140, 92, 220,.12);
  color: #b38aff; border-color: var(--red);
}
.alert-box.success {
  background: rgba(108,208,122,.14);
  color: #7bd88f; border-color: var(--ok);
}
.alert-box.warning {
  background: rgba(255,184,77,.12);
  color: #ffc46b; border-color: rgba(255,184,77,.55);
}

/* ===== FORMS ===== */
.form-mode { display: none; }
.form-mode.active { display: block; }

label {
  display: block; margin: 0 0 8px;
  font-size: 13px; letter-spacing: .15em;
  color: #d8d8d8;
}
/* 2026-05-20 客戶要求:登入頁 label 英文以帳號為標準對齊,所有 ico 固定 16px 寬置中,後面文字起點一致 */
.ico {
  display: inline-block;
  width: 16px;
  text-align: center;
  font-size: 14px;
  margin-right: 6px;
  color: var(--text-2);
  vertical-align: middle;
}
/* 鎖頭 icon — 客戶提供 PNG 取代原 SVG mask (2026-05-16);保留 12px 視覺大小但容器寬度跟其他 ico 一致 */
.ico.ico-lock {
  height: 12px;
  background: url("rx-assets/assets/icon-lock.png") center/contain no-repeat;
}

input[type="text"], input[type="email"], input[type="password"], input[type="number"] {
  width: 100%; height: 44px;
  background:
    radial-gradient(ellipse at center, rgba(60,62,68,.45) 0%, rgba(15,17,20,.88) 75%);
  border: 1px solid rgba(255,255,255,.7);
  color: #fff;
  /* 2026-05-16 改用網頁字型 (OCR A Extended + LINE Seed + Fusion Pixel),不再用 Noto Sans TC fallback */
  font-family: var(--font-sans);
  font-size: 13px;
  letter-spacing: .06em;
  padding: 0 14px;  /* 統一左右 padding,確保文字底線距離一致 */
  margin-bottom: 14px;
  outline: none;
  box-shadow:
    0 0 10px rgba(255,255,255,.16),
    0 0 2px rgba(255,255,255,.3),
    inset 0 0 10px rgba(255,255,255,.05);
  transition: border-color .2s, box-shadow .2s, filter .2s;
}
input::placeholder { color: var(--text-faint); }
input:hover:not([disabled]) { filter: brightness(1.08); }
input:focus {
  border-color: #fff;
  box-shadow:
    0 0 22px rgba(255,255,255,.4),
    0 0 6px rgba(255,255,255,.55),
    inset 0 0 14px rgba(255,255,255,.10);
}
input:focus-visible {
  outline: 1px solid var(--red);
  outline-offset: 2px;
}
input[disabled] { opacity: .4; cursor: not-allowed; }

.password-wrap { position: relative; }
.password-wrap input { padding-right: 50px; }
.eye {
  position: absolute; right: 12px; top: 12px;
  width: 24px; height: 24px;
  background: transparent; border: 0; color: var(--text-dim);
  font-size: 18px; cursor: pointer;
}
.eye:hover { color: var(--text); }

.row {
  display: flex; justify-content: space-between; align-items: center;
  margin: -2px 0 18px;
}
.check {
  display: flex; align-items: center; margin: 0;
  font-size: 12px; color: var(--text-dim); letter-spacing: .06em;
}
.check input { display: none; }
.check i {
  width: 18px; height: 18px;
  border: 1px solid var(--text-dim);
  margin-right: 8px;
  display: inline-block;
  position: relative;
}
.check input:checked + i::after,
.check input:disabled + i::after {
  content: "✓"; position: absolute;
  top: -2px; left: 2px;
  font-size: 14px; color: var(--ok);
}
a {
  color: var(--text-2); text-decoration: none;
  font-size: 12px; letter-spacing: .06em;
  transition: color .2s;
}
a:hover { color: var(--red-2); }

.hint-text {
  color: var(--text-dim); font-size: 13px; line-height: 1.6;
  letter-spacing: .08em;
  margin: 0 0 22px;
}

/* ===== LOGIN BUTTON — white frame + outer glow on dark gradient ===== */
.login {
  width: 100%; height: 48px;
  background:
    radial-gradient(ellipse at center, rgba(60,62,68,.55) 0%, rgba(20,22,26,.85) 70%);
  border: 1px solid rgba(255,255,255,.85);
  color: #fff;
  font-family: "OCR A Extended", "Share Tech Mono", "Noto Sans TC";
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 2px;
  box-shadow:
    0 0 18px rgba(255,255,255,.35),
    0 0 4px rgba(255,255,255,.5),
    inset 0 0 16px rgba(255,255,255,.08);
  transition: filter .2s, transform .1s, box-shadow .2s;
  position: relative;
}
.login:hover:not([disabled]) {
  filter: brightness(1.1);
  box-shadow:
    0 0 26px rgba(255,255,255,.5),
    0 0 6px rgba(255,255,255,.6),
    inset 0 0 18px rgba(255,255,255,.12);
}
.login:active:not([disabled]) { transform: translateY(1px); }
/* 2026-05-16 LOGIN / CONNECTING 字體統一縮小 + 置中 */
.login strong {
  display: block; font-size: 14px; letter-spacing: .18em; font-weight: 500;
  text-align: center;
}
.login small {
  display: block; margin-top: 1px;
  font-size: 10px; letter-spacing: .26em;
  font-family: var(--font-sans);
  text-align: center;
}
/* clean variant:去掉副標,改用頁面字體 */
.login.login--clean { font-family: var(--font-sans); }
.login.login--clean strong { font-size: 15px; letter-spacing: .26em; }

/* LOGIN button image variant (rxloginm.png) */
.login.btn-img {
  background: url('rx-assets/assets/rxloginm.png') center/contain no-repeat transparent;
  border: none; box-shadow: none; height: 110px;
  position: relative;
}
.login.btn-img:not([disabled]) strong,
.login.btn-img:not([disabled]) small { opacity: 0; }
.login.btn-img[disabled] {
  background-image: none;
  background: linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,.04));
  border: 1px solid rgba(255,255,255,.6);
  box-shadow: inset -3px 0 var(--red);
  cursor: wait;
}
.login.btn-img[disabled] strong,
.login.btn-img[disabled] small { opacity: 1; }
.login.btn-img:hover:not([disabled]) {
  filter: drop-shadow(0 0 18px rgba(255,255,255,.3));
}

/* ===== OR DIVIDER ===== */
.or {
  display: flex; align-items: center; justify-content: center; gap: 18px;
  margin: 22px 0;
  color: var(--text-dim); font-size: 13px; letter-spacing: .25em;
}
.or span {
  height: 1px; flex: 1; max-width: 100px;
  background: linear-gradient(90deg, transparent, var(--text-dim));
}
.or span:last-child {
  background: linear-gradient(90deg, var(--text-dim), transparent);
}

/* ===== SCAN BUTTON ===== */
.scan {
  width: 100%; height: 72px;
  background: rgba(20,21,21,.6);
  border: 1px solid var(--border-soft);
  color: var(--text-2);
  display: grid; grid-template-columns: 56px 1fr; align-items: center;
  text-align: left; padding-left: 22px;
  cursor: pointer; font-family: inherit;
}
.scan em {
  grid-row: 1/3; font-size: 32px; font-style: normal;
  color: var(--text-dim);
}
.scan strong {
  display: block; font-size: 17px; letter-spacing: .25em; font-weight: 400;
}
.scan small {
  display: block; margin-top: 3px;
  font-size: 11px; letter-spacing: .15em; color: var(--text-faint);
}
.scan[disabled] { opacity: .4; cursor: not-allowed; pointer-events: none; }

/* ===== PANEL FOOTER =====
   要點：必須在 frame 邊框 (.rx-panel::after z-index 4) 之上才看得到。
   位置：依賴 .rx-panel padding-bottom: 40px 把 footer 推到 frame 邊框內側上方。
*/
.rx-panel-foot {
  position: relative;
  z-index: 5;
  text-align: center;
  margin-top: 16px;       /* 2026-05-17 從 4 改 16:跟前面節奏一致,不擠到按鈕 */
  font-size: 13px; letter-spacing: .12em;
  color: var(--text-dim);
}
.rx-panel-foot a { margin-left: 16px; color: #eee; }
.rx-panel-foot a:hover { color: var(--red-2); }

/* ===== BOTTOM BAR ===== */
.rx-bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 18px;
  border-top: 1px solid var(--border-soft);
  font-size: 10px; letter-spacing: .25em;
  color: var(--text-dim);
  font-family: "OCR A Extended", "Share Tech Mono", monospace;
}
.rx-bottom .bot-c {
  flex: 1; text-align: center; opacity: .55;
  letter-spacing: .5em;
}

/* ===== RESPONSIVE ===== */
/* 平板 / 小筆電：收掉左右裝飾欄 */
@media (max-width: 1100px) {
  .rx-side-left, .rx-side-right { display: none; }
}

/* 手機橫式 / 小平板：topbar 改一行排列、面板縮小、按鈕觸控友善 */
@media (max-width: 760px) {
  body { overflow-x: hidden; }
  .rx-screen { padding: 12px 12px; gap: 12px; }
  .rx-topbar {
    flex-direction: row; align-items: center; justify-content: space-between;
    gap: 12px; padding: 10px 14px;
    flex-wrap: wrap;
  }
  .rx-topbar::before { width: 3px; }
  .rx-topbar-status {
    flex: 1; justify-content: flex-end; gap: 14px;
    min-width: 0;
  }
  .ts-block { text-align: right; }
  .ts-block small { font-size: 8px; letter-spacing: .18em; }
  .ts-block b { font-size: 11px; letter-spacing: .04em; }
  .rx-brand-logo { width: 38px; height: 38px; }

  /* panel inset texture: switch from % to fixed px so it stays inside the frame
     regardless of aspect ratio */
  .rx-panel { padding: 26px 10px 10px; margin: 14px auto; }
  .rx-panel::before { inset: 0; }
  /* 把粗框圖換成細 1px 邊：原圖在小尺寸下視覺邊太厚，會把輸入框擠窄 */
  .rx-panel::after {
    background: none;
    border: 1px solid rgba(215, 220, 225, .5);
  }

  .rx-mark { width: 130px; margin-bottom: 18px; }
  .rx-system-subtitle { font-size: 13px; letter-spacing: .16em; gap: 8px; }
  .rx-system-subtitle span { width: 20px; }

  .rx-portal-strip { gap: 4px; margin-bottom: 18px; }
  .rx-portal-strip button { padding: 10px 0; }
  .rx-portal-strip button b { font-size: 12px; letter-spacing: .08em; }
  .rx-portal-strip button small { font-size: 7px; letter-spacing: .15em; }

  label { font-size: 12px; letter-spacing: .1em; margin-bottom: 6px; }
  input[type="text"], input[type="email"], input[type="password"] {
    height: 46px; font-size: 14px; padding: 0 12px;
    margin-bottom: 12px;
  }
  .row { margin-bottom: 12px; }
  .check { font-size: 11px; }

  .login { height: 50px; }
  .login strong { font-size: 15px; letter-spacing: .15em; }
  .login small { font-size: 10px; letter-spacing: .22em; margin-top: 1px; }

  .or { margin: 16px 0; font-size: 11px; }
  .or span { max-width: 80px; }

  .scan {
    height: 60px; padding-left: 14px;
    grid-template-columns: 40px 1fr;
  }
  .scan em { font-size: 22px; }
  .scan strong { font-size: 13px; letter-spacing: .15em; }
  .scan small { font-size: 9px; }

  .rx-panel-foot { margin-top: 12px; font-size: 12px; }
  .rx-panel-foot a { margin-left: 10px; }

  .rx-bottom {
    flex-direction: column; gap: 4px; padding: 10px 12px;
    font-size: 9px; letter-spacing: .15em;
  }
  .rx-bottom .bot-c { display: none; }
}

/* 手機直立 ≤ 480px：再緊縮一輪 */
@media (max-width: 480px) {
  .rx-screen { padding: 6px 4px; gap: 8px; }
  .rx-topbar { padding: 8px 10px; gap: 8px; }
  .rx-brand-logo { width: 32px; height: 32px; }
  .rx-topbar-status { gap: 8px; }
  .ts-block small { font-size: 7px; letter-spacing: .14em; }
  .ts-block b { font-size: 10px; }
  /* 縮短 SYSTEM TIME 顯示 — 只留時間 (由 JS tickClock 控制 → 改 CSS 隱藏日期不可行，
     改在 JS 裡判斷螢幕寬度切顯示，這裡只縮字級避免溢出) */

  .rx-panel { padding: 22px 6px 18px; margin: 10px auto; width: 98vw; }
  .rx-panel::before { inset: 0; }

  .rx-mark { width: 100px; margin-bottom: 14px; }
  .rx-system-subtitle { font-size: 11px; letter-spacing: .12em; gap: 6px; }
  .rx-system-subtitle span { width: 14px; }

  .rx-portal-strip { gap: 3px; margin-bottom: 14px; }
  .rx-portal-strip button { padding: 8px 0; }
  .rx-portal-strip button b { font-size: 11px; letter-spacing: .04em; }
  .rx-portal-strip button small { font-size: 6px; letter-spacing: .1em; }

  label { font-size: 11px; }
  input[type="text"], input[type="email"], input[type="password"] {
    height: 42px; font-size: 13px; padding: 0 10px;
    margin-bottom: 10px;
  }
  .row { margin-bottom: 10px; flex-wrap: wrap; gap: 8px; }
  .check { font-size: 10px; }
  .check i { width: 14px; height: 14px; margin-right: 6px; }

  .login { height: 46px; }
  .login strong { font-size: 14px; letter-spacing: .12em; }
  .login small { font-size: 9px; letter-spacing: .18em; }

  .or { margin: 12px 0; }
  .or span { max-width: 50px; }

  .scan { height: 54px; padding-left: 10px; grid-template-columns: 32px 1fr; }
  .scan em { font-size: 18px; }
  .scan strong { font-size: 12px; }
  .scan small { font-size: 8px; }

  .rx-panel-foot { font-size: 11px; margin-top: 18px; }
}

/* ===== embed mode（被 index.html iframe 載入）===== */
/* body 透明讓 mp4 背景透出；裝飾噪訊降到極淡；中央面板加深半透明 backdrop 確保表單可讀 */
html.embed-mode { background: transparent; }
html.embed-mode body { background: transparent !important; }
html.embed-mode .bg-noise { opacity: .06; }
html.embed-mode .bg-scanlines { opacity: .10; }
html.embed-mode .rx-panel {
  background-color: rgba(8, 9, 12, .58) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* ===== 手機強制橫向提示 (Force Landscape on Mobile) =====
   login.html 沒引共用 shell CSS 所以同份規則在這也放一次
   2026-05-17 響應式優化:900px → 640px,讓 7"-12" 平板直立模式可用 */
@media (orientation: portrait) and (max-width: 640px) {
  body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: #040607;
    pointer-events: auto;
  }
  body::after {
    content: "請將裝置橫向旋轉\A PLEASE ROTATE YOUR DEVICE";
    white-space: pre-line;
    position: fixed;
    inset: 0;
    z-index: 100001;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #e8e8e8;
    font-family: "OCR A Extended", "Noto Sans TC", "Microsoft JhengHei", Arial, sans-serif;
    font-size: 14px;
    letter-spacing: .2em;
    line-height: 2.4;
    padding: 24px;
    pointer-events: none;
  }
}

/* Mobile portrait proposal: customer production shows rotate-only here; this keeps login usable while preserving the R.X terminal style. */
@media (orientation: portrait) and (max-width: 640px) {
html,
body {
  height: auto;
  min-height: 100svh;
  width: 100%;
  max-width: 100%;
  overflow: auto !important;
  overflow-x: hidden !important;
  background: #000;
}

  body::before,
  body::after {
    content: none;
    display: none;
  }

  .rx-side-left,
  .rx-side-right,
  .rx-bottom {
    display: none;
  }

  .rx-screen {
    width: 100%;
    max-width: 100vw;
    min-width: 0;
    min-height: 100svh;
    height: auto;
    display: grid;
    grid-template-rows: auto 1fr;
    padding: 8px 6px 16px;
    gap: 8px;
    overflow: visible;
  }

  .rx-topbar {
    padding: 8px 10px;
  }

  .rx-brand-logo--lg {
    width: 54px;
    height: 54px;
  }

  .rx-topbar-status {
    gap: 8px;
  }

  .ts-block:first-child {
    display: none;
  }

  .rx-panel {
    width: min(340px, calc(100vw - 28px)) !important;
    min-width: 0 !important;
    max-width: calc(100vw - 28px);
    margin: 8px auto 0 !important;
    padding: 24px 14px 20px;
    background: #000;
    justify-self: center;
  }

  .rx-panel::before {
    inset: 0;
  }

  .rx-panel::after {
    inset: 0;
    background: none;
    border: 1px solid rgba(215, 220, 225, .5);
  }

  .rx-mark {
    width: 112px;
    max-width: 52vw;
    margin-bottom: 12px;
  }

  .rx-system-subtitle {
    font-size: 12px;
    letter-spacing: .12em;
  }

  .rx-portal-strip {
    width: 100%;
    min-width: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    margin-bottom: 14px;
  }

  .rx-portal-strip button {
    min-width: 0;
    overflow: hidden;
  }

  .rx-portal-strip button {
    min-height: 48px;
    padding: 8px 2px;
  }

  .rx-portal-strip button b {
    font-size: 11px;
  }

  .rx-portal-strip button small {
    font-size: 6px;
  }

  input[type="text"],
  input[type="email"],
  input[type="password"],
  .login {
    width: 100%;
    min-width: 0;
  }
}

@media (orientation: portrait) and (max-width: 359px) {
  .rx-panel {
    width: 304px !important;
  }
}
