:root {
  --primary: #4f46e5;
  --primary-soft: #eef2ff;
  --bg: #f1f5f9;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --danger: #ef4444;
  --danger-soft: #fef2f2;
  --warn: #f59e0b;
  --warn-soft: #fffbeb;
  --ok: #10b981;
  --ok-soft: #ecfdf5;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 8px 24px rgba(15, 23, 42, 0.06);
  --radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

/* 角落品牌 logo：原居中水印改为顶栏左上角小标，不遮挡任何内容 */
.brand-logo {
  height: 34px;
  width: auto;
  margin-right: 10px;
  border-radius: 4px;
  vertical-align: middle;
  flex-shrink: 0;
}
@media (max-width: 600px) {
  .brand-logo { height: 28px; margin-right: 8px; }
}

.app {
  width: 100%;
  padding: 0 20px 90px;
}

/* 顶栏 */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0 12px;
  flex-wrap: wrap;
}

.brand {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.add-top {
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
  padding: 8px 16px;
  cursor: pointer;
  transition: opacity 0.15s;
}

.add-top:active { opacity: 0.75; }

.add-proj {
  border: 1px solid var(--primary);
  background: #fff;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
  padding: 8px 14px;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.add-proj:hover { background: var(--primary-soft); }
.add-proj:active { opacity: 0.7; }

.export-pdf {
  border: none;
  background: var(--ok);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
  padding: 8px 14px;
  cursor: pointer;
  transition: opacity 0.15s;
  white-space: nowrap;
}

.export-pdf:active { opacity: 0.7; }

.fs-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  border-radius: 10px;
  padding: 7px 12px;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.fs-btn:hover { background: var(--bg); }
.fs-btn:active { opacity: 0.7; }

.refresh-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  border-radius: 10px;
  padding: 7px 12px;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.refresh-btn:hover { background: var(--bg); }
.refresh-btn:active { opacity: 0.7; }

.status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.status .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warn);
}

.status.online .dot { background: var(--ok); }
.status.offline .dot { background: var(--danger); }

/* 流程区 */
.flow-section {
  padding-top: 6px;
}

/* 项目分组 */
.proj-group {
  margin-bottom: 22px;
}

.proj-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  margin: 4px 2px 6px;
}

.proj-title .bar {
  width: 4px;
  height: 18px;
  background: var(--proj-color, var(--primary));
  border-radius: 2px;
  flex: none;
}

.proj-count {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  background: var(--bg);
  border-radius: 20px;
  padding: 2px 9px;
}

.proj-del {
  border: none;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 12px;
  border-radius: 8px;
  padding: 2px 8px;
  cursor: pointer;
  margin-left: 2px;
}

.proj-del:active { opacity: 0.7; }

.proj-copy {
  border: none;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  border-radius: 8px;
  padding: 2px 8px;
  cursor: pointer;
  margin-left: 2px;
}

.proj-copy:active { opacity: 0.7; }

.proj-export {
  border: none;
  background: var(--ok-soft);
  color: var(--ok);
  font-size: 12px;
  border-radius: 8px;
  padding: 2px 8px;
  cursor: pointer;
  margin-left: 2px;
}

.proj-export:active { opacity: 0.7; }

.proj-share {
  border: none;
  background: #fdf4ff;
  color: #a21caf;
  font-size: 12px;
  border-radius: 8px;
  padding: 2px 8px;
  cursor: pointer;
  margin-left: 2px;
}

.proj-share:active { opacity: 0.7; }

.proj-pdf {
  border: none;
  background: var(--ok-soft);
  color: var(--ok);
  font-size: 12px;
  border-radius: 8px;
  padding: 2px 8px;
  cursor: pointer;
  margin-left: 2px;
}

.proj-pdf:active { opacity: 0.7; }

.proj-chain {
  border: none;
  background: #eff6ff;
  color: #2563eb;
  font-size: 12px;
  border-radius: 8px;
  padding: 2px 8px;
  cursor: pointer;
  margin-left: 2px;
}

.proj-chain:active { opacity: 0.7; }

.proj-nav {
  margin-left: auto;
  display: flex;
  gap: 4px;
}

.nav-btn {
  width: 26px;
  height: 26px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 8px;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-btn:hover { background: var(--bg); }
.nav-btn:active { opacity: 0.7; }

.proj-others {
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  margin: 10px 2px 6px;
}

/* 项目日期进度条 */
.proj-progress {
  margin: 12px 0 0;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.progress-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.progress-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ok);
}

.proj-progress.before .progress-label { color: var(--muted); }
.proj-progress.done .progress-label { color: #2563eb; }

.progress-pct {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.progress-track {
  position: relative;
  height: 10px;
  border-radius: 6px;
  background: var(--bg);
  overflow: visible;
}

.progress-fill {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, #34d399, #10b981);
  transition: width 0.3s ease;
}

.proj-progress.before .progress-fill { background: #cbd5e1; }
.proj-progress.done .progress-fill { background: linear-gradient(90deg, #60a5fa, #2563eb); }

.progress-today {
  position: absolute;
  top: 50%;
  width: 4px;
  height: 18px;
  transform: translate(-50%, -50%);
  background: var(--text);
  border-radius: 2px;
  box-shadow: 0 0 0 2px #fff;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.progress-meta span:nth-child(2) { color: var(--text); font-weight: 600; }

/* 项目模板 */
.template-box {
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.template-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.template-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tpl-chip {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 12px;
  border-radius: 20px;
  padding: 4px 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tpl-chip:hover { border-color: var(--primary); color: var(--primary); }
.tpl-chip .x { color: var(--muted); }
.tpl-chip .x:hover { color: var(--danger); }

.template-save {
  display: flex;
  gap: 8px;
}

.template-save input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
}

.template-save input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.template-empty {
  font-size: 12px;
  color: #94a3b8;
}

.flow-scroll {
  overflow-x: hidden;
  overflow-y: auto;
  padding: 14px 4px 26px;
  -webkit-overflow-scrolling: touch;
}

.flow-container {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.flow-scroll-item {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 12px 4px 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  -webkit-overflow-scrolling: touch;
}

.flow-scroll-item::-webkit-scrollbar { height: 8px; }
.flow-scroll-item::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.flow-inner {
  display: flex;
  flex-direction: column;
  width: max-content;
  min-width: 100%;
}

.flow {
  display: flex;
  align-items: stretch;
  flex-wrap: nowrap;
  gap: 0;
  width: max-content;
  min-width: 100%;
}

/* 日期节点 */
.node {
  flex: 0 0 180px;
  background: var(--card);
  border-radius: 12px;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--proj-color, var(--primary));
  padding: 10px;
}

.node.today {
  box-shadow: 0 0 0 2px var(--ok), var(--shadow);
}

.node.past { opacity: 0.68; }

.node-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding-bottom: 7px;
  border-bottom: 1px dashed var(--border);
}

.node-date {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.node-year {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.2;
}

.node-day {
  font-size: 15px;
  font-weight: 700;
}

.node-week {
  font-size: 11px;
  color: var(--muted);
}

.node.today .node-day { color: var(--ok); }

.node-tag {
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  background: var(--ok);
  border-radius: 20px;
  padding: 1px 6px;
  margin-left: 4px;
}

/* 箭头 */
.flow-arrow {
  flex: none;
  width: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--proj-color, var(--primary));
  font-size: 18px;
  font-weight: 700;
  user-select: none;
}

/* 节点内日程项 */
.node-items {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 7px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  transition: box-shadow 0.15s, background 0.15s;
}

.item:hover { box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08); }

.item.done { opacity: 0.6; }
.item.done .item-title { text-decoration: line-through; color: var(--muted); }

.item.overdue { border-left: 3px solid var(--danger); }
.item.due-today { border-left: 3px solid var(--warn); }
.item:not(.overdue):not(.due-today) { border-left: 3px solid var(--primary); }
.item.done { border-left-color: #cbd5e1; }

.check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  flex: none;
  margin-top: 1px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 11px;
  transition: all 0.15s;
}

.item.done .check { background: var(--ok); border-color: var(--ok); }

.item-main { flex: 1; min-width: 0; }

.item-title {
  font-weight: 600;
  font-size: 13px;
  word-break: break-all;
}

.item-content {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  word-break: break-all;
  white-space: pre-wrap;
  line-height: 1.4;
}

.item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 3px;
}

.time-badge {
  font-size: 10px;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 6px;
  padding: 1px 5px;
  font-variant-numeric: tabular-nums;
}

.deadline-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  border-radius: 6px;
  padding: 1px 5px;
  font-weight: 500;
}

.deadline-badge.none { display: none; }
.deadline-badge.overdue { background: var(--danger-soft); color: var(--danger); }
.deadline-badge.due-today { background: var(--warn-soft); color: #b45309; }
.deadline-badge.normal { background: var(--bg); color: var(--muted); }
.deadline-badge.done { background: #f1f5f9; color: #94a3b8; text-decoration: line-through; }

.item-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: none;
}

.mini-btn {
  border: none;
  background: var(--bg);
  color: var(--muted);
  width: 22px;
  height: 22px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
}

.mini-btn:active { background: var(--border); }
.mini-btn.del { color: var(--danger); }

.empty {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  padding: 40px 0;
}

.hidden { display: none !important; }

/* FAB */
.fab {
  position: fixed;
  right: 22px;
  bottom: 26px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 30px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s;
  z-index: 20;
}

.fab:active { transform: scale(0.92); }

/* 弹窗 */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
  backdrop-filter: blur(2px);
}

.modal-mask.show { display: flex; }

.modal {
  background: #fff;
  width: 100%;
  max-width: 520px;
  border-radius: 20px 20px 0 0;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.22s ease;
}

@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@media (min-width: 560px) {
  .modal-mask { align-items: center; }
  .modal { border-radius: 20px; }
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-head h3 { font-size: 18px; }

form { display: flex; flex-direction: column; gap: 13px; }

.field { display: flex; flex-direction: column; gap: 5px; }

.field > span { font-size: 13px; color: var(--muted); font-weight: 500; }
.field > span i { color: var(--danger); font-style: normal; }

.field input, .field textarea, .field select {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border 0.15s, box-shadow 0.15s;
  width: 100%;
}

.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.field textarea { resize: vertical; }

.hint { font-size: 12px; color: #94a3b8; }

.code-area {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color: var(--text);
  background: var(--bg);
  width: 100%;
  resize: vertical;
  outline: none;
  line-height: 1.5;
  margin: 8px 0 4px;
}

.code-area:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

/* 设置项目周期弹窗 */
.chain-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 46vh;
  overflow-y: auto;
  padding-right: 2px;
}

.chain-row {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fafbfc;
}

.chain-row.anchor {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.chain-order {
  width: 18px;
  flex: none;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.chain-name {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 9px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  background: #fff;
  color: var(--text);
}

.chain-name:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.chain-offset-wrap {
  flex: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

.chain-offset-wrap .sign {
  font-size: 13px;
  color: var(--muted);
}

.chain-offset {
  width: 44px;
  flex: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 4px;
  font-size: 13px;
  font-family: inherit;
  text-align: center;
  outline: none;
  background: #fff;
  color: var(--text);
}

.chain-offset:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.chain-offset[readonly] {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
  cursor: not-allowed;
}

.chain-offset:disabled {
  background: #f1f5f9;
  color: var(--muted);
  cursor: not-allowed;
}

.chain-comp {
  display: flex;
  align-items: center;
  gap: 2px;
}

.comp-label {
  font-size: 11px;
  color: var(--muted);
}

.chain-unit {
  flex: none;
  width: 52px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 4px;
  font-size: 12px;
  font-family: inherit;
  text-align: center;
  outline: none;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

.chain-unit:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.chain-unit:disabled {
  background: #f1f5f9;
  color: var(--muted);
  cursor: not-allowed;
}

.chain-preview {
  flex: none;
  width: 96px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.anchor-badge {
  flex: none;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  background: var(--primary);
  border-radius: 20px;
  padding: 1px 7px;
}

.chain-anchor-btn {
  flex: none;
  border: none;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 11px;
  border-radius: 8px;
  padding: 3px 8px;
  cursor: pointer;
  white-space: nowrap;
}

.chain-anchor-btn:active { opacity: 0.7; }

.chain-del-btn {
  flex: none;
  border: none;
  background: var(--danger-soft);
  color: var(--danger);
  width: 24px;
  height: 24px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chain-del-btn:active { opacity: 0.7; }

.chain-lock-btn {
  flex: none;
  border: none;
  background: transparent;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  padding: 2px;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chain-lock-btn:hover { background: var(--bg); }
.chain-lock-btn:active { opacity: 0.7; }

.chain-insert-btn {
  flex: none;
  border: none;
  background: var(--ok-soft);
  color: var(--ok);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chain-insert-btn:hover { background: #d1fae5; }
.chain-insert-btn:active { opacity: 0.7; }

.chain-row.locked {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.chain-row.locked .chain-name {
  color: var(--muted);
}

.chain-row.locked .chain-preview {
  color: var(--primary);
  font-weight: 600;
}

.chain-offset:disabled {
  background: #f1f5f9;
  color: var(--muted);
  cursor: not-allowed;
}

.chain-add-wrap {
  display: flex;
  justify-content: center;
  padding: 2px 0;
}

.chain-add-wrap .btn {
  width: 100%;
  border: 1px dashed var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

/* 添加项目链路节点配置 */
.chain-config-box {
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.proj-chain-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 32vh;
  overflow-y: auto;
}

.proj-chain-row {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 8px;
  background: #fff;
}

.proj-chain-name {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
}

.proj-chain-name:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.proj-chain-del {
  flex: none;
  border: none;
  background: var(--danger-soft);
  color: var(--danger);
  width: 24px;
  height: 24px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 分享项目弹窗 */
.share-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 34vh;
  overflow-y: auto;
  padding: 2px;
}

.share-proj-item {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
  cursor: pointer;
  background: #fff;
  font-size: 14px;
}

.share-proj-item:hover { border-color: var(--primary); }

.share-proj-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  flex: none;
}

.chain-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 2px;
  font-size: 12px;
  color: var(--muted);
}

.chain-head .spacer { flex: 1; }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.spacer { flex: 1; }

.btn {
  border: none;
  border-radius: 10px;
  padding: 11px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn:active { opacity: 0.75; }

.btn.primary { background: var(--primary); color: #fff; }
.btn.ghost { background: var(--bg); color: var(--text); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }

.icon-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 100px;
  transform: translateX(-50%) translateY(20px);
  background: #0f172a;
  color: #fff;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 10px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s;
  z-index: 99;
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.foot {
  text-align: center;
  color: #94a3b8;
  font-size: 12px;
  padding: 6px 0 20px;
}

/* 密码门 */
.lock-mask {
  position: fixed;
  inset: 0;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.lock-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 36px 28px;
  width: 100%;
  max-width: 380px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.lock-icon { font-size: 44px; line-height: 1; }

.lock-card h2 { font-size: 18px; }

.lock-sub { font-size: 14px; color: var(--muted); margin-top: -6px; }

.lock-card input {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 16px;
  text-align: center;
  outline: none;
  width: 100%;
  font-family: inherit;
  transition: border 0.15s, box-shadow 0.15s;
}

.lock-card input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.lock-btn { width: 100%; padding: 12px; font-size: 16px; }

.lock-err { font-size: 13px; color: var(--danger); min-height: 18px; }
