:root {
  --bg: #0d0d0d;
  --card: #171717;
  --line: #2c2c2c;
  --text: #f2f2f2;
  --muted: #a3a3a3;
  --gold: #f0c14b;
  --gold-2: #c9962a;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background: #0a0a0a;
  color: var(--text);
  font: 16px/1.55 "Noto Sans SC", "Microsoft YaHei", "PingFang SC", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--gold); text-decoration: none; }
button, input { font: inherit; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  padding: 14px 28px;
  border-bottom: 1px solid #1f1f1f;
  position: sticky;
  top: 0;
  background: rgba(10, 10, 10, 0.94);
  z-index: 5;
}
.brand { color: var(--text); font-weight: 700; letter-spacing: 0.04em; }
.topbar nav { display: flex; align-items: center; gap: 8px; }
.topbar nav a, .lang-btn {
  color: var(--muted);
  background: transparent;
  border: 0;
  padding: 6px 10px;
  cursor: pointer;
}
.topbar nav a[aria-current="page"], .topbar nav a:hover, .lang-btn {
  color: var(--gold);
}

.hero { text-align: center; padding: 36px 16px 0; }
.hero h1 {
  font-family: "Noto Sans SC", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: clamp(2.2rem, 4.5vw, 2.75rem);
  font-weight: 600;
  letter-spacing: 0.14em;
  line-height: 1.3;
  margin: 0 0 0.85rem;
}
.sub {
  color: #9a9a9a;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  line-height: 1.7;
  max-width: 36em;
  margin: 0 auto;
}

.filters { max-width: 1200px; margin: 12px auto 0; padding: 0 16px 48px; }
.tab-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 16px;
  border-bottom: 1px solid #2c2c2c;
}
.plat-tabs {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 4px;
}
.filter-row[hidden] { display: none; }
.plat-tabs .tab {
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: transparent;
  color: #999;
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.06em;
  padding: 10px 20px 12px;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
}
.plat-tabs .tab:hover { color: #f2f2f2; background: #161616; }
.plat-tabs .tab[aria-selected="true"] {
  color: #d4af37;
  border-bottom-color: #d4af37;
  background: linear-gradient(to top, rgba(212, 175, 55, 0.18), transparent);
}
.filter-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
#types, #conditions { display: inline-flex; flex-wrap: wrap; gap: 10px; }
.filter-label {
  color: #8a8a8a;
  background: transparent;
  border: 0;
  padding: 6px 4px;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.06em;
  cursor: default;
}
.chip {
  background: #161616;
  color: #d8d8d8;
  border: 1px solid #3a3a3a;
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.chip:hover { border-color: rgba(212, 175, 55, 0.55); color: #fff; }
.chip[aria-pressed="true"] {
  background: #d4af37;
  color: #0a0a0a;
  border-color: #d4af37;
}
.search { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.search input {
  width: min(280px, 60vw);
  cursor: text;
  padding: 10px 18px 10px 44px;
  font-size: 16px;
  font-family: inherit;
  color: #f2f2f2;
  background: #1a1a1a url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23d4af37' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4-4'/%3E%3C/svg%3E") no-repeat 16px center;
  border: 1px solid #3a3a3a;
  border-radius: 999px;
  outline: none;
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.search input::placeholder { color: #8a8a8a; }
.search input:hover { border-color: #6b5a22; }
.search input:focus {
  border-color: #d4af37;
  background-color: #141414;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, .22);
}
.search input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  cursor: pointer;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' stroke='%23d4af37' stroke-width='2.6' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E") no-repeat center / 14px;
}

.count { color: var(--muted); font-size: 14px; margin: 0; white-space: nowrap; }
.grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 28px 16px;
  margin-top: 16px;
}
.card {
  width: 220px;
  background: transparent;
  border: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  overflow: hidden;
}
.card.yp { width: 200px; }
.card.live { width: 300px; }
.card.hunter { width: 240px; }
.shot { position: relative; width: 200px; height: 200px; overflow: hidden; }
.card.yp .shot,
.card.yp .thumb { background: transparent; }
.card.yp .shot { width: 200px; height: 240px; }
.card.yp .thumb { object-fit: contain; }
.card.live .shot { width: 300px; height: 188px; }
.card.hunter .shot { width: 240px; height: 150px; }
.thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #0a0a0a;
  display: block;
}
.thumb[hidden] { display: none; }
.mark {
  position: absolute;
  top: 0;
  width: 70px;
  height: 70px;
  pointer-events: none;
}
.mark.hot { left: 0; }
.mark.neu { right: 0; }
.card.yp .mark.neu { right: 6px; top: 14px; }
.card h2 {
  font-size: 0.95rem;
  line-height: 1.45;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #ececec;
  margin: 8px 0 0;
  text-align: center;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.meta-row {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  width: 100%;
}
.code, .rtp {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.code {
  background: rgba(255, 255, 255, 0.1);
  color: #e5e5e5;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.rtp {
  background: rgba(212, 175, 55, 0.2);
  color: #d4af37;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.shot .actions {
  display: flex;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  pointer-events: none;
  z-index: 2;
  transition: opacity 0.2s ease;
}
.shot:hover .thumb,
.shot:focus-within .thumb { filter: brightness(0.55); }
.shot:hover .actions,
.shot:focus-within .actions { opacity: 1; pointer-events: auto; }
@media (hover: none) {
  .shot .actions { position: static; transform: none; opacity: 1; pointer-events: auto; margin-top: 8px; }
  .shot:hover .thumb { filter: none; }
}
.actions { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.actions button {
  width: 100px;
  height: 33px;
  padding: 3px;
  border: 0;
  border-radius: 20px;
  font-size: 12px;
  color: #0a0a0a;
  cursor: pointer;
}
.actions .play { background: linear-gradient(135deg, #d4af37, gold); }
.actions .detail { height: 30px; background: #109dee; }
.empty { color: var(--muted); padding: 24px 0; }

.modal[hidden], .toast[hidden] { display: none; }
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 10;
}
.dialog {
  width: min(640px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: #fff;
  color: #333;
  border: 0;
  border-radius: 16px;
  padding: 18px 20px 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
.dialog header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.dialog-kicker {
  margin: 0 0 4px;
  color: #999;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.dialog h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.35;
  color: #e85a20;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.dialog header button {
  width: 36px;
  height: 36px;
  flex: none;
  background: #f1f1f1;
  color: #555;
  border: 0;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.dialog header button:hover { background: #f05e21; color: #fff; }
.feats { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 8px 0 4px; }
.feat {
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  background: #eee;
  color: #aaa;
  border: 1px solid #ddd;
}
.feat.on { background: #f05e21; color: #fff; border-color: #f05e21; }
.dialog-shot {
  display: block;
  width: 160px;
  height: 160px;
  object-fit: contain;
  margin: 14px auto 4px;
  background: transparent;
}
.facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0 4px;
}
.facts div {
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 10px 12px;
}
.facts dt { color: #f05e21; font-size: 13px; font-weight: 700; margin: 0; }
.facts dd { margin: 4px 0 0; font-size: 15px; line-height: 1.4; color: #333; font-weight: 600; }
@media (max-width: 640px) {
  .facts { grid-template-columns: 1fr; }
}

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #3a1d1d;
  color: #fff;
  border: 1px solid #7a3030;
  border-radius: 6px;
  padding: 10px 14px;
  z-index: 11;
}

.doc-note { max-width: 720px; margin: 48px auto; padding: 0 16px; }
.doc-note h1 { font-size: 32px; }

#nav-session { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
#nav-session button, .inline-actions button, .editor-form button, .account-form button {
  background: var(--gold-2);
  color: #1a1a1a;
  border: 0;
  border-radius: 4px;
  padding: 6px 10px;
  cursor: pointer;
}
.account-form, .editor-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(420px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
}
.account-form input, .editor-form input, .editor-form textarea, .editor-form select {
  background: #111;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px 10px;
}
.dialog .editor-form { width: 100%; background: transparent; border: 0; padding: 0; color: #333; }
.dialog .editor-form input, .dialog .editor-form textarea, .dialog .editor-form select { background: #fff; color: #222; border-color: #bbb; }
.doc-body .editor-form { width: 100%; margin-top: 24px; background: #fff; border-color: #ddd; color: #333; }
.doc-body .editor-form input, .doc-body .editor-form textarea, .doc-body .editor-form select { background: #fff; color: #222; border-color: #bbb; }
.dialog.wide { width: min(1100px, 100%); }
.leaf-form h2 { font-size: 22px; }
.leaf-meta { display: flex; flex-wrap: wrap; gap: 12px; }
.leaf-meta label { display: flex; align-items: center; gap: 6px; font-size: 14px; color: #555; }
.leaf-meta select { min-width: 120px; max-width: 360px; }
.leaf-meta input[type="number"] { width: 80px; }
.leaf-hint { margin: 0; font-size: 12px; color: #888; }
.leaf-actions { display: flex; gap: 8px; }
.add-leaf { margin: 6px 0 12px; }
.add-leaf button { background: #fff !important; border: 1px dashed #f05e21 !important; color: #f05e21 !important; }
.panel-list { display: flex; flex-direction: column; gap: 12px; }
.panel-item { border: 1px solid #ddd; border-radius: 6px; padding: 8px; background: #fafafa; }
.panel-head { display: flex; gap: 6px; margin-bottom: 6px; }
.panel-head .panel-title { flex: 1; font-weight: 700; }
.panel-head button { padding: 4px 10px; }

.rte { border: 1px solid #bbb; border-radius: 4px; background: #fff; }
.rte-bar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  padding: 6px;
  background: #f3f3f3;
  border-bottom: 1px solid #ddd;
  border-radius: 4px 4px 0 0;
}
.rte-group { display: inline-flex; align-items: center; gap: 2px; }
.editor-form .rte-btn {
  min-width: 30px;
  height: 30px;
  padding: 0 7px;
  background: transparent;
  color: #333;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 13px;
  line-height: 1;
}
.editor-form .rte-btn:hover { background: #fff; border-color: #ccc; }
.rte-source-mode .rte-btn:not([data-cmd="source"]), .rte-source-mode .rte-sel, .rte-source-mode .rte-color { opacity: .35; pointer-events: none; }
.rte-source-mode .rte-btn[data-cmd="source"] { background: #f05e21; color: #fff; }
.editor-form .rte-sel { height: 30px; padding: 0 4px; font-size: 13px; }
.rte-color { position: relative; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 4px; cursor: pointer; font-weight: 700; }
.rte-color:hover { background: #fff; }
.rte-color span { padding: 0 3px; border-bottom: 3px solid currentColor; line-height: 1.1; }
.rte-color input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; padding: 0; border: 0; }
.rte-area { min-height: 260px; max-height: 60vh; overflow: auto; padding: 10px 14px; outline: none; }
.panel-rte .rte-area { min-height: 120px; }
.rte-area:focus { box-shadow: inset 0 0 0 2px rgba(240, 94, 33, .35); }
.rte-area img { cursor: pointer; }
.rte-area table td, .rte-area table th { min-width: 40px; }
.editor-form .rte-source { width: 100%; min-height: 260px; border: 0; border-radius: 0 0 4px 4px; font-family: Consolas, monospace; font-size: 13px; resize: vertical; }
.paper {
  background: #f6f6f6;
  color: #222;
  margin: 16px;
  padding: 20px;
  border-radius: 8px;
  overflow: auto;
}
.account { max-width: 960px; margin: 24px auto; padding: 0 16px; }
.user-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 20px; }
.user-filter input {
  width: 180px;
  background: #111;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px 10px;
}
.user-filter span { color: var(--muted); font-size: 13px; }
.user-empty { color: var(--muted); text-align: center !important; }
#user-table { width: 100%; border-collapse: collapse; margin-top: 12px; }
#user-table th, #user-table td { border-bottom: 1px solid var(--line); padding: 8px; text-align: left; }
.account-form { width: 100%; margin-bottom: 12px; }
.account-form label { color: var(--muted); }

/* ---------- 登入／改密碼（沿用舊站對話框） ---------- */
.ico { width: 24px; height: 24px; fill: currentColor; flex: none; }
.auth-modal { z-index: 30; }
.auth-card {
  width: min(460px, 100%);
  background: #fff;
  color: #333;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 11px 15px -7px rgba(0,0,0,.2), 0 24px 38px 3px rgba(0,0,0,.14), 0 9px 46px 8px rgba(0,0,0,.12);
}
.auth-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 112px;
  background: linear-gradient(to bottom, rgba(0,0,0,.1), rgba(0,0,0,.2)), #0092be;
  color: #fff;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: .12em;
}
.auth-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  cursor: pointer;
}
.auth-close:hover { background: rgba(255,255,255,.18); }
.auth-body { display: flex; flex-direction: column; gap: 12px; padding: 18px 20px 20px; }
.auth-field { position: relative; display: block; }
.auth-field input {
  width: 100%;
  height: 56px;
  padding: 0 52px 0 14px;
  font: inherit;
  font-size: 16px;
  color: #222;
  background: #fff;
  border: 1px solid rgba(0,0,0,.38);
  border-radius: 4px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.auth-field input:hover { border-color: rgba(0,0,0,.87); }
.auth-field input:focus { border-color: #0092be; box-shadow: inset 0 0 0 1px #0092be; }
.auth-eye {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #757575;
  cursor: pointer;
}
.auth-eye:hover { background: rgba(0,0,0,.06); }
.auth-eye[aria-pressed="true"] { color: #0092be; }
.auth-sep { width: 100%; border: 0; border-top: 1px solid #e0e0e0; margin: 4px 0; }
.auth-error { margin: 0; padding: 10px 14px; border-radius: 4px; background: rgba(255,82,82,.12); color: #d32f2f; font-size: 14px; }
.auth-hint { margin: 0; text-align: center; font-size: 16px; }
.auth-qr { display: block; width: 200px; height: 200px; margin: 0 auto; object-fit: contain; }
.auth-submit {
  height: 44px;
  border: 0;
  border-radius: 4px;
  background: #f05e21;
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .09em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 3px 1px -2px rgba(0,0,0,.2), 0 2px 2px rgba(0,0,0,.14), 0 1px 5px rgba(0,0,0,.12);
}
.auth-submit:hover { filter: brightness(1.08); }
.auth-submit:disabled { opacity: .7; cursor: wait; }
.auth-link { background: none; border: 0; color: #757575; cursor: pointer; font: inherit; font-size: 14px; }

/* ---------- 技術文檔（沿用舊站版面） ---------- */
.doc-page { background: #0092be; color: #fff; min-height: 100vh; }
.doc-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: linear-gradient(-45deg, #66d4da, #0092be, #f8b05e, #f05e21);
  background-size: 400% 400%;
  animation: doc-gradient 30s ease infinite;
}
@keyframes doc-gradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@media (prefers-reduced-motion: reduce) { .doc-bg { animation: none; } }

.doc-rail {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 56px;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding-top: 12px;
  background: #424242;
  box-shadow: 0 0 10px rgba(0,0,0,.25);
}
.rail-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}
.rail-btn:hover { background: rgba(255,255,255,.12); }
.rail-avatar {
  background: #f05e21;
  font-size: 16px;
  font-weight: 700;
  cursor: default;
  box-shadow: 0 3px 5px -1px rgba(0,0,0,.2), 0 6px 10px rgba(0,0,0,.14);
}
a.rail-avatar[href] { cursor: pointer; }
.rail-avatar:hover { background: #f05e21; filter: brightness(1.1); }
.rail-sep { width: 32px; border: 0; border-top: 1px solid rgba(255,255,255,.14); margin: 6px 0; }

.doc-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 56px;
  width: 300px;
  z-index: 5;
  overflow-y: auto;
  padding: 24px 0;
  transition: transform .25s ease;
}
.drawer-closed .doc-drawer { transform: translateX(-120%); }
.doc-links { display: flex; flex-direction: column; gap: 2px; margin: 0 24px 16px 0; }
.doc-links a {
  display: block;
  padding: 12px 16px 12px 24px;
  color: #fff;
  font-size: 15px;
  border-radius: 0 32px 32px 0;
}
.doc-links a:hover { background: rgba(255,255,255,.1); }
.doc-links a[aria-current="page"] { background: rgba(255,255,255,.24); }
.doc-tools { display: flex; gap: 8px; padding: 0 16px 12px 24px; }
.doc-tools button {
  border: 1px solid rgba(255,255,255,.6);
  background: transparent;
  color: #fff;
  border-radius: 4px;
  padding: 4px 10px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.doc-tools button:hover { background: rgba(255,255,255,.14); }
.doc-tree { padding: 0 16px 0 8px; }
.tree-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 38px;
  padding: 6px 12px 6px 16px;
  border: 0;
  border-radius: 0 20px 20px 0;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .6px;
  text-align: left;
  cursor: pointer;
}
.tree-row:hover { background: rgba(255,255,255,.1); }
.tree-row[aria-current="page"] { background: rgba(255,255,255,.24); }
.tree-row.off { opacity: .6; }
.tree-row .ico { width: 22px; height: 22px; }
.tree-row.lv-2 { font-weight: 500; font-size: 14px; }
.tree-children { display: none; padding-left: 24px; }
.tree-node.open > .tree-children { display: block; }
.tree-empty { padding: 0 24px; color: rgba(255,255,255,.8); }

.doc-main { position: relative; z-index: 1; margin-left: 356px; padding: 16px 24px 32px; transition: margin-left .25s ease; }
.drawer-closed .doc-main { margin-left: 56px; }
.doc-card { min-height: 90vh; padding: 10px 32px 40px; background: #f0f0f0; color: #222; border-radius: 4px; }
.doc-card-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 16px 0; }
.doc-card-head #doc-icon { display: inline-flex; color: #616161; }
.doc-card-head h1 { flex: 1; min-width: 200px; margin: 0; font-size: 20px; font-weight: 900; line-height: 1.4; color: #222; }
.doc-search { position: relative; width: 300px; max-width: 100%; }
.doc-search input {
  width: 100%;
  height: 40px;
  padding: 0 44px 0 12px;
  font: inherit;
  font-size: 15px;
  color: #222;
  background: transparent;
  border: 1px solid rgba(0,0,0,.38);
  border-radius: 4px;
  outline: none;
}
.doc-search input:hover { border-color: rgba(0,0,0,.87); }
.doc-search input:focus { border-color: #0092be; box-shadow: inset 0 0 0 1px #0092be; }
.doc-search button {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #757575;
  cursor: pointer;
}
.doc-search button:hover { background: rgba(0,0,0,.06); }
.doc-divider { border: 0; border-top: 1px solid rgba(0,0,0,.12); margin: 0 0 30px; }
.doc-body { font-size: 14px; line-height: 22px; letter-spacing: .1px; color: rgba(0,0,0,.87); }
.doc-body a { color: #ff6600; }
.doc-body img { max-width: 100%; height: auto; }
.doc-body pre { white-space: pre-wrap; background: #fff; padding: 10px 12px; border-radius: 4px; overflow: auto; }
.doc-empty, .doc-loading { color: #757575; padding: 12px 0; margin: 0; }
.block { position: relative; margin: 8px 0; }

/* 後台編輯器存進來的 HTML（一般內文、表格、手風琴）沿用舊站排版 */
.html-block, .xp-text { overflow-wrap: break-word; }
.html-block { overflow-x: auto; }
.html-block :is(h1, h2, h3, h4, h5, h6, ul, ol, dl, blockquote, figure),
.xp-text :is(h1, h2, h3, h4, h5, h6, ul, ol, dl, blockquote, figure) { margin: 0; }
.html-block :is(ul, ol), .xp-text :is(ul, ol) { padding-left: 24px; }
.html-block p, .xp-text p { margin: 6px 0 !important; }
.html-block table, .xp-text table { border-collapse: collapse; max-width: 100% !important; margin-right: 0 !important; }
.html-block :is(table, td, th), .xp-text :is(table, td, th) { border: 1px solid #111 !important; }
.html-block :is(td, th), .xp-text :is(td, th) { padding: 3px 6px; }
.block { padding-left: 46px; }
.html-block :is(h1, h2, h3, h4, h5, h6, b, strong, th),
.xp-text :is(h1, h2, h3, h4, h5, h6, b, strong, th) { font-weight: 700; }
.doc-body .font-weight-thin { font-weight: 100 !important; }
.doc-body .font-weight-light { font-weight: 300 !important; }
.doc-body .font-weight-regular { font-weight: 400 !important; }
.doc-body .font-weight-medium { font-weight: 500 !important; }
.doc-body .font-weight-bold { font-weight: 700 !important; }
.doc-body .font-weight-black { font-weight: 900 !important; }
.doc-body .font-italic { font-style: italic !important; }
.doc-body .text-decoration-none { text-decoration: none !important; }
.doc-body .text-decoration-underline { text-decoration: underline !important; }
.sub-links { display: flex; flex-direction: column; align-items: flex-start; margin: 0; }
.doc-body .sub-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  margin-bottom: 10px;
  padding: 0 16px;
  border-radius: 4px;
  color: rgba(0,0,0,.87);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .09em;
  text-decoration: none;
}
.doc-body .sub-link:hover { background: rgba(0,0,0,.06); }
.sub-link .ico { width: 24px; height: 24px; color: #616161; }
.sec > summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 8px;
  list-style: none;
  font-size: 18px;
  font-weight: 900;
  color: #222;
  border-radius: 4px;
  cursor: pointer;
}
.sec > summary::-webkit-details-marker { display: none; }
.sec > summary:hover { background: rgba(0,0,0,.04); }
.sec[open] > summary { color: #616161; }
.sec > summary .chev { margin-left: auto; color: #757575; transition: transform .2s; }
.sec[open] > summary .chev { transform: rotate(180deg); }
.ico.amber { width: 20px; height: 20px; color: #ff8f00; }
.ico.blue { width: 20px; height: 20px; color: #0277bd; }
.sec-body { padding: 0 0 10px 56px; }
.sub-title { display: flex; align-items: center; gap: 6px; margin: 8px 0; font-size: 18px; font-weight: 900; }
.sub-body { padding: 0 0 30px 56px; }
.xp {
  margin: 8px 0;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 2px 1px -1px rgba(0,0,0,.2), 0 1px 1px rgba(0,0,0,.14), 0 1px 3px rgba(0,0,0,.12);
}
.xp details + details { border-top: 1px solid rgba(0,0,0,.12); }
.xp summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 14px 24px;
  list-style: none;
  font-size: 15px;
  cursor: pointer;
}
.xp summary::-webkit-details-marker { display: none; }
.xp summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid #757575;
  border-bottom: 2px solid #757575;
  transform: rotate(45deg);
  transition: transform .2s;
}
.xp details[open] summary::after { transform: rotate(-135deg); }
.xp-text { padding: 6px 48px 22px; }

.brief { display: flex; align-items: flex-start; gap: 24px; }
.brief-tabs { display: flex; flex-direction: column; flex: none; min-width: 170px; border-right: 1px solid rgba(0,0,0,.12); }
.brief-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  margin-right: -1px;
  padding: 0 16px;
  border: 0;
  border-right: 2px solid transparent;
  background: transparent;
  color: rgba(0,0,0,.54);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .09em;
  text-align: left;
  cursor: pointer;
}
.brief-tab .ico { width: 20px; height: 20px; }
.brief-tab:hover { background: rgba(0,0,0,.04); }
.brief-tab[aria-selected="true"] { color: #f05e21; border-right-color: #f05e21; }
.brief-list { flex: 1; min-width: 0; margin: 0; padding: 0; list-style: none; }
.brief-list li { padding: 12px 16px; }
.brief-list li + li { border-top: 1px solid rgba(0,0,0,.12); }
.brief-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 16px; }
.type-chip { display: inline-flex; align-items: center; height: 24px; padding: 0 12px; border: 1px solid currentColor; border-radius: 12px; font-size: 12px; font-weight: 500; }
.t-update { color: #ff9800; }
.t-add { color: #2196f3; }
.t-remove { color: #f44336; }
.t-modify { color: #4caf50; }
.t-other { color: #9e9e9e; }
.brief-topic { color: rgba(0,0,0,.87); font-weight: 700; }
.doc-body .brief-link { display: inline-grid; place-items: center; width: 32px; height: 32px; color: rgba(0,0,0,.54); border-radius: 50%; transition: color .15s, background .15s; }
.doc-body .brief-link:hover { color: #f05e21; background: rgba(240,94,33,.08); }
.doc-body .brief-link:focus-visible { outline: 2px solid #f05e21; outline-offset: 1px; }
.brief-link .ico { width: 22px; height: 22px; }
.brief-desc { margin: 8px 0 0 74px; white-space: pre-wrap; color: rgba(0,0,0,.6); font-size: 14px; }

.search-results .hit { margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid rgba(0,0,0,.12); }
.hit h2 { margin: 0; font-size: 21px; line-height: 1.5; }
.hit-text { margin: 0; padding: 10px 20px; }
.doc-body .hit-key { display: inline-block; padding: 2px 10px; border-radius: 4px; background: #ffb74d; color: rgba(0,0,0,.87); line-height: 1.4; text-decoration: none; }
.doc-body .hit-key:hover { background: #ffa726; }

.doc-fab { position: fixed; right: 16px; bottom: 16px; z-index: 4; display: flex; flex-direction: column; gap: 12px; }
.fab {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #424242;
  color: #fff;
  opacity: .85;
  cursor: pointer;
  box-shadow: 0 3px 5px -1px rgba(0,0,0,.2), 0 6px 10px rgba(0,0,0,.14), 0 1px 18px rgba(0,0,0,.12);
}
.fab:hover { opacity: 1; }
.doc-page .toast { background: #323232; border-color: #323232; }

.doc-topbar, .doc-backdrop { display: none; }
@media (max-width: 1024px) {
  .doc-rail { display: none; }
  .doc-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 7;
    height: 56px;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 8px;
    background: #424242;
    box-shadow: 0 2px 4px -1px rgba(0,0,0,.2), 0 4px 5px rgba(0,0,0,.14);
  }
  .doc-topbar .spacer { flex: 1; }
  .doc-drawer { top: 56px; left: 0; width: min(300px, 85vw); z-index: 8; background: rgba(33,33,33,.96); }
  .doc-backdrop { display: block; position: fixed; inset: 56px 0 0; z-index: 7; background: rgba(0,0,0,.4); }
  .drawer-closed .doc-backdrop { display: none; }
  .doc-main, .drawer-closed .doc-main { margin-left: 0; padding: 72px 12px 24px; }
  .doc-card { padding: 6px 16px 32px; }
  .sec-body, .sub-body { padding-left: 20px; }
  .block { padding-left: 0; }
  .brief { flex-direction: column; }
  .brief-tabs { flex-direction: row; width: 100%; overflow-x: auto; border-right: 0; border-bottom: 1px solid rgba(0,0,0,.12); }
  .brief-tab { margin: 0 0 -1px; border-right: 0; border-bottom: 2px solid transparent; white-space: nowrap; }
  .brief-tab[aria-selected="true"] { border-bottom-color: #f05e21; }
  .brief-desc { margin-left: 0; }
}
@media (max-width: 640px) {
  .hero h1 { font-size: 2.2rem; letter-spacing: 0.1em; }
  .topbar { padding: 12px 14px; }
}

/* 密碼結果彈窗:重設/建立帳號後置中顯示新密碼,可一鍵複製(免捲回頁首) */
.pwd-modal {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  color: var(--text);
  padding: 26px 28px;
  width: min(420px, calc(100% - 32px));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}
.pwd-modal::backdrop { background: rgba(0, 0, 0, 0.66); }
.pwd-modal h2 { margin: 0 0 6px; font-size: 20px; color: var(--gold); font-weight: 700; }
.pwd-sub { margin: 0 0 16px; color: var(--muted); font-size: 13px; }
.pwd-row { display: flex; gap: 10px; align-items: stretch; }
.pwd-value {
  flex: 1; display: flex; align-items: center;
  font-family: "Roboto Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 22px; letter-spacing: 1px; font-weight: 700;
  color: var(--text); background: #0d0d0d;
  border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 14px; user-select: all; word-break: break-all;
}
.pwd-row button {
  border: 1px solid var(--gold); border-radius: 10px;
  background: var(--gold); color: #1a1400; font-weight: 700;
  padding: 0 18px; cursor: pointer; white-space: nowrap;
}
.pwd-row button:hover { filter: brightness(1.08); }
.pwd-copied { margin: 12px 0 0; min-height: 18px; font-size: 13px; color: #5fd08a; }
.pwd-copied.warn { color: var(--gold); }
.pwd-actions { margin-top: 18px; text-align: right; }
.pwd-actions button {
  border: 1px solid var(--line); border-radius: 10px;
  background: transparent; color: var(--text);
  padding: 8px 18px; cursor: pointer;
}
.pwd-actions button:hover { background: rgba(255, 255, 255, 0.08); }
