/* 笔记本 — styled after iOS / macOS 备忘录. Follows the system light/dark setting. */

:root {
  color-scheme: light dark;
  --accent: #9a8339; /* muted gold — bright yellow glares */
  --accent-fill: #9a8339;
  --on-accent: #fff;
  --list-bg: #f2f2f7;
  --cell-bg: #ffffff;
  --detail-bg: #ffffff;
  --bar-bg: rgba(249, 249, 249, 0.88);
  --menu-bg: rgba(250, 250, 250, 0.92);
  --menu-solid: #ffffff;
  --text: #000000;
  --text-2: #8a8a8e;
  --text-3: #c7c7cc;
  --sep: rgba(60, 60, 67, 0.2);
  --fill: rgba(118, 118, 128, 0.12);
  --selected: rgba(154, 131, 57, 0.24);
  --ink-paper: rgba(0, 0, 0, 0.025);
  --danger: #ff3b30;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Noto Sans CJK SC", "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #9a8339;
    --accent-fill: #9a8339;
    --on-accent: #fff;
    /* Mac dark grey rather than pure black, which glares. */
    --list-bg: #1e1e1e;
    --cell-bg: #2a2a2c;
    --detail-bg: #1e1e1e;
    --bar-bg: rgba(30, 30, 30, 0.9);
    --menu-bg: rgba(50, 50, 52, 0.94);
    --menu-solid: #3a3a3c;
    --text: #ffffff;
    --text-2: #98989f;
    --text-3: #48484a;
    --sep: rgba(84, 84, 88, 0.62);
    --fill: rgba(118, 118, 128, 0.24);
    --selected: rgba(154, 131, 57, 0.32);
    --ink-paper: rgba(255, 255, 255, 0.045);
    --shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  background: var(--list-bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  margin: 0;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
textarea, input { font: inherit; color: inherit; }
svg { display: block; }
.spacer { flex: 1; }

/* ---------- layout: list | note ---------- */

.app { position: fixed; inset: 0; display: flex; overflow: hidden; }

.sidebar {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  background: var(--list-bg);
}

.detail {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--detail-bg);
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.32s cubic-bezier(0.25, 0.8, 0.25, 1), visibility 0s 0.32s;
}
.app.show-detail .detail {
  transform: none;
  visibility: visible;
  transition: transform 0.32s cubic-bezier(0.25, 0.8, 0.25, 1);
}

@media (min-width: 768px) {
  .sidebar { width: 340px; flex: none; border-right: 0.5px solid var(--sep); }
  .detail {
    position: relative;
    inset: auto;
    flex: 1;
    transform: none;
    visibility: visible;
    transition: none;
  }
  .mobile-only { display: none !important; }
}
@media (max-width: 767.98px) {
  .desktop-only { display: none !important; }
}

/* ---------- buttons ---------- */

.icon-btn {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 20px;
  color: var(--accent);
  transition: opacity 0.15s, background-color 0.15s;
}
.icon-btn svg { width: 26px; height: 26px; }
.icon-btn:active { opacity: 0.45; }
@media (hover: hover) { .icon-btn:hover { background: var(--fill); } }

.back-btn {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 6px 0 0;
  color: var(--accent);
  font-size: 17px;
}
.back-btn svg { width: 24px; height: 24px; margin-right: 1px; }
.back-btn:active { opacity: 0.45; }

.text-btn {
  height: 44px;
  padding: 0 8px;
  color: var(--accent);
  font-size: 17px;
  font-weight: 600;
}
.text-btn:active { opacity: 0.45; }

/* ---------- note list ---------- */

.list-header { flex: none; padding: env(safe-area-inset-top) 16px 6px; }
.list-header-bar { display: flex; align-items: center; height: 44px; margin: 0 -8px 0 -4px; }
.list-title {
  margin: 0 0 8px;
  font-size: 32px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 10px;
  border-radius: 11px;
  background: var(--fill);
  color: var(--text-2);
  cursor: text;
}
.search svg { width: 17px; height: 17px; flex: none; }
.search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 17px;
  color: var(--text);
  -webkit-appearance: none;
  appearance: none;
}
.search input::placeholder { color: var(--text-2); }
.search input::-webkit-search-decoration { -webkit-appearance: none; }

.tag-bar {
  display: flex;
  gap: 8px;
  margin: 10px -16px 0;
  padding: 0 16px 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tag-bar::-webkit-scrollbar { display: none; }
.tag-chip {
  flex: none;
  height: 30px;
  padding: 0 12px;
  border-radius: 15px;
  background: var(--fill);
  color: var(--text);
  font-size: 15px;
  white-space: nowrap;
}
.tag-chip.active { background: var(--accent-fill); color: var(--on-accent); font-weight: 600; }
.trash-hint { margin: 10px 2px 0; font-size: 13px; color: var(--text-2); }

.list-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 0 16px 24px;
}
.group-title { margin: 20px 4px 8px; font-size: 20px; font-weight: 700; }
.group { margin-top: 12px; background: var(--cell-bg); border-radius: 12px; overflow: hidden; }
.group-title + .group { margin-top: 0; }

/* A row is its content on top of the swipe action (删除), which shows
   when the content slides left. */
.note-row {
  position: relative;
  overflow: hidden;
  cursor: default;
  touch-action: pan-y; /* the list scrolls natively; sideways drags are swipes */
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.row-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  background: var(--cell-bg);
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.note-row.dragging .row-content { transition: none; }
.note-row + .note-row::before {
  content: "";
  position: absolute;
  top: 0;
  left: 16px;
  right: 0;
  z-index: 2;
  border-top: 0.5px solid var(--sep);
}
.note-row:active .row-content { background: linear-gradient(var(--fill), var(--fill)), var(--cell-bg); }
.note-row.selected .row-content { background: linear-gradient(var(--selected), var(--selected)), var(--cell-bg); }
.note-row.selected::before, .note-row.selected + .note-row::before { opacity: 0; }
.row-actions { position: absolute; top: 0; right: 0; bottom: 0; display: flex; }
.row-action {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 88px;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
.row-action svg { width: 22px; height: 22px; }
.row-action:active { filter: brightness(0.85); }
.row-action.delete { background: #ff3b30; }
.note-row-main { flex: 1; min-width: 0; }
.note-row-title {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.note-row-sub {
  margin-top: 3px;
  font-size: 15px;
  line-height: 1.3;
  color: var(--text-2);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.note-row-sub time { margin-right: 8px; color: var(--text); opacity: 0.8; }
.note-row-thumb {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 7px;
  object-fit: cover;
  background: var(--fill);
}
.empty-state { margin: 80px 20px; text-align: center; color: var(--text-2); font-size: 15px; line-height: 1.6; white-space: pre-line; }

.list-footer {
  flex: none;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: calc(46px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--bar-bg);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-top: 0.5px solid var(--sep);
  font-size: 15px;
}
.footer-compose { position: absolute; right: 8px; top: 3px; }

/* ---------- note ---------- */

.detail-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 2px;
  height: calc(48px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 8px 0 4px;
}
.detail:not(.has-note) .note-action { visibility: hidden; }
.detail.read-only .note-action:not(#noteMenuBtn) { visibility: hidden; }
.save-state { margin-right: 6px; font-size: 12px; color: var(--text-2); white-space: nowrap; }
.save-state.error { color: var(--danger); }

.detail-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.note { padding: 0 20px 45vh; cursor: text; }
.note-date { margin: 2px 0 14px; text-align: center; font-size: 16px; color: var(--text-2); user-select: none; -webkit-user-select: none; }
.app.sliding .detail textarea { caret-color: transparent; } /* see showDetail() */

.note-title, .blk-text {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  resize: none;
  overflow: hidden;
  background: transparent;
  color: var(--text);
  caret-color: var(--accent);
  -webkit-appearance: none;
  appearance: none;
}
.note-title { margin-bottom: 2px; font-size: 24px; line-height: 1.45; font-weight: 700; }
.note-title::placeholder { color: var(--text-3); }
.blk-text { font-size: 24px; line-height: 1.45; }

.blk-image { display: block; margin: 6px 0; outline: none; }
.blk-image img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  cursor: zoom-in;
  background: var(--fill);
}
.blk-image.pending img { opacity: 0.45; }
.blk-image.selected img, .blk-image:focus-visible img { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- handwriting ---------- */

.blk-drawing {
  position: relative;
  margin: 8px 0;
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  outline: none;
}
.blk-drawing canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.blk-drawing.editing {
  cursor: crosshair;
  background: var(--ink-paper);
  box-shadow: 0 0 0 1.5px var(--accent);
}
.blk-drawing.editing .ink-live { touch-action: none; }
.blk-drawing:focus-visible { box-shadow: 0 0 0 3px var(--accent); }
.ink-handle {
  position: absolute;
  left: 50%;
  bottom: -15px;
  width: 64px;
  height: 30px;
  transform: translateX(-50%);
  display: grid;
  place-items: center;
  cursor: ns-resize;
  touch-action: none;
}
.ink-handle::before { content: ""; width: 40px; height: 5px; border-radius: 3px; background: var(--accent); }

.ink-bar {
  position: absolute;
  left: 50%;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 2px;
  max-width: calc(100% - 12px);
  padding: 5px 6px;
  transform: translateX(-50%);
  background: var(--menu-bg);
  -webkit-backdrop-filter: blur(30px) saturate(1.6);
  backdrop-filter: blur(30px) saturate(1.6);
  border: 0.5px solid var(--sep);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.ink-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  color: var(--text);
}
.ink-btn svg { width: 23px; height: 23px; }
.ink-btn.active { background: var(--fill); color: var(--accent); }
.ink-btn:disabled { opacity: 0.3; cursor: default; }
.ink-btn:not(:disabled):active { opacity: 0.5; }
.ink-color { flex: none; display: grid; place-items: center; width: 40px; height: 40px; }
.ink-color span {
  display: block;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--menu-solid), 0 0 0 3.5px var(--text-3);
}
.ink-sep { flex: none; width: 0.5px; height: 24px; margin: 0 3px; background: var(--sep); }
.ink-done { flex: none; margin-left: 2px; padding: 0 8px; white-space: nowrap; }
@media (max-width: 400px) {
  .ink-bar { gap: 0; padding: 5px 4px; }
  .ink-btn, .ink-color { width: 38px; }
}

.ink-pop {
  position: absolute;
  left: 50%;
  bottom: calc(70px + env(safe-area-inset-bottom));
  z-index: 21;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px 16px;
  transform: translateX(-50%);
  background: var(--menu-bg);
  -webkit-backdrop-filter: blur(30px) saturate(1.6);
  backdrop-filter: blur(30px) saturate(1.6);
  border: 0.5px solid var(--sep);
  border-radius: 16px;
  box-shadow: var(--shadow);
  animation: menu-in 0.14s ease-out;
}
.ink-swatches, .ink-widths { display: flex; justify-content: center; gap: 12px; }
.ink-swatch { width: 32px; height: 32px; border-radius: 50%; box-shadow: inset 0 0 0 0.5px var(--sep); }
.ink-swatch.active { box-shadow: 0 0 0 2px var(--menu-solid), 0 0 0 4px var(--accent); }
.ink-width { display: grid; place-items: center; width: 52px; height: 36px; border-radius: 10px; }
.ink-width span { display: block; width: 26px; border-radius: 99px; background: var(--text); }
.ink-width.active { background: var(--fill); }

/* While drawing, the tool palette takes the place of the bottom toolbar. */
.detail.drawing-mode .detail-toolbar { visibility: hidden; }

.trash-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 0 auto 6px;
  padding: 0 16px;
  font-size: 14px;
  color: var(--text-2);
}
.detail-empty { display: grid; place-items: center; height: 100%; color: var(--text-2); font-size: 15px; }

.detail-toolbar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: calc(46px + env(safe-area-inset-bottom));
  padding: 0 10px env(safe-area-inset-bottom);
  background: var(--bar-bg);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-top: 0.5px solid var(--sep);
}

@media (min-width: 768px) {
  .list-title { font-size: 26px; }
  .note { padding: 0 32px 40vh; }
  .note-title, .blk-text { font-size: 26px; }
}

/* ---------- menus: popover on wide screens, action sheet on phones ---------- */

.menu-layer { position: fixed; inset: 0; z-index: 50; }
.menu {
  position: fixed;
  min-width: 230px;
  max-width: calc(100vw - 16px);
  background: var(--menu-bg);
  -webkit-backdrop-filter: blur(30px) saturate(1.6);
  backdrop-filter: blur(30px) saturate(1.6);
  border: 0.5px solid var(--sep);
  border-radius: 13px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transform-origin: top right;
  animation: menu-in 0.14s ease-out;
}
.menu-message {
  padding: 6px 16px;
  font-size: 19px;
  line-height: 1.35;
  color: var(--text-2);
  text-align: center;
}
.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 11px 16px;
  font-size: 16px;
  text-align: left;
  color: var(--text);
}
.menu-message + .menu-item, .menu-item + .menu-item { border-top: 0.5px solid var(--sep); }
.menu-item svg { width: 20px; height: 20px; flex: none; }
.menu-item.danger { color: var(--danger); }
.menu-item:active { background: var(--fill); }
@media (hover: hover) { .menu-item:hover { background: var(--fill); } }
.menu-cancel { display: none; }

.menu-layer.sheet {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding: 0 8px calc(8px + env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, 0.32);
  animation: fade-in 0.2s;
}
.menu-layer.sheet .menu {
  position: static;
  width: 100%;
  max-width: 430px;
  border-radius: 14px;
  animation: sheet-in 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.menu-layer.sheet .menu-item { justify-content: center; padding: 16px; font-size: 19px; color: var(--accent); }
.menu-layer.sheet .menu-item.danger { color: var(--danger); }
.menu-layer.sheet .menu-item svg { display: none; }
.menu-layer.sheet .menu-cancel {
  display: block;
  width: 100%;
  max-width: 430px;
  margin-top: 8px;
  padding: 16px;
  border-radius: 14px;
  background: var(--menu-solid);
  color: var(--accent);
  font-size: 19px;
  font-weight: 600;
  animation: sheet-in 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes menu-in { from { opacity: 0; transform: scale(0.94); } }
@keyframes sheet-in { from { transform: translateY(120%); } }
@keyframes fade-in { from { opacity: 0; } }

/* ---------- toast, lightbox ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(64px + env(safe-area-inset-bottom));
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: calc(100vw - 32px);
  padding: 10px 18px;
  border-radius: 22px;
  background: rgba(28, 28, 30, 0.94);
  color: #fff;
  font-size: 15px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast button { color: var(--accent); font-weight: 600; white-space: nowrap; }

.lightbox { position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; background: #000; }
.lightbox-bar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: calc(50px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 8px 0;
}
.lightbox-bar button { height: 44px; padding: 0 10px; color: var(--accent); font-size: 17px; font-weight: 600; }
.lightbox-bar svg { width: 24px; height: 24px; }
.lightbox img { flex: 1; min-height: 0; width: 100%; object-fit: contain; padding-bottom: env(safe-area-inset-bottom); }

/* ---------- login ---------- */

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px;
}
.login-card { width: 100%; max-width: 340px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.login-icon { width: 72px; height: 72px; border-radius: 16px; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12); }
.login-card h1 { margin: 0 0 6px; font-size: 26px; font-weight: 700; }
.login-input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: var(--cell-bg);
  font-size: 17px;
  outline: none;
  box-shadow: inset 0 0 0 0.5px var(--sep);
}
.login-input:focus { box-shadow: inset 0 0 0 2px var(--accent); }
.login-btn {
  width: 100%;
  height: 48px;
  border-radius: 12px;
  background: var(--accent-fill);
  color: var(--on-accent);
  font-size: 17px;
  font-weight: 600;
}
.login-btn:active { opacity: 0.7; }
.login-error { margin: 0; color: var(--danger); font-size: 14px; text-align: center; line-height: 1.5; }
.login-note { margin: 0; color: var(--text-2); font-size: 14px; text-align: center; line-height: 1.6; }
.login-link { color: var(--accent); font-size: 15px; text-decoration: none; }
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- long press, locked notes, dialogs ---------- */

.note-row.menu-target .row-content { background: linear-gradient(var(--fill), var(--fill)), var(--cell-bg); }
.row-lock { display: inline-block; width: 15px; height: 15px; margin-right: 4px; vertical-align: -2px; color: var(--text-2); }
.row-lock svg { width: 100%; height: 100%; }

.lock-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: 320px;
  margin: 14vh auto 0;
  padding: 0 20px;
  text-align: center;
}
.lock-panel .lock-big { width: 54px; height: 54px; color: var(--accent); }
.lock-panel h2 { margin: 4px 0 0; font-size: 20px; font-weight: 700; }
.lock-panel p { margin: 0; color: var(--text-2); font-size: 15px; }
.lock-panel form { display: flex; flex-direction: column; gap: 10px; width: 100%; margin-top: 10px; }
.detail.locked-view .note-action:not(#noteMenuBtn) { visibility: hidden; }

.dialog-layer {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.35);
  animation: fade-in 0.15s;
}
.dialog {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 340px;
  padding: 20px 16px 14px;
  background: var(--menu-solid);
  border-radius: 14px;
  box-shadow: var(--shadow);
  animation: menu-in 0.15s ease-out;
}
.dialog-title { margin: 0; font-size: 17px; font-weight: 600; text-align: center; }
.dialog-message { margin: 0 0 4px; font-size: 13px; line-height: 1.5; color: var(--text-2); text-align: center; }
.dialog-input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: var(--fill);
  color: var(--text);
  font-size: 16px; /* 16px or more: iOS won't zoom in */
  outline: none;
}
.dialog-input:focus { box-shadow: inset 0 0 0 2px var(--accent); }
.dialog-row { display: flex; gap: 8px; }
.dialog-row .dialog-input { flex: 1; min-width: 0; }
.dialog-inline-btn {
  flex: none;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--fill);
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.dialog-inline-btn:disabled { color: var(--text-2); cursor: default; }
.dialog-error { margin: 0; font-size: 13px; line-height: 1.5; color: var(--danger); text-align: center; }
.dialog-buttons { display: flex; gap: 8px; margin-top: 6px; }
.dialog-btn { flex: 1; height: 44px; border-radius: 10px; background: var(--fill); color: var(--accent); font-size: 16px; }
.dialog-btn.primary { background: var(--accent-fill); color: var(--on-accent); font-weight: 600; }
.dialog-btn:disabled { opacity: 0.5; cursor: default; }

/* ---------- 登录设备 ---------- */

.devices-dialog { max-width: 420px; }
.device-list { max-height: 52vh; overflow-y: auto; margin: 0 -16px; border-top: 0.5px solid var(--sep); }
.device-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 0.5px solid var(--sep);
}
.device-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--fill);
  color: var(--accent);
}
.device-icon svg { width: 22px; height: 22px; }
.device-info { flex: 1; min-width: 0; }
.device-name { display: flex; align-items: center; gap: 6px; font-size: 16px; font-weight: 600; }
.device-badge {
  padding: 1px 7px;
  border-radius: 8px;
  background: var(--accent-fill);
  color: var(--on-accent);
  font-size: 12px;
  font-weight: 600;
}
.device-meta { margin-top: 3px; font-size: 13px; line-height: 1.45; color: var(--text-2); }
.device-out { flex: none; padding: 6px 10px; border-radius: 8px; background: var(--fill); color: var(--danger); font-size: 14px; font-weight: 600; white-space: nowrap; }
.dialog-btn.danger { color: var(--danger); }
