@font-face {
  font-family: 'Cubic11';
  src: url('fonts/Cubic_11.woff2') format('woff2');
  font-display: swap;
}

:root {
  --orange: #ff7a00;
  --orange-d: #d45f00;
  --orange-l: #ffd9b3;
  --black: #141414;
  --white: #ffffff;
  --paper: #fff8f0;
  --gray: #8a8a8a;
  --line: 3px solid var(--black);
  --shadow: 4px 4px 0 var(--black);

  --c-red: #e0291f;
  --c-yellow: #d9a400;
  --c-blue: #1f6fe0;
  --c-orange: #ff7a00;
  --c-green: #1f9e3a;
  --c-pink: #ff4f9a;
  --c-purple: #8a3fd6;
  --c-black: #141414;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: 'Cubic11', 'PingFang TC', 'Microsoft JhengHei', monospace;
  font-size: 16px;
  color: var(--black);
  background-color: var(--orange);
  background-image:
    linear-gradient(45deg, rgba(255,255,255,.12) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.12) 75%),
    linear-gradient(45deg, rgba(255,255,255,.12) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.12) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 8px 8px;
  -webkit-font-smoothing: none;
}
button, input, textarea { font: inherit; color: inherit; }
img { image-rendering: pixelated; }
.hidden { display: none !important; }
.screen { min-height: 100%; }

/* ---------- 像素視窗 ---------- */
.win {
  background: var(--white);
  border: var(--line);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.win-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  background: var(--black);
  color: var(--white);
  letter-spacing: 1px;
}
.win-btns { display: flex; gap: 4px; }
.win-btns i { width: 12px; height: 12px; background: var(--orange); border: 2px solid var(--white); display: block; }
.win-btns i:last-child { background: var(--white); }
.win-body { padding: 14px; }

.px-btn {
  background: var(--orange);
  color: var(--white);
  border: var(--line);
  box-shadow: 3px 3px 0 var(--black);
  padding: 8px 16px;
  cursor: pointer;
  position: relative;
  white-space: nowrap;
  text-shadow: 1px 1px 0 var(--black);
}
.px-btn:hover { background: #ff8f26; }
.px-btn:active { transform: translate(3px, 3px); box-shadow: none; }
.px-btn.small { padding: 4px 10px; font-size: 14px; }
.px-btn.ghost { background: var(--white); color: var(--black); text-shadow: none; }
.px-btn.ghost:hover { background: var(--orange-l); }
.px-btn.dark { background: var(--black); }
.px-input:focus { border-color: var(--orange-d); }
.px-btn:focus-visible, .me:focus-visible, .buddy:focus-visible, .tab:focus-visible, .swatch:focus-visible, .av-choice:focus-visible {
  outline: 3px dashed var(--orange-d); outline-offset: 2px;
}

.px-input {
  border: var(--line);
  background: var(--white);
  padding: 8px 10px;
  width: 100%;
  border-radius: 0;
  outline: none;
  box-shadow: inset 3px 3px 0 #e8e8e8;
}
.px-input:focus { background: var(--paper); }
.row { display: flex; gap: 8px; align-items: center; }
label { display: block; margin: 10px 0 6px; font-size: 14px; }
.note { font-size: 13px; color: #555; margin: 8px 0 0; }
.err { color: var(--c-red); font-size: 14px; min-height: 1em; margin: 8px 0 0; }

.avatar { width: 32px; height: 32px; border: 2px solid var(--black); background: var(--white); flex: none; }

/* ---------- 登入 ---------- */
#login {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  padding: 32px 16px;
  flex-wrap: wrap;
}
.nobori-row { display: flex; gap: 18px; align-items: flex-end; }
.nobori {
  position: relative;
  width: 104px;
  height: 420px;
  border: var(--line);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 0 10px;
  overflow: hidden;
}
.nobori::before { /* 旗竿 */
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 10px; background: var(--black);
}
.nobori.orange { background: repeating-linear-gradient(140deg, var(--orange) 0 26px, var(--white) 26px 52px); }
.nobori.dark { background: repeating-linear-gradient(140deg, var(--black) 0 26px, var(--white) 26px 52px); height: 380px; }
.nb-small, .nb-big { writing-mode: vertical-rl; text-orientation: upright; font-weight: bold; white-space: nowrap; flex: none; }
.nb-small {
  font-size: 16px; background: var(--white); border: 2px solid var(--black); padding: 6px 2px; margin-top: 6px; letter-spacing: 2px;
}
.nb-big {
  font-size: 66px; line-height: 1; margin-top: 16px; letter-spacing: 6px; color: var(--black);
  text-shadow: 4px 0 0 var(--white), -4px 0 0 var(--white), 0 4px 0 var(--white), 0 -4px 0 var(--white),
               4px 4px 0 var(--white), -4px -4px 0 var(--white), 4px -4px 0 var(--white), -4px 4px 0 var(--white);
}
.nobori.dark .nb-big { color: var(--orange); text-shadow: 4px 0 0 var(--black), -4px 0 0 var(--black), 0 4px 0 var(--black), 0 -4px 0 var(--black), 4px 4px 0 var(--black), -4px -4px 0 var(--black), 4px -4px 0 var(--black), -4px 4px 0 var(--black); }
.nb-num {
  margin-top: auto; background: var(--white); border: 2px solid var(--black); font-size: 12px; padding: 2px 4px; letter-spacing: 1px;
}
.login-win { width: min(360px, 100%); }
.login-tip { margin: 0 0 16px; line-height: 1.7; }
.google-btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 17px; padding: 12px 16px; }
.google-btn:hover { background: #333; }
.g-mark { width: 24px; height: 24px; line-height: 20px; background: var(--white); color: var(--orange); border: 2px solid var(--white); text-shadow: none; font-weight: bold; }
.demo-note { background: var(--paper); border: 2px dashed var(--orange-d); padding: 8px; line-height: 1.6; }

/* ---------- 主畫面 ---------- */
#main { display: flex; flex-direction: column; height: 100dvh; padding: 12px; gap: 12px; }
.topbar {
  display: flex; align-items: center; gap: 12px;
  background: var(--white); border: var(--line); box-shadow: var(--shadow);
  padding: 8px 12px;
}
.logo { display: flex; align-items: center; gap: 8px; font-size: 22px; letter-spacing: 2px; margin-right: auto; }
.logo-mark {
  width: 22px; height: 22px; display: inline-block;
  background: repeating-linear-gradient(140deg, var(--orange) 0 5px, var(--white) 5px 10px);
  border: 3px solid var(--black);
}
.me {
  display: flex; align-items: center; gap: 8px; background: var(--paper); border: 2px solid var(--black);
  padding: 4px 10px 4px 4px; cursor: pointer; text-align: left;
}
.me:hover { background: var(--orange-l); }
.me .avatar { width: 36px; height: 36px; }
.me-text { display: flex; flex-direction: column; line-height: 1.25; }
.me-text small { font-size: 12px; color: #555; }

.layout { flex: 1; display: grid; grid-template-columns: 280px 1fr; gap: 12px; min-height: 0; }

.sidebar { min-height: 0; }
.side-body { overflow-y: auto; flex: 1; padding: 10px; }
.add-form label { margin-top: 0; }
.group h3 {
  font-size: 15px; font-weight: normal; margin: 16px 0 6px; padding: 4px 8px;
  background: var(--orange); color: var(--white); border: 2px solid var(--black); text-shadow: 1px 1px 0 var(--black);
  display: flex; justify-content: space-between;
}
.count { font-size: 13px; }
.buddy-list { list-style: none; padding: 0; margin: 0; }
.buddy {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px; border: 2px solid transparent;
  background: none; cursor: pointer; text-align: left;
}
.buddy:hover { background: var(--orange-l); border-color: var(--black); }
.buddy.active { background: var(--orange-l); border-color: var(--black); }
.buddy .bname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.buddy .status { font-size: 12px; color: var(--gray); display: flex; align-items: center; gap: 4px; }
.dot { width: 8px; height: 8px; background: #bbb; border: 2px solid var(--black); display: inline-block; }
.online .dot { background: #3ccf4e; }
.online .status { color: var(--black); }
.offline .avatar { filter: grayscale(1); opacity: .65; }
.buddy-list.dim .buddy { cursor: default; opacity: .7; }
.buddy .acts { display: flex; gap: 4px; }
.mini {
  border: 2px solid var(--black); background: var(--white); cursor: pointer; padding: 0 6px; font-size: 13px; line-height: 20px;
}
.mini.ok { background: var(--orange); color: var(--white); }
.mini:hover { filter: brightness(.95); }
.badge {
  background: var(--c-red); color: var(--white); border: 2px solid var(--black); font-size: 11px;
  padding: 0 4px; line-height: 14px; margin-left: 4px; min-width: 18px; text-align: center; display: inline-block;
}

/* 聊天區 */
.chat { min-height: 0; position: relative; }
.tabs { display: flex; gap: 0; background: var(--black); overflow-x: auto; scrollbar-width: none; flex: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: flex; align-items: center; gap: 6px; padding: 7px 12px; border: none; border-right: 2px solid var(--black);
  background: #3a3a3a; color: #ddd; cursor: pointer; white-space: nowrap; flex: none;
}
.tab:hover { background: #555; }
.tab.active { background: var(--orange); color: var(--white); text-shadow: 1px 1px 0 var(--black); }
.tab img { width: 18px; height: 18px; border: 1px solid var(--black); background: var(--white); }
.tab .close { margin-left: 2px; padding: 0 4px; border: 1px solid currentColor; line-height: 14px; font-size: 12px; }
.tab .close:hover { background: var(--black); color: var(--white); }
.chat-head {
  display: flex; align-items: baseline; gap: 10px; padding: 8px 14px; border-bottom: var(--line);
  background: var(--paper); flex: none;
}
#chatTitle { font-size: 18px; }
.chat-sub { font-size: 13px; color: #555; }
.messages {
  flex: 1; overflow-y: auto; padding: 10px 14px; min-height: 0;
  background-color: var(--white);
  background-image: linear-gradient(var(--white) 50%, #fff6ec 50%);
  background-size: 100% 64px;
}
.msg { display: flex; gap: 8px; padding: 5px 0; align-items: flex-start; }
.msg .avatar { width: 30px; height: 30px; margin-top: 2px; }
.msg-main { min-width: 0; flex: 1; }
.msg-meta { font-size: 13px; color: #555; display: flex; gap: 8px; align-items: baseline; }
.msg-meta b { color: var(--black); font-size: 15px; font-weight: normal; }
.msg.mine .msg-meta b { color: var(--orange-d); }
.msg-text { white-space: pre-wrap; word-break: break-word; line-height: 1.55; font-size: 16px; margin-top: 1px; }
.msg.pending { opacity: .5; }
.sys { text-align: center; font-size: 13px; color: #777; margin: 10px 0; }
.sys span { background: var(--white); border: 2px dashed #bbb; padding: 2px 10px; }
.empty { text-align: center; color: #777; margin-top: 40px; line-height: 1.8; }

.c-red { color: var(--c-red); } .c-yellow { color: var(--c-yellow); } .c-blue { color: var(--c-blue); }
.c-orange { color: var(--c-orange); } .c-green { color: var(--c-green); } .c-pink { color: var(--c-pink); }
.c-purple { color: var(--c-purple); } .c-black { color: var(--c-black); }

.composer { border-top: var(--line); padding: 10px; background: var(--paper); flex: none; }
.color-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; align-items: center; }
.color-row .lbl { font-size: 13px; margin-right: 4px; }
.swatch {
  width: 26px; height: 26px; border: 2px solid var(--black); cursor: pointer; padding: 0; position: relative;
}
.swatch[aria-checked="true"] { box-shadow: 0 0 0 2px var(--white), 0 0 0 4px var(--black); }
.swatch[aria-checked="true"]::after {
  content: ''; position: absolute; inset: 7px; background: var(--white); border: 2px solid var(--black);
}
.send-row { display: flex; gap: 10px; align-items: stretch; }
.send-row textarea { resize: none; min-height: 52px; max-height: 140px; line-height: 1.4; }
.px-btn.send { padding: 0 20px; font-size: 17px; }

.conn {
  position: absolute; left: 50%; top: 92px; transform: translateX(-50%);
  background: var(--c-yellow); color: var(--black); border: 2px solid var(--black); padding: 4px 12px; font-size: 13px;
}

/* 個人資料 */
.modal { position: fixed; inset: 0; background: rgba(20,20,20,.55); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 20; }
.modal-win { width: min(540px, 100%); max-height: 100%; }
.modal-win .win-body { overflow-y: auto; }
.x { background: var(--orange); color: var(--white); border: 2px solid var(--white); cursor: pointer; width: 26px; height: 26px; line-height: 18px; padding: 0; }
.name-count { font-size: 13px; min-width: 40px; text-align: right; }
.name-count.over { color: var(--c-red); }
.avatar-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.av-choice {
  border: 3px solid var(--black); background: var(--white); padding: 6px 4px 4px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px;
}
.av-choice img { width: 56px; height: 56px; }
.av-choice:hover { background: var(--paper); }
.av-choice[aria-checked="true"] { background: var(--orange); color: var(--white); box-shadow: 3px 3px 0 var(--black); text-shadow: 1px 1px 0 var(--black); }
#profileForm .px-btn[type=submit] { margin-top: 10px; width: 100%; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 30;
  background: var(--black); color: var(--white); border: 3px solid var(--orange); padding: 8px 16px; box-shadow: var(--shadow);
  max-width: calc(100% - 32px);
}

.mobile-only { display: none; }

/* ---------- 手機 ---------- */
/* ---------- 添加好友 ---------- */
.add-btn { width: 100%; display: flex; justify-content: center; align-items: center; gap: 6px; }
.add-body { display: grid; gap: 4px; }
.mycode { background: var(--orange-l); border: 3px solid var(--black); padding: 10px 12px; }
.mycode-lbl { font-size: 13px; }
.code-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 2px; }
.code-big { font-size: 36px; letter-spacing: 8px; font-variant-numeric: tabular-nums; color: var(--black); text-shadow: 3px 3px 0 var(--white); }
.mycode .note { margin-top: 4px; }
.found {
  display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 10px;
  border: 3px solid var(--black); background: var(--paper); box-shadow: 3px 3px 0 var(--black);
}
.found .avatar { width: 52px; height: 52px; }
.found-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.found-info b { font-weight: normal; font-size: 18px; }
.found-info small { font-size: 12px; color: #555; }
.px-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: 3px 3px 0 var(--black); }

/* ---------- 私訊列表 ---------- */
.dm-list .buddy { align-items: center; }
.bmain { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.bmain .bname { flex: none; }
.preview { font-size: 12px; color: #666; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.buddy.has-unread .preview { color: var(--black); }
.side-logout { display: none; margin-top: 18px; width: 100%; }

/* ---------- 私訊畫面 ---------- */
.chat-avatar { width: 30px; height: 30px; align-self: center; }
.chat-profile { margin-left: auto; align-self: center; }
.messages.dm {
  background-image: radial-gradient(#ffd9b3 1.5px, transparent 1.6px);
  background-size: 14px 14px;
  background-color: #fffaf4;
}
.messages.dm .msg { padding: 6px 0; }
.messages.dm .msg-main { flex: 0 1 auto; max-width: min(78%, 520px); display: flex; flex-direction: column; align-items: flex-start; }
.messages.dm .msg-text {
  background: var(--white); border: 2px solid var(--black); box-shadow: 2px 2px 0 var(--black);
  padding: 6px 10px; margin-top: 3px;
}
.messages.dm .msg.mine { flex-direction: row-reverse; }
.messages.dm .msg.mine .msg-main { align-items: flex-end; }
.messages.dm .msg.mine .msg-meta { flex-direction: row-reverse; }
.messages.dm .msg.mine .msg-text { background: var(--orange-l); }

.msg-av { padding: 0; border: none; background: none; cursor: pointer; flex: none; line-height: 0; }
.msg-av:hover .avatar { outline: 2px solid var(--orange); outline-offset: 1px; }
.msg-who { padding: 0; border: none; background: none; cursor: pointer; font-size: 15px; color: var(--black); }
.msg-who:hover { text-decoration: underline; text-decoration-color: var(--orange); text-underline-offset: 3px; }
.msg.mine .msg-who { color: var(--orange-d); }
.msg-av:focus-visible, .msg-who:focus-visible { outline: 3px dashed var(--orange-d); outline-offset: 2px; }

/* ---------- 艦員資料卡 ---------- */
.user-win { width: min(330px, 100%); }
.user-body { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding-top: 20px; }
.user-avatar { width: 112px; height: 112px; border: 3px solid var(--black); background: var(--white); box-shadow: 4px 4px 0 var(--black); }
.user-name { font-size: 24px; font-weight: normal; margin: 10px 0 0; }
.user-meta { margin: 0; font-size: 13px; color: #555; }
.user-meta .on { color: #1d8f2c; }
.user-actions { display: flex; gap: 10px; margin-top: 12px; width: 100%; }
.user-actions .px-btn { flex: 1; }
.user-hint { min-height: 1.2em; }

/* ---------- 測試帳號 ---------- */
.demo-accounts { margin-top: 14px; }
.demo-accounts h3 { font-size: 14px; font-weight: normal; margin: 0; padding: 4px 8px; background: var(--black); color: var(--white); }
.demo-accounts .buddy { border-color: var(--black); margin-top: 6px; }
.demo-accounts .buddy .go { font-size: 12px; color: var(--orange-d); }

/* ---------- 手機底部選單 ---------- */
.bottom-nav { display: none; }
.nav-btn {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0 4px;
  border: none; background: none; cursor: pointer; font-size: 12px; color: var(--black);
}
.nav-btn + .nav-btn { border-left: 2px solid var(--black); }
.nav-btn.active { background: var(--orange); color: var(--white); text-shadow: 1px 1px 0 var(--black); }
.nav-ico { font-size: 18px; line-height: 1; }
.nav-btn .badge { position: absolute; top: 4px; left: 58%; margin: 0; }

@media (max-width: 760px) {
  #main { padding: 8px; gap: 8px; }
  .layout { grid-template-columns: 1fr; }
  .mobile-only { display: inline-block; }
  .logo { font-size: 18px; }
  .logo-mark { width: 18px; height: 18px; }
  .me-text small { display: none; }
  .me { padding: 2px 8px 2px 2px; }
  .me .avatar { width: 30px; height: 30px; }
  .me-text b { max-width: 6em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar { gap: 8px; padding: 6px 8px; }
  #logoutBtn { display: none; }
  .sidebar {
    position: fixed; inset: 64px max(8px, env(safe-area-inset-right, 0px)) calc(78px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px)); z-index: 10; display: none;
  }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(3, 1fr); flex: none;
    background: var(--white); border: var(--line); box-shadow: var(--shadow);
  }
  .avatar-grid { grid-template-columns: repeat(4, 1fr); }
  .code-big { font-size: 30px; letter-spacing: 5px; }
  .messages.dm .msg-main { max-width: 82%; }
  .sidebar.open { display: flex; }
  .sidebar .side-logout { display: block; }
  .swatch { width: 24px; height: 24px; }
  .color-row .lbl { display: none; }
  #login { gap: 20px; }
  .nobori { width: 78px; height: 310px; }
  .nobori.dark { height: 290px; }
  .nb-big { font-size: 44px; margin-top: 10px; letter-spacing: 4px; }
  .nb-small { font-size: 13px; letter-spacing: 1px; }
}


.confirm-win { width: min(340px, 100%); }
.confirm-text { margin: 0 0 16px; line-height: 1.6; }
.confirm-row { justify-content: flex-end; }

/* ---------- 管理員 ---------- */
.admin-tag {
  display: inline-block; font-size: 11px; line-height: 14px; padding: 0 4px; margin-left: 4px; vertical-align: 1px;
  background: var(--black); color: var(--orange); border: 1px solid var(--black); text-shadow: none;
}
.ann-bar {
  display: flex; gap: 10px; align-items: flex-start; padding: 8px 14px; flex: none;
  background: repeating-linear-gradient(140deg, var(--orange-l) 0 10px, #ffe7cf 10px 20px);
  border-bottom: var(--line);
}
.ann-pin { font-size: 16px; line-height: 1.4; }
.ann-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ann-main b { font-weight: normal; font-size: 12px; color: var(--orange-d); }
.ann-text { white-space: pre-wrap; word-break: break-word; line-height: 1.5; }
.ann-win textarea { resize: vertical; min-height: 90px; }
.msg-del {
  margin-left: auto; border: 2px solid var(--black); background: var(--white); cursor: pointer;
  font-size: 12px; line-height: 16px; padding: 0 6px; opacity: 0; transition: opacity .1s;
}
.msg:hover .msg-del, .msg-del:focus-visible { opacity: 1; }
@media (hover: none) { .msg-del { opacity: .8; } }
.msg-del:hover { background: var(--c-red); color: var(--white); }
.msg-meta { width: 100%; }
.mod-notice {
  margin: 0 0 8px; padding: 6px 10px; border: 2px dashed var(--c-red); color: var(--c-red); background: var(--white); font-size: 14px;
}
.composer.locked textarea, .composer.locked .send { opacity: .5; pointer-events: none; }
.admin-box { width: 100%; margin-top: 10px; padding-top: 10px; border-top: 2px dashed var(--black); }
.admin-lbl { margin: 0 0 4px; font-size: 13px; color: var(--orange-d); }
.mod-state { margin: 0 0 8px; font-size: 13px; min-height: 1em; }
.admin-actions { display: flex; gap: 8px; justify-content: center; }
.uid-line { font-size: 13px; margin: 12px 0 0; word-break: break-all; }
.uid-line code { background: var(--paper); border: 1px solid #ccc; padding: 0 4px; }
.user-name .admin-tag { font-size: 12px; vertical-align: 4px; }
.av-choice.av-admin { background: repeating-linear-gradient(140deg, #fff6d6 0 8px, var(--white) 8px 16px); }
.av-choice.av-admin[aria-checked="true"] { background: var(--orange); }

/* ---------- 使用說明 ---------- */
.help-btn {
  width: 36px; height: 36px; flex: none; cursor: pointer; font-size: 20px; line-height: 1; padding: 0;
  background: var(--orange); color: var(--white); border: 3px solid var(--black); box-shadow: 3px 3px 0 var(--black);
  text-shadow: 1px 1px 0 var(--black);
}
.help-btn:hover { background: #ff8f26; }
.help-btn:active { transform: translate(3px, 3px); box-shadow: none; }
.help-btn:focus-visible { outline: 3px dashed var(--orange-d); outline-offset: 2px; }
.help-win { width: min(560px, 100%); }
.help-body { line-height: 1.65; }
.help-lead { margin: 0 0 6px; }
.help-body section { margin-top: 12px; }
.help-body h3 {
  font-size: 15px; font-weight: normal; margin: 0 0 4px; padding: 3px 8px;
  background: var(--orange); color: var(--white); border: 2px solid var(--black); text-shadow: 1px 1px 0 var(--black);
}
.help-body ul { margin: 0; padding-left: 4px; list-style: none; }
.help-body li { position: relative; padding-left: 16px; font-size: 15px; }
.help-body li::before { content: ''; position: absolute; left: 2px; top: .62em; width: 6px; height: 6px; background: var(--black); }
.help-body kbd { border: 2px solid var(--black); padding: 0 4px; font: inherit; font-size: 13px; background: var(--paper); }
.help-body b { font-weight: normal; color: var(--orange-d); }
.help-mobile { display: none; }
.npc-tag {
  display: inline-block; font-size: 11px; line-height: 14px; padding: 0 4px; margin-left: 4px; vertical-align: 1px;
  background: var(--orange-l); color: var(--orange-d); border: 1px solid var(--orange-d);
}
.msg.npc .msg-text { }
@media (max-width: 760px) {
  .help-mobile { display: block; }
  .help-btn { width: 32px; height: 32px; font-size: 18px; }
}

/* 自訂編號、搜尋結果清單 */
.code-input { font-size: 20px; letter-spacing: 6px; font-variant-numeric: tabular-nums; }
.code-field .note { margin-top: 4px; }
.found-list { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; max-height: 260px; overflow-y: auto; }
.found-list .found { margin-top: 0; }

/* 黑名單 */
.block-group h3 { background: var(--black); }
.dim-block .buddy { opacity: .75; }
.link-btn {
  margin-top: 6px; border: none; background: none; cursor: pointer; padding: 2px 4px;
  font-size: 13px; color: #666; text-decoration: underline; text-underline-offset: 3px;
}
.link-btn:hover { color: var(--c-red); }
.link-btn:focus-visible { outline: 3px dashed var(--orange-d); outline-offset: 2px; }
