/* ==========================================================
   VaultCard — 用 Obsidian 的方式經營人脈
   紫黑色主題（Obsidian 風格深色配色）
   ========================================================== */
:root {
  --bg-0: #121212;
  --bg-1: #1a1a1a;
  --bg-2: #202020;
  --bg-3: #262626;
  --bg-4: #2f2f2f;
  --border: #333;
  --border-soft: #2a2a2a;
  --text: #dcddde;
  --text-muted: #a3a3a3;
  --text-faint: #6f6f6f;
  --accent: #8a5cf5;
  --accent-2: #a88bfa;
  --accent-soft: rgba(138, 92, 245, 0.16);
  --accent-glow: rgba(138, 92, 245, 0.45);
  --deep: #483699;
  --green: #4ade80;
  --yellow: #facc15;
  --red: #f87171;
  --blue: #60a5fa;
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar: 236px;
  --font: "Inter", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "Fira Code", ui-monospace, Menlo, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg-1);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
::selection { background: var(--accent-glow); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 10px; border: 2px solid var(--bg-1); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; min-height: 100dvh; }

.ribbon {
  width: 52px;
  background: var(--bg-0);
  border-right: 1px solid var(--border-soft);
  display: flex; flex-direction: column; align-items: center;
  padding: 12px 0; gap: 6px;
  position: sticky; top: 0; height: 100vh;
}
.ribbon .logo { width: 30px; height: 30px; margin-bottom: 10px; }

.sidebar {
  width: var(--sidebar);
  background: var(--bg-2);
  border-right: 1px solid var(--border-soft);
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 18px 12px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 18px; }
.brand-name { font-weight: 700; font-size: 17px; letter-spacing: .3px; }
.brand-sub { font-size: 12px; color: var(--text-muted); line-height: 1.2; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--text-muted); font-size: 14.5px;
}
.nav a:hover { background: var(--bg-3); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--accent-soft); color: var(--accent-2); }
.nav svg { width: 18px; height: 18px; flex: none; }

.sidebar-foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--border-soft); }
.mini-progress { font-size: 12.5px; color: var(--text-muted); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: none;
  align-items: center; gap: 10px;
  padding: 10px 16px;
  background: rgba(26,26,26,.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
  position: sticky; top: 0; z-index: 20;
}
.topbar .title { font-weight: 600; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.view { padding: 32px 40px 80px; max-width: 980px; width: 100%; margin: 0 auto; }
.view.wide { max-width: 1280px; }

.bottom-nav { display: none; }

/* ---------- Common ---------- */
h1, h2, h3, h4 { line-height: 1.3; margin: 1.4em 0 .6em; }
h1 { font-size: 30px; margin-top: 0; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.kbd, kbd {
  font-family: var(--mono); font-size: .82em;
  background: var(--bg-4); border: 1px solid #444; border-bottom-width: 2px;
  border-radius: 5px; padding: 1px 6px; color: var(--text);
  white-space: nowrap;
}
code {
  font-family: var(--mono); font-size: .88em;
  background: var(--bg-3); color: #e2a6ff;
  padding: 2px 6px; border-radius: 5px;
}
pre {
  background: var(--bg-0); border: 1px solid var(--border-soft);
  padding: 14px 16px; border-radius: var(--radius-sm);
  overflow-x: auto; font-size: 14px; line-height: 1.6;
}
pre code { background: none; padding: 0; color: var(--text); }

.card {
  background: var(--bg-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 20px;
}
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--border); background: var(--bg-3);
  padding: 9px 16px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 14.5px; font-weight: 500;
  transition: background .15s, border-color .15s, transform .05s;
  color: var(--text);
}
.btn:hover { background: var(--bg-4); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #7b4ff0; }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }

.icon-btn {
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: none; color: var(--text-muted); cursor: pointer;
}
.icon-btn:hover { background: var(--bg-3); color: var(--text); }
.icon-btn.active { color: var(--accent-2); }
.icon-btn svg { width: 20px; height: 20px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; padding: 2px 10px; border-radius: 99px;
  background: var(--bg-3); color: var(--text-muted); border: 1px solid var(--border-soft);
}
.pill.accent { background: var(--accent-soft); color: var(--accent-2); border-color: transparent; }
.pill.green { background: rgba(74,222,128,.12); color: var(--green); border-color: transparent; }

.bar { height: 8px; background: var(--bg-4); border-radius: 99px; overflow: hidden; }
.bar > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--deep), var(--accent), var(--accent-2));
  border-radius: 99px; transition: width .6s ease;
}

/* ---------- List ---------- */
.chapter { margin-bottom: 28px; }
.chapter-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.chapter-head h2 { margin: 0; font-size: 19px; }
.chapter-num {
  font-family: var(--mono); font-size: 12px; color: var(--accent-2);
  background: var(--accent-soft); padding: 2px 8px; border-radius: 6px;
}
.item-list { display: flex; flex-direction: column; gap: 8px; }
.list-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: var(--bg-2); border: 1px solid var(--border-soft);
  border-radius: var(--radius); color: var(--text);
  transition: border-color .15s, background .15s;
}
a.list-item:hover { border-color: rgba(138,92,245,.55); background: #232029; text-decoration: none; }
.list-item .state {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
  border: 2px solid var(--border); color: var(--text-muted);
}
.list-item.done .state { background: var(--accent); border-color: var(--accent); color: #fff; }
.list-item.current .state { border-color: var(--accent); color: var(--accent-2); box-shadow: 0 0 0 4px var(--accent-soft); }
.list-item.locked { opacity: .5; cursor: not-allowed; }
.list-item .meta { flex: 1; min-width: 0; }
.list-item .t { font-weight: 600; }
.list-item .d { font-size: 13.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .right { display: flex; gap: 6px; flex: none; }

.crumbs { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.tip {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  padding: 12px 16px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1em 0;
}
.tip.warn { border-color: var(--yellow); background: rgba(250,204,21,.08); }
.tip.good { border-color: var(--green); background: rgba(74,222,128,.08); }
.tip-title { font-weight: 700; display: block; margin-bottom: 2px; }
/* ---------- Practice ---------- */
.practice { margin-top: 28px; }
.practice-goal { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 14px; padding: 0; list-style: none; }
.practice-goal li { display: flex; align-items: center; gap: 8px; font-size: 14.5px; color: var(--text-muted); }
.practice-goal li .chk {
  width: 18px; height: 18px; border-radius: 5px; border: 2px solid var(--border); flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 11px; color: transparent;
}
.practice-goal li.ok { color: var(--text); }
.practice-goal li.ok .chk { background: var(--green); border-color: var(--green); color: #111; }

.editor-split { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; min-height: 260px; }
.editor-split .pane-label {
  font-size: 11.5px; letter-spacing: 1px; text-transform: uppercase; color: var(--text-faint);
  padding: 8px 14px; border-bottom: 1px solid var(--border-soft); background: var(--bg-2);
  display: flex; justify-content: space-between; align-items: center;
}
.editor-split .pane { display: flex; flex-direction: column; min-width: 0; }
.editor-split .pane + .pane { border-left: 1px solid var(--border); }
.md-input {
  flex: 1; width: 100%; resize: vertical; min-height: 220px;
  background: var(--bg-1); color: var(--text); border: none; outline: none;
  padding: 14px 16px; font-family: var(--mono); font-size: 14px; line-height: 1.7;
  tab-size: 2;
}
.md-preview { flex: 1; padding: 6px 18px 14px; background: var(--bg-1); overflow: auto; font-size: 15px; }

/* ---------- Rendered markdown (Obsidian-like) ---------- */
.md h1, .md h2, .md h3, .md h4, .md h5, .md h6 { margin: .9em 0 .4em; }
.md h1 { font-size: 1.7em; }
.md h2 { font-size: 1.4em; }
.md h3 { font-size: 1.2em; }
.md h4, .md h5, .md h6 { font-size: 1.05em; }
.md p { margin: .5em 0; }
.md ul, .md ol { padding-left: 1.5em; margin: .4em 0; }
.md li.task { list-style: none; margin-left: -1.3em; }
.md li.task input { accent-color: var(--accent); margin-right: 6px; vertical-align: middle; }
.md li.task.checked > .task-text { text-decoration: line-through; color: var(--text-faint); }
.md mark { background: rgba(250, 204, 21, .35); color: inherit; padding: 0 2px; border-radius: 3px; }
.md del { color: var(--text-muted); }
.md blockquote { border-left: 3px solid var(--accent); margin: .6em 0; padding: 2px 14px; color: var(--text-muted); }
.md .internal-link { color: var(--accent-2); cursor: pointer; text-decoration: none; border-bottom: 1px dashed transparent; }
.md .internal-link:hover { border-bottom-color: var(--accent-2); }
.md .internal-link.unresolved { opacity: .65; }
.md .tag {
  background: var(--accent-soft); color: var(--accent-2);
  padding: 1px 8px; border-radius: 99px; font-size: .9em; cursor: pointer;
}
.md .embed {
  border-left: 2px solid var(--accent); background: var(--bg-2);
  padding: 8px 14px; margin: .6em 0; border-radius: 0 6px 6px 0;
}
.md .embed-title { font-size: 12px; color: var(--text-faint); margin-bottom: 2px; }
.md table { border-collapse: collapse; margin: .6em 0; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--border); padding: 5px 10px; }
.md th { background: var(--bg-3); }
.md hr { border: none; border-top: 1px solid var(--border); margin: 1em 0; }
.md .frontmatter {
  background: var(--bg-2); border: 1px solid var(--border-soft); border-radius: 8px;
  padding: 8px 12px; margin: .5em 0 1em; font-size: 13.5px;
}
.md .frontmatter .fm-title { font-size: 11.5px; color: var(--text-faint); margin-bottom: 4px; letter-spacing: .5px; }
.md .fm-row { display: flex; gap: 10px; padding: 2px 0; }
.md .fm-key { color: var(--text-muted); min-width: 80px; }
.md .callout {
  --c: 138, 92, 245;
  background: rgba(var(--c), .1);
  border-left: 3px solid rgb(var(--c));
  border-radius: 0 8px 8px 0; padding: 8px 14px; margin: .7em 0;
}
.md .callout-title { font-weight: 700; color: rgb(var(--c)); display: flex; gap: 6px; align-items: center; }
.md .callout[data-type="tip"], .md .callout[data-type="success"] { --c: 74, 222, 128; }
.md .callout[data-type="warning"], .md .callout[data-type="caution"] { --c: 250, 204, 21; }
.md .callout[data-type="danger"], .md .callout[data-type="error"], .md .callout[data-type="bug"] { --c: 248, 113, 113; }
.md .callout[data-type="info"], .md .callout[data-type="todo"] { --c: 96, 165, 250; }
.md .callout[data-type="question"], .md .callout[data-type="faq"] { --c: 251, 146, 60; }
.md .callout[data-type="quote"] { --c: 163, 163, 163; }
.md code { font-size: .88em; }

/* ---------- Graph ---------- */
.graph-wrap { position: relative; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--bg-0); }
.graph-wrap canvas { display: block; width: 100%; height: 62vh; min-height: 360px; touch-action: none; cursor: grab; }
.graph-legend { position: absolute; left: 12px; bottom: 10px; display: flex; gap: 14px; font-size: 12px; color: var(--text-muted); flex-wrap: wrap; pointer-events: none; }
.graph-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.graph-tip { position: absolute; right: 12px; top: 10px; font-size: 12px; color: var(--text-faint); pointer-events: none; }
.segmented { display: inline-flex; background: var(--bg-3); border-radius: var(--radius-sm); padding: 3px; border: 1px solid var(--border-soft); }
.segmented button { border: none; background: transparent; padding: 5px 14px; border-radius: 6px; cursor: pointer; color: var(--text-muted); font-size: 14px; }
.segmented button.on { background: var(--accent); color: #fff; }

/* ---------- Shortcuts ---------- */
.sc-group { margin-bottom: 22px; }
.sc-group h3 { margin: 0 0 10px; font-size: 16px; color: var(--accent-2); }
.sc-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border-soft); font-size: 15px; }
.sc-row:last-child { border-bottom: none; }
.sc-keys { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.search-input {
  width: 100%; background: var(--bg-2); border: 1px solid var(--border); color: var(--text);
  padding: 10px 14px; border-radius: var(--radius-sm); font-size: 15px; outline: none; font-family: inherit;
}
.search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- Toast & modal ---------- */
.toast-wrap { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: var(--bg-4); border: 1px solid rgba(138,92,245,.5); color: var(--text);
  padding: 10px 18px; border-radius: 99px; font-size: 14px; box-shadow: 0 8px 30px rgba(0,0,0,.5);
  animation: toastIn .25s ease, toastOut .3s ease 2.4s forwards;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px); } }

.palette-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 90; display: flex; align-items: flex-start; justify-content: center; padding: 12vh 16px 0; }
.palette { width: 100%; max-width: 560px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 20px 60px rgba(0,0,0,.6); overflow: hidden; }
.palette input { width: 100%; border: none; border-bottom: 1px solid var(--border); background: transparent; padding: 14px 16px; color: var(--text); font-size: 16px; outline: none; font-family: inherit; }
.palette ul { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow: auto; }
.palette li { padding: 9px 12px; border-radius: 6px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; font-size: 14.5px; }
.palette li.sel, .palette li:hover { background: var(--accent-soft); color: var(--accent-2); }
.palette li small { color: var(--text-faint); }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 110; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .ribbon, .sidebar { display: none; }
  .topbar { display: flex; }
  .view { padding: 20px 16px 110px; }
  .bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
    background: rgba(22,22,22,.94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-soft);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .bottom-nav a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    font-size: 11px; color: var(--text-faint); padding: 4px 0; text-decoration: none;
  }
  .bottom-nav a svg { width: 22px; height: 22px; }
  .bottom-nav a.active { color: var(--accent-2); }
  .toast-wrap { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .editor-split { grid-template-columns: 1fr; }
  .editor-split .pane + .pane { border-left: none; border-top: 1px solid var(--border); }
  .hero { padding: 28px 22px; }
  .hero .gem { width: 110px; height: 110px; right: -10px; opacity: .35; }
  h1 { font-size: 25px; }
  .hero h1 { font-size: 26px; }
}
@media (max-width: 560px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .compare { grid-template-columns: 1fr; }
  .list-item .right .pill:not(.green) { display: none; }
  .ui-mock { grid-template-columns: 24px 70px 1fr 64px; font-size: 10.5px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ==========================================================
   名片與人脈
   ========================================================== */
.cx-tabs { margin-bottom: 18px; max-width: 100%; overflow-x: auto; }
.cx-tabs a { padding: 6px 14px; border-radius: 6px; color: var(--text-muted); font-size: 14px; white-space: nowrap; text-decoration: none; }
.cx-tabs a.on { background: var(--accent); color: #fff; }
.cx-tabs a small { opacity: .75; }
.cx-head { margin-bottom: 18px; }
.cx-head h1 { margin-bottom: 4px; }
.cx-head p { max-width: 640px; }
.cx-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.cx-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 16px; }
.cx-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.cx-form { display: flex; flex-direction: column; gap: 12px; }
.cx-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cx-field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--text-muted); min-width: 0; }
.cx-input {
  width: 100%; background: var(--bg-1); border: 1px solid var(--border); color: var(--text);
  padding: 9px 12px; border-radius: var(--radius-sm); font-size: 15px; outline: none; font-family: inherit; line-height: 1.5;
}
textarea.cx-input { resize: vertical; }
.cx-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cx-colors { display: flex; gap: 10px; }
.cx-colors input { position: absolute; opacity: 0; pointer-events: none; }
.cx-colors i { display: block; width: 26px; height: 26px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; box-shadow: 0 0 0 2px var(--bg-2); }
.cx-colors input:checked + i { border-color: #fff; }
.cx-colors input:focus-visible + i { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.cx-more summary { cursor: pointer; color: var(--accent-2); font-size: 14px; margin-bottom: 10px; }

/* 名片本體：長得像一則 Obsidian 筆記 */
.bcard { --bc: #8a5cf5; background: var(--bg-2); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; box-shadow: 0 18px 50px -20px color-mix(in srgb, var(--bc) 60%, transparent); }
.bc-file { display: flex; justify-content: space-between; align-items: center; padding: 7px 14px; font-size: 12px; color: var(--text-faint); background: var(--bg-0); border-bottom: 1px solid var(--border-soft); font-family: var(--mono); }
.bc-body { padding: 20px 20px 18px; background: linear-gradient(160deg, color-mix(in srgb, var(--bc) 22%, transparent), transparent 55%); }
.bc-top { display: flex; gap: 14px; align-items: center; }
.bc-avatar { width: 58px; height: 58px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 24px; font-weight: 700; color: #fff; background: var(--bc); box-shadow: 0 0 0 4px color-mix(in srgb, var(--bc) 25%, transparent); }
.bc-id { min-width: 0; }
.bc-name { font-size: 22px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.bc-role { color: var(--text-muted); font-size: 14px; overflow-wrap: anywhere; }
.bc-bio { margin: 14px 0 0; font-size: 14.5px; color: #cfcfcf; border-left: 3px solid var(--bc); padding-left: 10px; overflow-wrap: anywhere; }
.bc-tags, .cx-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.cx-chips { margin: 0 0 14px; }
.bc-tag { font-size: 12.5px; padding: 2px 9px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-2); border: 1px solid transparent; font-family: inherit; }
button.bc-tag { cursor: pointer; }
button.bc-tag.on { border-color: var(--accent-2); background: var(--accent); color: #fff; }
.bc-links { display: flex; flex-direction: column; margin-top: 14px; border-top: 1px solid var(--border-soft); }
.bc-link { display: grid; grid-template-columns: 22px 86px 1fr; gap: 6px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--border-soft); color: var(--text); font-size: 14px; text-decoration: none !important; }
.bc-link:hover .bc-lv { color: var(--accent-2); }
.bc-lk { color: var(--text-faint); font-size: 12.5px; }
.bc-lv { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cx-share { text-align: center; }
.cx-qr { width: 220px; max-width: 100%; margin: 0 auto; border-radius: 12px; overflow: hidden; }
.cx-qr svg { display: block; width: 100%; height: auto; }
.cx-qr-hint { font-size: 12.5px; margin: 8px 0 12px; }
.cx-share .cx-actions { justify-content: center; }

.cx-receive { max-width: 460px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.cx-empty { text-align: center; padding: 34px 20px; }
.cx-person { color: inherit; text-decoration: none !important; }
.cx-av { width: 38px; height: 38px; flex: none; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; }

.cx-props { margin-bottom: 14px; display: flex; flex-direction: column; gap: 12px; }
.cx-props-h { font-size: 12px; letter-spacing: 1px; color: var(--text-faint); }
.cx-editor { min-height: 300px; }
.cx-editor .md-input { min-height: 280px; }
.cx-links-box { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 14px; }
.cx-links-box h3 { font-size: 15px; margin: 0 0 8px; }
.cx-mini { display: inline-block; margin: 0 6px 6px 0; padding: 3px 10px; border-radius: 99px; background: var(--bg-3); border: 1px solid var(--border-soft); font-size: 13.5px; }

.cx-scan { max-width: 480px; padding: 0; overflow: hidden; }
.cx-scan video { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: #000; }
.cx-scan-bar { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; font-size: 14px; color: var(--text-muted); }

@media (max-width: 900px) {
  .cx-layout { grid-template-columns: 1fr; }
  .cx-side { position: static; order: -1; }
}
@media (max-width: 560px) {
  .cx-row2 { grid-template-columns: 1fr; }
}

/* ---------- VaultCard 外框 ---------- */
:root { --topbar-h: 56px; --bnav-h: 60px; }
.welcome { text-align: center; padding: 48px 20px 24px; }
.welcome .w-logo { width: 84px; height: 84px; margin: 0 auto 12px; }
.welcome h1 { font-size: 34px; margin-bottom: 8px; }
.welcome p.lead { color: #cfc7e8; max-width: 520px; margin: 0 auto 22px; font-size: 17px; }
.welcome .cx-actions { justify-content: center; }
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 34px; text-align: left; }
.how .card b { display: block; margin: 4px 0 2px; }
.how .card span { color: var(--text-muted); font-size: 14px; }
.how .n { font-size: 26px; }
.settings-list { display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 900px) {
  .topbar { height: var(--topbar-h); padding-top: 0; padding-bottom: 0; }
  .bottom-nav { height: calc(var(--bnav-h) + env(safe-area-inset-bottom)); padding-top: 4px; padding-bottom: env(safe-area-inset-bottom); align-items: stretch; }
  .how { grid-template-columns: 1fr; }
}
.native .topbar { padding-top: env(safe-area-inset-top); height: calc(var(--topbar-h) + env(safe-area-inset-top)); }
#cx-save .cx-row2 { margin-bottom: 12px; }
