
:root {
  color-scheme: dark;

  --bg: #0f1115;
  --panel: #171a21;
  --panel2: #1e222b;
  --line: #2a2f3a;
  --line2: #333a47;
  --fg: #e6e8ee;
  --muted: #8b93a5;
  --accent: #4f8cff;
  --accent-fg: #ffffff;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);

  --ok-bg: #12251c;   --ok-bd: #1f4a35;   --ok-fg: #7fe0ac;
  --warn-bg: #2a2417; --warn-bd: #4a3f25; --warn-fg: #e6c47a;
  --err-bg: #2a1717;  --err-bd: #4a2525;  --err-fg: #f0938c;
  --off-bg: #1e222b;  --off-bd: #2a2f3a;  --off-fg: #8b93a5;
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;

    --bg: #f5f6f8;
    --panel: #ffffff;
    --panel2: #f2f4f7;
    --line: #e3e6ec;
    --line2: #d3d8e0;
    --fg: #16181d;
    --muted: #6b7280;
    --accent: #2563eb;
    --accent-fg: #ffffff;
    --shadow: 0 10px 30px rgba(16, 24, 40, .14);

    --ok-bg: #e9f8ef;   --ok-bd: #b3e3c9;   --ok-fg: #14663c;
    --warn-bg: #fdf6e6; --warn-bd: #f2dcae; --warn-fg: #8a5a0b;
    --err-bg: #fdeceb;  --err-bd: #f6bdb9;  --err-fg: #a5241c;
    --off-bg: #f2f4f7;  --off-bd: #e3e6ec;  --off-fg: #6b7280;
  }
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }


* { scrollbar-width: none; -ms-overflow-style: none; }
*::-webkit-scrollbar { width: 0; height: 0; display: none; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 15px/1.6 system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: ui-monospace, Consolas, monospace; }


.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10; min-height: 54px; box-sizing: border-box;
}
.brand { font-weight: 700; letter-spacing: .5px; }
.topbar nav { display: flex; align-items: center; gap: 16px; min-height: 30px; }
.topbar nav a { color: var(--muted); }
.topbar nav a:hover { color: var(--fg); text-decoration: none; }
.who { color: var(--fg); font-weight: 600; }

main { max-width: 1080px; margin: 24px auto 0; padding: 0 16px 6px; }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 4px 16px 18px; }


.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 20px; margin-bottom: 16px;
}
.card.narrow { max-width: 380px; margin: 8vh auto; }
.card.empty, .card.tip { text-align: center; color: var(--muted); }
.card.empty .tip-sep {
  margin-top: 16px; padding-top: 14px;
  border-top: 1px solid var(--line); font-size: 13px;
}
.card h1 { margin: 0 0 12px; font-size: 20px; }
.card h2 { margin: 0 0 12px; font-size: 16px; }


.ctabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.ctabs > button {
  background: none; border: 0; border-bottom: 2px solid transparent;
  padding: 8px 14px; margin-bottom: -1px; cursor: pointer;
  color: var(--muted); font-size: 14px; font-family: inherit;
}
.ctabs > button[aria-selected="true"] { color: var(--fg, inherit); border-bottom-color: var(--accent, #3b82f6); }
.ctabs > button:hover { color: var(--fg, inherit); }


body:not(.has-nav) main {
  min-height: calc(100vh - 150px);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
body:not(.has-nav) .card.narrow { margin: 0; width: 100%; }

.pagehead {
  display: flex; align-items: baseline; justify-content: space-between;
  flex-wrap: wrap; gap: 8px; margin-bottom: 16px;
}
.pagehead h1 { margin: 0; font-size: 22px; }
.stat { color: var(--muted); }
.stat b { color: var(--fg); }
.stat .wldrift { color: var(--err-fg); cursor: help; }
.stat .wldrift b { color: var(--err-fg); }


label { display: block; margin: 12px 0; color: var(--muted); font-size: 13px; }

input:not([type="hidden"]),
textarea {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 8px;
  color: var(--fg); font-size: 15px; font-family: inherit;
}

textarea {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px; line-height: 1.5; resize: vertical; min-height: 64px;
  white-space: pre; overflow-x: auto;
}
input[type="hidden"] { display: none; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .7; }
input:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
input.tiny { width: 150px; display: inline-block; margin: 0 4px 0 0; padding: 6px 8px; font-size: 13px; }
input:disabled { opacity: .5; }

input[type="password"] {
  -webkit-text-security: disc;
  ime-mode: disabled;
}


input[type="checkbox"] {
  display: inline-block; width: auto; margin: 0;
  accent-color: var(--accent); cursor: pointer; flex: none;
}
label.check {
  display: flex; align-items: flex-start; gap: 9px;
  color: var(--fg); font-size: 14px; cursor: pointer;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel2);
}
label.check:hover { border-color: var(--line2); }
label.check span { display: block; }
label.check .muted { display: block; font-size: 12px; margin-top: 2px; }
label.check + label.check { margin-top: 8px; }
label.check.danger-check { color: var(--err-fg); }
label.check.danger-check input[type="checkbox"] { accent-color: var(--err-fg); }


.danger-sep {
  display: flex; align-items: center; gap: 10px;
  margin: 18px 0 10px; color: var(--muted); font-size: 12px;
}
.danger-sep::before, .danger-sep::after {
  content: ''; flex: 1; height: 1px; background: var(--line);
}
.danger-sep span { white-space: nowrap; }


.sect { font-size: 15px; margin: 22px 0 10px; }
.tiny-hint { font-weight: 400; font-size: 12px; }


.regno {
  display: inline-block; min-width: 22px;
  color: var(--muted); font-size: 12px;
  font-family: ui-monospace, Consolas, monospace;
}


.checklist { margin: 0; padding-left: 20px; color: var(--muted); font-size: 14px; }
.checklist li { margin: 7px 0; line-height: 1.7; }
.checklist code {
  background: var(--panel2); padding: 1px 6px; border-radius: 5px;
  font-size: 13px; color: var(--fg);
}


.btn {
  display: inline-block; padding: 9px 16px; border-radius: 8px; cursor: pointer;
  background: var(--panel2); border: 1px solid var(--line2); color: var(--fg);
  font-size: 14px; font-family: inherit; line-height: 1.2;
}
.btn:hover { border-color: var(--accent); text-decoration: none; }

.btn:focus { outline: none; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }

.btn.bind { background: #0e9aa7; border-color: #0e9aa7; color: #ffffff; font-weight: 600; }
.btn.bind:hover { filter: brightness(1.08); }
.btn.bind:disabled { filter: grayscale(.5); }
.btn.danger { color: var(--err-fg); border-color: var(--err-bd); }
.btn.danger:hover { background: var(--err-bg); border-color: var(--err-fg); }
.btn.block { width: 100%; margin-top: 16px; text-align: center; }
.btn.tiny { padding: 5px 10px; font-size: 12px; }
.btn.copy { margin-left: 6px; padding: 2px 7px; font-size: 11px; border-radius: 5px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
button.link {
  background: none; border: 0; color: var(--muted); cursor: pointer;
  font: inherit; padding: 0;
}
button.link:hover { color: var(--fg); }
form.inline { display: inline-block; margin: 0 0 0 4px; }


.filters {
  display: flex; flex-wrap: wrap; gap: 9px 12px; align-items: flex-end;
  margin-top: 14px; padding: 12px 14px;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 10px;
}
.filters label {
  display: flex; flex-direction: column; gap: 5px; margin: 0; flex: none;
  font-size: 12px; color: var(--muted); letter-spacing: .3px;
}
.filters select, .filters input { width: auto; min-width: 116px; margin: 0; }
.filters select { padding-right: 26px; }
.filters .csel { min-width: 0; }
.filters .csel-btn {
  min-height: 0; padding: 6px 10px; font-size: 13px; gap: 5px; border-radius: 7px;
  white-space: nowrap;
}
.filters .csel-lbl { white-space: nowrap; }
.filters .grow { flex: 0 1 132px; }
.filters .grow input { width: 100%; padding: 6px 9px; font-size: 13px; }
.filters .btn { padding: 7px 16px; font-size: 13.5px; }


.caprow { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.caprow img {
  border: 1px solid var(--line2); border-radius: 8px;
  cursor: pointer; display: block; background: #fff;
}


select {
  appearance: none; -webkit-appearance: none;
  background-color: var(--panel2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1.5 1.5 6 6l4.5-4.5' fill='none' stroke='%238b93a5' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 11px 8px;
  border: 1px solid var(--line2); border-radius: 8px;
  color: var(--fg); font: inherit; font-size: 13px;
  padding: 8px 30px 8px 11px; cursor: pointer;
}
select:hover { border-color: var(--accent); }
select:focus { outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
select option { background: var(--panel); color: var(--fg); }


th.pickcol, td.pickcol { width: 34px; padding-right: 0; }
th.pickcol input, td.pickcol input { width: auto; margin: 0; cursor: pointer; }

.recacts {
  display: flex; gap: 10px; margin-top: 16px;
  align-items: center; justify-content: space-between; flex-wrap: wrap;
}
.recacts-l { display: flex; gap: 6px; align-items: center; }
.recacts-r { display: flex; gap: 8px; align-items: center; flex: none; }
.psize { display: flex; align-items: center; }
.pager { display: flex; align-items: center; gap: 4px; }
.pgbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; padding: 0; border: 0; border-radius: 8px;
  background: none; color: var(--muted); text-decoration: none;
}
.pgbtn:hover { background: var(--panel2); color: var(--fg); text-decoration: none; }
.pgbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.pgbtn.dis { opacity: .3; pointer-events: none; }
.pgjump { display: flex; align-items: center; gap: 6px; margin: 0; }
.pgjump input {
  width: 4.6em; margin: 0; padding: 5px 8px; text-align: center;
  font-size: 13.5px; border-radius: 8px;
}
.pgtext { color: var(--muted); font-size: 13px; white-space: nowrap; }
.recacts-r form { display: flex; align-items: center; gap: 6px; }
.recacts-r .btn { padding: 6px 12px; font-size: 13px; text-decoration: none; }
.recacts-r .btn.dis { opacity: .45; cursor: not-allowed; pointer-events: none; }
.recacts-r select { width: auto; min-width: 0; padding: 6px 26px 6px 10px; font-size: 13px; }
.recform { margin: 0; }
form.row { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
form.row input { margin-top: 0; flex: 1; min-width: 140px; }


.toast {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 999;
  overflow: hidden;
  max-width: min(420px, calc(100vw - 32px));
  padding: 12px 16px; border-radius: 10px; border: 1px solid;
  font-size: 14px; box-shadow: var(--shadow); backdrop-filter: blur(6px);
  animation: toast-in .28s cubic-bezier(.2, .8, .3, 1),
             toast-out .4s ease-in 4.6s forwards;
}
body.has-nav .toast { top: 64px; }
.toast:hover,
.toast:hover::after { animation-play-state: paused; }

.toast::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: currentColor; opacity: .5;
  transform-origin: left center;
  animation: toast-bar 5s linear forwards;
}
.toast.ok   { background: var(--ok-bg);   border-color: var(--ok-bd);   color: var(--ok-fg); }
.toast.err  { background: var(--err-bg);  border-color: var(--err-bd);  color: var(--err-fg); }
.toast.warn { background: var(--warn-bg); border-color: var(--warn-bd); color: var(--warn-fg); }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(24px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateX(24px); visibility: hidden; }
}
@keyframes toast-bar {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}
@media (prefers-reduced-motion: reduce) {
  @keyframes toast-in  { from { opacity: 0 } to { opacity: 1 } }
  @keyframes toast-out { to { opacity: 0; visibility: hidden } }
}


.notice {
  padding: 12px 16px; border-radius: 10px; margin-bottom: 16px;
  border: 1px solid; font-size: 14px;
}
.notice.ok   { background: var(--ok-bg);   border-color: var(--ok-bd);   color: var(--ok-fg); }
.notice.err  { background: var(--err-bg);  border-color: var(--err-bd);  color: var(--err-fg); }
.notice.warn { background: var(--warn-bg); border-color: var(--warn-bd); color: var(--warn-fg); }
.notice a { color: inherit; text-decoration: underline; }

.muted { color: var(--muted); }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }


.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.card.dev { margin: 0; }
.card.dev.empty { grid-column: 1 / -1; }
.devhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }

.kv {
  display: grid; grid-template-columns: 15px auto minmax(0, 1fr);
  gap: 6px 7px; margin: 12px 0 14px; font-size: 13px; align-items: center;
}
.kv > i.ki { display: flex; color: var(--muted); opacity: .7; }
.kv > span { color: var(--muted); white-space: nowrap; }
.kv > b {
  display: flex; align-items: center;
  height: 30px; padding: 0 9px; margin-left: 6px;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 6px;
  color: var(--fg); font-size: 13px; font-weight: 500; line-height: 1;
  white-space: nowrap; overflow: hidden;
}
.kv > b.split { justify-content: space-between; }

.kv > b.has-sel { overflow: visible; }
.kv > b .ago { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 10px; }
.kv > b .muted { font-weight: 400; font-size: 12px; }
.kv > b i.nil { font-style: normal; color: var(--muted); opacity: .7; }
.kv > b code { font-size: 12px; color: var(--fg); background: none; padding: 0; }


.kv > b input {
  flex: 1; min-width: 0; height: 100%; margin: 0; padding: 0;
  background: none; border: 0; outline: none; border-radius: 0;
  color: inherit; font: inherit; line-height: inherit;
  appearance: none; -webkit-appearance: none;
}

.kv > b input:focus { border: 0; box-shadow: none; }
.kv > b input::placeholder { color: var(--muted); font-weight: 400; }

.csel { position: relative; display: flex; align-items: center; min-width: 130px; }
.csel-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  width: 100%; min-height: 34px; margin: 0; padding: 7px 11px;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 8px;
  color: var(--fg); font: inherit; font-size: 14px; line-height: 1.2;
  text-align: left; cursor: pointer;
}
.csel-btn:hover { border-color: var(--line2); }
.csel > .csel-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.kv > b .csel { flex: 1; min-width: 0; }
.kv > b .csel .csel-btn {
  min-height: 0; height: 100%; padding: 0; gap: 4px;
  background: none; border: 0; border-radius: 0; font-size: 13px; font-weight: 500;
}
.csel-btn svg { flex: none; color: var(--muted); }
.csel-pop {
  
  position: absolute; z-index: 40; top: calc(100% + 8px);
  left: -9px; right: auto;
  min-width: calc(100% + 18px);
  width: max-content; max-width: min(320px, 76vw);
  max-height: 250px; overflow-y: auto; overflow-x: hidden; padding: 5px;
  background: var(--panel); border: 1px solid var(--line2);
  border-radius: 10px; box-shadow: var(--shadow);
}
.csel-pop.csel-up { top: auto; bottom: calc(100% + 8px); }
.csel-pop button {
  display: block; width: 100%; margin: 0; padding: 7px 10px; text-align: left;
  background: none; border: 0; border-radius: 7px; cursor: pointer;
  color: var(--fg); font: inherit; font-size: 13px; line-height: 1.35;
  white-space: nowrap;
}
.csel-pop button:hover { background: var(--panel2); }
.csel-pop button[aria-selected="true"] {
  background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent);
}
.csel-pop button span { color: var(--muted); font-size: 12px; margin-left: 7px; }
.csel-pop button[aria-selected="true"] span { color: inherit; opacity: .75; }
.kv > b:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 16%, transparent);
}

.devname { font-size: 15px; font-weight: 600; color: var(--fg); }
.kv i.nil { font-style: normal; color: var(--muted); opacity: .7; }
.devhead-end { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.tag-net {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; line-height: 1; padding: 3px 7px; border-radius: 5px; white-space: nowrap;
  color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.tag-net svg { width: 12px; height: 12px; display: block; }

.btn svg { vertical-align: -2px; margin-right: 5px; }
.btn.tiny svg { width: 13px; height: 13px; vertical-align: -2px; margin-right: 4px; }


.stats3 {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px; margin-bottom: 14px;
}
.stats3 > div {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 6px; text-align: center; min-width: 0;
}
.stats3 b { display: block; font-size: 16px; font-weight: 600; color: var(--accent); line-height: 1.2; }
.stats3 span {
  display: block; margin-top: 2px; font-size: 11px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
@media (max-width: 420px) {
  .stats3 { gap: 6px; }
  .stats3 b { font-size: 15px; }
  .stats3 span { font-size: 10px; }
}


.devacts { display: flex; flex-direction: column; gap: 8px; }
.devrow { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.devrow .btn { width: 100%; }


.formacts { display: flex; align-items: center; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.formacts > .btn { width: auto; }
.qid { font-size: 14px; color: var(--fg); background: var(--panel2); padding: 3px 8px; border-radius: 6px; }
.meta { font-size: 13px; margin-top: 6px; }

.hint {
  margin-top: 16px; color: var(--muted);
  font-size: 13px; line-height: 1.7;
}
.card.empty .tip-sep {
  margin-top: 14px; padding-top: 12px;
  border-top: 1px solid var(--line); font-size: 13px;
}


.badge { font-size: 12px; padding: 2px 9px; border-radius: 20px; border: 1px solid; white-space: nowrap; }
.badge.on   { background: var(--ok-bg);   border-color: var(--ok-bd);   color: var(--ok-fg); }
.badge.warn { background: var(--warn-bg); border-color: var(--warn-bd); color: var(--warn-fg); }
.badge.off  { background: var(--off-bg);  border-color: var(--off-bd);  color: var(--off-fg); }



.tw { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tw table { min-width: 520px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
tbody tr:hover { background: var(--panel2); }
tbody tr:last-child td { border-bottom: 0; }

/* 表格单元格默认单行：时间、IP、设备数这类短值被挤到第二行很难看。
   需要换行的长文本（备注等）由 .wrap-cell 显式声明。 */
.tw th, .tw td { white-space: nowrap; }
.tw td.wrap-cell { white-space: normal; word-break: break-word; }

/* 列宽策略：数字列用等宽数字，避免 0 / 9 与 0 / 99 抖动对齐 */
.tw td.col-num, .tw th.col-num { font-variant-numeric: tabular-nums; }
.tw td.col-ops, .tw th.col-ops { text-align: right; }

/* 操作按钮在窄列里不换行，也不被压缩 */
.tw td.col-ops .btn { white-space: nowrap; }


.modal {
  position: fixed; inset: 0; z-index: 900; padding: 16px;
  background: rgba(0, 0, 0, .55);
  display: flex; align-items: center; justify-content: center;
}
.modalbox {  width: 100%; max-width: 340px; max-height: 82vh; overflow: auto;
  background: var(--panel); border: 1px solid var(--line2);
  border-radius: 12px; padding: 18px; box-shadow: var(--shadow);
}
.modalbox h3 { margin: 0 0 12px; font-size: 15px; }
.modalbox p { margin: 0 0 14px; font-size: 14px; }
.modalbox code { font-size: 13px; }


.bellwrap { position: relative; display: inline-flex; align-items: center; }
.bell {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0; margin: 0;
  border: 0; border-radius: 8px; background: none; box-shadow: none;
  color: var(--muted); cursor: pointer; font: inherit; line-height: 1;
  -webkit-appearance: none; appearance: none;
}
.bell:hover, .bell[aria-expanded="true"] { color: var(--fg); background: var(--panel2); }
.bell:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.bell-dot {
  position: absolute; top: 1px; right: -1px; min-width: 15px; height: 15px; padding: 0 4px;
  border-radius: 8px; background: var(--err-fg); color: #fff;
  font: 600 10px/15px system-ui, sans-serif; font-style: normal;
  text-align: center; box-sizing: border-box;
}


.ntcpop {
  position: absolute; z-index: 950; top: calc(100% + 10px); right: 0;
  width: 340px; max-width: calc(100vw - 32px); max-height: 70vh; overflow: auto;
  background: var(--panel); border: 1px solid var(--line2);
  border-radius: 12px; box-shadow: var(--shadow); padding: 14px 16px;
}

.ntcpop::before {
  content: ''; position: absolute; top: -6px; right: 11px; width: 10px; height: 10px;
  background: var(--panel); border-left: 1px solid var(--line2);
  border-top: 1px solid var(--line2); transform: rotate(45deg);
}
.ntclist { display: flex; flex-direction: column; gap: 14px; }
.anno + .anno { border-top: 1px solid var(--line); padding-top: 14px; }
.anno time { display: block; margin-bottom: 4px; color: var(--muted); font-size: 12px; }


.md { font-size: 14px; line-height: 1.7; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md h1, .md h2, .md h3, .md h4, .md h5, .md h6 { margin: 14px 0 8px; line-height: 1.35; }
.md h1 { font-size: 18px; }
.md h2 { font-size: 16px; }
.md h3 { font-size: 15px; }
.md h4, .md h5, .md h6 { font-size: 14px; }
.md p { margin: 0 0 8px; white-space: pre-wrap; }
.md ul, .md ol { margin: 0 0 8px; padding-left: 20px; }
.md li { margin: 2px 0; }
.md blockquote {
  margin: 0 0 8px; padding: 2px 0 2px 12px;
  border-left: 3px solid var(--line2); color: var(--muted); white-space: pre-wrap;
}
.md pre {
  margin: 0 0 8px; padding: 10px 12px; overflow: auto; max-width: 100%;
  background: var(--panel2); border-radius: 8px;
}
.md pre code { background: none; padding: 0; font-size: 13px; white-space: pre; }
.md code { font-size: 13px; padding: 1px 5px; border-radius: 5px; background: var(--panel2); }
.md hr { margin: 12px 0; border: 0; border-top: 1px solid var(--line); }
.md a { color: var(--accent); text-decoration: underline; }
.md del { opacity: .7; }


.annobox {
  margin-top: 12px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel2);
}
.annobox.addbox { border-style: dashed; background: none; }
.annobox .annometa {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 8px; font-size: 12px;
}
.annobox textarea { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }

.annobox .formacts { margin-top: 8px; flex-wrap: nowrap; }
.annobox .formacts .btn { width: auto; }
.picklist { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 14px; }
.actlist { display: flex; flex-direction: column; gap: 6px; margin: 12px 0 14px; }
.actlist .btn { width: 100%; text-align: left; }
.modalbox [data-f=search] { margin-bottom: 4px; }


.tabs { display: flex; gap: 4px; margin-bottom: 16px; flex-wrap: wrap; }
.tab {
  padding: 8px 14px; border-radius: 8px 8px 0 0; color: var(--muted);
  border: 1px solid transparent; border-bottom: 2px solid transparent;
}
.tab:hover { color: var(--fg); text-decoration: none; }
.tab.active { color: var(--fg); border-bottom-color: var(--accent); background: var(--panel); }



@media (max-width: 600px) {
  .pagehead { flex-direction: column; }
  .cards { grid-template-columns: 1fr; }
  table { font-size: 13px; }
  th, td { padding: 7px 6px; }
  .toast { right: 10px; left: auto; max-width: calc(100vw - 20px); }
  body.has-nav .toast { top: 62px; }
  .ntcpop {
    position: fixed; left: 10px; right: 10px; top: 60px;
    width: auto; max-width: none; max-height: 60vh;
  }
  .ntcpop::before { display: none; }
  .recacts-r { flex-wrap: wrap; justify-content: flex-end; }
  .tw table { min-width: 640px; }
}


.qylmsg { margin: 0 0 12px; padding: 8px 10px; border-radius: 8px; font-size: 13px; }
.qylmsg.ok { background: var(--ok-bg); color: var(--ok-fg); border: 1px solid var(--ok-bd); }
.qylmsg.err { background: var(--err-bg); color: var(--err-fg); border: 1px solid var(--err-bd); }
.rokv { display: flex; align-items: baseline; gap: 10px; margin: 10px 0; font-size: 14px; }
.rokv span { flex: 0 0 7em; color: var(--muted); font-size: 12px; }
.rokv b { font-weight: 600; word-break: break-all; }
.qrbox {
  display: flex; align-items: center; justify-content: center;
  min-height: 180px; margin: 10px 0 6px; padding: 10px;
  background: var(--panel2); border: 1px dashed var(--line2); border-radius: 10px;
}
.qrbox img { width: 160px; height: 160px; image-rendering: pixelated; }
.qrstate { margin: 0 0 12px; text-align: center; font-size: 13px; }
.txacts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
