/* ===================================================================
   图片交互原型工具 — 样式
   =================================================================== */

:root {
  --bg: #0f1115;
  --bg-2: #161920;
  --bg-3: #1d212a;
  --panel: #14171e;
  --line: #262b36;
  --line-2: #333947;
  --text: #e6e9ef;
  --text-2: #9aa3b2;
  --text-3: #6b7383;
  --accent: #4f7cff;
  --accent-2: #6f95ff;
  --accent-dim: rgba(79, 124, 255, .16);
  --danger: #ff5f57;
  --ok: #35c07f;
  --warn: #f0b429;
  --radius: 10px;
  --topbar-h: 52px;
  --shadow: 0 8px 30px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.hidden { display: none !important; }
.muted { color: var(--text-2); }
.small { font-size: 12px; }

/* ---------- 通用控件 ---------- */
.btn {
  appearance: none;
  border: 1px solid var(--line-2);
  background: var(--bg-3);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: background .12s, border-color .12s, opacity .12s;
  white-space: nowrap;
}
.btn:hover { background: #262b36; border-color: #414859; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: rgba(255,255,255,.07); color: var(--text); }
.btn-danger { color: #ff8b85; border-color: #4a2b2b; background: #241a1a; }
.btn-danger:hover { background: #33201f; border-color: #6b3a38; }
.btn-sm { padding: 4px 9px; font-size: 12px; }
.btn-lg { padding: 10px 20px; font-size: 15px; }
.btn-block { width: 100%; }

input[type=text], input.title-input, select, textarea {
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 7px 9px;
  width: 100%;
  outline: none;
}
input[type=text]:focus, select:focus { border-color: var(--accent); }
select { cursor: pointer; }

.badge {
  background: var(--bg-3);
  border: 1px solid var(--line);
  color: var(--text-2);
  border-radius: 20px;
  padding: 1px 8px;
  font-size: 11px;
}

/* ---------- 顶部栏 ---------- */
#topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 30;
}
.tb-left, .tb-right { display: flex; align-items: center; gap: 10px; }
.tb-left { min-width: 0; flex: 1; }
.tb-right { justify-content: flex-end; flex: 1; }
.tb-center { flex: 0 0 auto; }
.logo { display: flex; align-items: center; gap: 7px; cursor: pointer; user-select: none; }
.logo-mark { color: var(--accent); font-size: 17px; }
.logo-text { font-weight: 600; letter-spacing: .3px; }
.tb-sep { color: var(--text-3); }
#project-title-wrap { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.title-input {
  background: transparent;
  border: 1px solid transparent;
  padding: 4px 8px;
  max-width: 320px;
  font-size: 14px;
}
.title-input:hover { border-color: var(--line); }
.title-input:focus { background: var(--bg-3); border-color: var(--accent); }

.tabs { display: flex; background: var(--bg-3); border-radius: 9px; padding: 3px; gap: 2px; }
.tab {
  border: none; background: transparent; color: var(--text-2);
  padding: 5px 16px; border-radius: 7px; cursor: pointer;
  font-size: 13px; font-family: inherit;
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--accent); color: #fff; }

.save-state { font-size: 12px; color: var(--text-3); min-width: 52px; text-align: right; }

/* ---------- 视图布局 ---------- */
.view { height: calc(100vh - var(--topbar-h)); }
#view-editor { display: flex; }

/* ---------- 首页 ---------- */
#view-home { overflow-y: auto; }
.home-wrap { max-width: 1080px; margin: 0 auto; padding: 48px 24px 80px; }
.home-hero { text-align: center; padding: 24px 0 44px; }
.home-hero h1 { font-size: 30px; margin: 0 0 10px; letter-spacing: -.3px; }
.home-hero p { color: var(--text-2); margin: 0 0 26px; font-size: 15px; }
.home-actions { display: flex; gap: 12px; justify-content: center; }
.home-list-head { display: flex; align-items: baseline; gap: 10px; border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 18px; }
.home-list-head h2 { font-size: 15px; margin: 0; font-weight: 600; }

.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(224px, 1fr)); gap: 16px; }
.project-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color .14s, transform .14s;
}
.project-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.pc-thumb {
  height: 132px; background: var(--bg-2);
  display: flex; align-items: center; justify-content: center;
  border-bottom: 1px solid var(--line); overflow: hidden;
}
.pc-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pc-thumb .ph { color: var(--text-3); font-size: 26px; }
.pc-body { padding: 11px 12px; }
.pc-name { font-weight: 600; margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-meta { display: flex; justify-content: space-between; align-items: center; }
.pc-actions { display: flex; gap: 4px; opacity: 0; transition: opacity .14s; }
.project-card:hover .pc-actions { opacity: 1; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-2); }
.empty-icon { font-size: 40px; color: var(--text-3); margin-bottom: 12px; }

/* ---------- 面板 ---------- */
.panel {
  background: var(--panel);
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
}
.panel-left { width: 232px; border-right: 1px solid var(--line); }
.panel-right { width: 286px; border-left: 1px solid var(--line); }
.panel-head {
  height: 40px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px; border-bottom: 1px solid var(--line);
}
.panel-title { font-size: 12px; font-weight: 600; letter-spacing: .8px; color: var(--text-2); text-transform: uppercase; }
.panel-actions { padding: 10px; border-bottom: 1px solid var(--line); }
.panel-foot { padding: 9px 12px; border-top: 1px solid var(--line); line-height: 1.6; }
.panel-empty { padding: 34px 16px; text-align: center; color: var(--text-3); font-size: 12px; line-height: 1.9; }

/* ---------- 页面列表 ---------- */
.page-list { flex: 1; overflow-y: auto; padding: 8px; }
.page-item {
  display: flex; gap: 9px; align-items: center;
  padding: 7px; border-radius: 8px; cursor: pointer;
  border: 1px solid transparent; margin-bottom: 4px;
  position: relative;
}
.page-item:hover { background: var(--bg-2); }
.page-item.active { background: var(--accent-dim); border-color: var(--accent); }
.page-item.drag-over-top { box-shadow: 0 -2px 0 var(--accent); }
.page-item.drag-over-bottom { box-shadow: 0 2px 0 var(--accent); }
.page-item.dragging { opacity: .4; }
.pi-thumb {
  width: 38px; height: 52px; flex: 0 0 auto;
  background: var(--bg-3); border: 1px solid var(--line);
  border-radius: 5px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.pi-thumb img { max-width: 100%; max-height: 100%; object-fit: cover; }
.pi-info { min-width: 0; flex: 1; }
.pi-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pi-sub { font-size: 11px; color: var(--text-3); }
.pi-star { color: var(--warn); font-size: 12px; }
.pi-menu { opacity: 0; color: var(--text-3); padding: 2px 4px; border-radius: 4px; }
.page-item:hover .pi-menu { opacity: 1; }
.pi-menu:hover { background: var(--bg-3); color: var(--text); }

/* ---------- 画布 ---------- */
.stage-wrap { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; background: var(--bg); }
.stage-toolbar {
  height: 40px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 14px; border-bottom: 1px solid var(--line); background: var(--bg-2);
  white-space: nowrap; overflow: hidden;
}
.st-left, .st-right { display: flex; align-items: center; gap: 10px; }
.st-left { min-width: 0; flex: 1 1 auto; }      /* 允许被压缩，让长文件名省略而不是换行 */
.st-right { flex: 0 0 auto; }
.stage-page-name {
  font-weight: 600; font-size: 13px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#stage-page-size { flex: 0 0 auto; }
.hint { color: var(--text-3); font-size: 12px; flex: 0 0 auto; }
/* 空间不够时优先牺牲提示文字，保证缩放控件和页面名可见 */
@media (max-width: 1280px) { .hint { display: none; } }

/* margin:auto 在两个方向上居中，且内容超出时不会像 align-items:center 那样裁掉顶部 */
.stage-scroll {
  flex: 1; overflow: auto; padding: 28px;
  display: flex;
}
.stage-row {
  display: flex; align-items: center; gap: 8px;
  margin: auto; flex: 0 0 auto;
}
/* 尺寸由 JS 按图片比例算好写在 style 上：默认缩放到一屏内 */
.canvas {
  position: relative;
  flex: 0 0 auto;
  line-height: 0;
  box-shadow: var(--shadow);
  border-radius: 4px;
  overflow: hidden;
  cursor: crosshair;
  user-select: none;
  background: #fff;
}
.canvas img { display: block; width: 100%; height: 100%; }

/* ---------- 并排的跳转目标预览 ---------- */
.link-preview { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.lp-arrow {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  flex: 0 0 auto; width: 76px;
}
.lp-arrow-line {
  width: 100%; height: 2px; background: var(--accent); position: relative;
}
.lp-arrow-line::after {
  content: ''; position: absolute; right: -1px; top: -4px;
  border-left: 9px solid var(--accent);
  border-top: 5px solid transparent; border-bottom: 5px solid transparent;
}
.lp-arrow-text {
  font-size: 11px; color: var(--accent-2); white-space: nowrap;
  max-width: 76px; overflow: hidden; text-overflow: ellipsis;
}
/* 宽度由 JS 设成与预览图一致，否则文字会把整行撑宽、算出来的布局就装不下了 */
.lp-body { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 0 0 auto; min-width: 0; }
.lp-frame {
  line-height: 0; border-radius: 4px; overflow: hidden;
  background: #fff; cursor: pointer;
  box-shadow: 0 6px 22px rgba(0, 0, 0, .4);
  border: 2px solid transparent;
  transition: border-color .14s;
}
.lp-frame:hover { border-color: var(--accent); }
.lp-frame img { display: block; width: 100%; height: 100%; }
.lp-name {
  font-size: 11px; color: var(--text-2); text-align: center;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lp-hint {
  font-size: 10px; color: var(--text-3);
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.zoom-ctl { display: flex; gap: 2px; align-items: center; }
.zoom-ctl .btn { padding: 3px 8px; }
.zoom-level { min-width: 74px; font-variant-numeric: tabular-nums; }
.hotspot-layer { position: absolute; inset: 0; }

.hotspot {
  position: absolute;
  background: rgba(79, 124, 255, .18);
  border: 1.5px solid var(--accent);
  border-radius: 3px;
  cursor: move;
  transition: background .1s;
}
.hotspot:hover { background: rgba(79, 124, 255, .3); }
.hotspot.selected { background: rgba(79, 124, 255, .28); border-color: #fff; box-shadow: 0 0 0 1px var(--accent); }
.hotspot.no-target { background: rgba(240, 180, 41, .18); border-color: var(--warn); border-style: dashed; }
.hotspot-label {
  position: absolute; top: -19px; left: -1.5px;
  background: var(--accent); color: #fff;
  font-size: 10px; line-height: 1; padding: 3px 5px;
  border-radius: 3px; white-space: nowrap; pointer-events: none;
  max-width: 180px; overflow: hidden; text-overflow: ellipsis;
}
.hotspot.no-target .hotspot-label { background: var(--warn); color: #2a1f05; }
.handle {
  position: absolute; width: 9px; height: 9px;
  background: #fff; border: 1px solid var(--accent); border-radius: 2px;
}
.handle[data-h=nw] { left: -5px; top: -5px; cursor: nwse-resize; }
.handle[data-h=n]  { left: calc(50% - 4.5px); top: -5px; cursor: ns-resize; }
.handle[data-h=ne] { right: -5px; top: -5px; cursor: nesw-resize; }
.handle[data-h=e]  { right: -5px; top: calc(50% - 4.5px); cursor: ew-resize; }
.handle[data-h=se] { right: -5px; bottom: -5px; cursor: nwse-resize; }
.handle[data-h=s]  { left: calc(50% - 4.5px); bottom: -5px; cursor: ns-resize; }
.handle[data-h=sw] { left: -5px; bottom: -5px; cursor: nesw-resize; }
.handle[data-h=w]  { left: -5px; top: calc(50% - 4.5px); cursor: ew-resize; }

.draft-rect {
  position: absolute;
  background: rgba(79, 124, 255, .25);
  border: 1.5px dashed var(--accent);
  pointer-events: none;
  border-radius: 3px;
}
.stage-empty { text-align: center; color: var(--text-2); padding: 90px 20px; margin: auto; }
.stage-empty p { margin: 0 0 18px; }

.drop-hint {
  position: absolute; inset: 40px 0 0 0;
  background: rgba(79, 124, 255, .12);
  border: 2px dashed var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--accent-2); pointer-events: none; z-index: 5;
}

/* ---------- 属性面板 ---------- */
.inspector { flex: 1; overflow-y: auto; padding: 14px; }
.insp-empty { color: var(--text-3); font-size: 12px; line-height: 2; padding-top: 8px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 11px; color: var(--text-2); margin-bottom: 5px; letter-spacing: .4px; }
.field-row { display: flex; gap: 8px; }
.insp-section-title {
  font-size: 11px; font-weight: 600; letter-spacing: .8px; color: var(--text-3);
  text-transform: uppercase; margin: 4px 0 12px; padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.insp-note {
  background: rgba(240, 180, 41, .1); border: 1px solid rgba(240, 180, 41, .3);
  color: #f5cd6b; border-radius: 7px; padding: 8px 10px; font-size: 12px; margin-bottom: 14px;
}
/* ---------- 跳转目标选择器（带缩略图） ---------- */
.target-trigger {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-3); border: 1px solid var(--line-2);
  border-radius: 8px; padding: 6px 8px; cursor: pointer;
  outline: none;
}
.target-trigger:hover { border-color: #414859; }
.target-trigger:focus { border-color: var(--accent); }
.target-trigger.empty .tt-name { color: var(--warn); }
.tt-thumb {
  width: 26px; height: 36px; flex: 0 0 auto;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 4px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.tt-thumb img { max-width: 100%; max-height: 100%; object-fit: cover; }
.tt-name {
  flex: 1; min-width: 0; font-size: 13px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tt-caret { color: var(--text-3); font-size: 10px; flex: 0 0 auto; }
.thumb-none { color: var(--text-3); font-size: 12px; }

/* 网格排布，缩略图尽量大——页面名往往是一串相似的文件名，只能靠画面认 */
.target-menu {
  position: fixed; z-index: 400;
  background: var(--bg-3); border: 1px solid var(--line-2);
  border-radius: 12px; box-shadow: var(--shadow);
  padding: 12px; overflow-y: auto;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px; align-content: start;
}
.target-item {
  display: flex; flex-direction: column; gap: 7px;
  padding: 8px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--line);
  background: var(--bg-2);
}
.target-item:hover { border-color: var(--accent); background: #1b1f28; }
.target-item.active { background: var(--accent-dim); border-color: var(--accent); }
.ti-thumb {
  position: relative;
  width: 100%; height: 176px;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 6px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.ti-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.ti-check {
  position: absolute; top: 5px; right: 5px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent); color: #fff;
  font-size: 12px; line-height: 20px; text-align: center;
}
.ti-text { min-width: 0; }
.ti-name {
  font-size: 11px; line-height: 1.4; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; word-break: break-all;
}
.ti-sub { font-size: 10px; color: var(--text-3); margin-top: 3px; }

.hs-list-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 9px; border-radius: 7px; cursor: pointer;
  border: 1px solid var(--line); margin-bottom: 5px; background: var(--bg-2);
  font-size: 12px;
}
.hs-list-item:hover { border-color: var(--line-2); }
.hs-list-item.active { border-color: var(--accent); background: var(--accent-dim); }
.hs-arrow { color: var(--text-3); flex: 0 0 auto; }
.hs-label { flex: 0 0 auto; max-width: 74px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hs-thumb {
  width: 20px; height: 28px; flex: 0 0 auto;
  background: var(--bg-3); border: 1px solid var(--line);
  border-radius: 3px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.hs-thumb img { max-width: 100%; max-height: 100%; object-fit: cover; }
.hs-thumb .thumb-none { font-size: 10px; }
.hs-target { flex: 1; min-width: 0; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hs-target.none { color: var(--warn); }

/* ---------- 流程视图 ---------- */
#view-flow { display: flex; flex-direction: column; background: var(--bg); }
.flow-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 16px; border-bottom: 1px solid var(--line); background: var(--bg-2);
  gap: 16px; flex-wrap: wrap;
}
.flow-legend { display: flex; gap: 16px; font-size: 12px; color: var(--text-2); }
.lg-start { color: var(--warn); }
.lg-ok { color: var(--accent); }
.lg-bad { color: var(--warn); }
.lg-orphan { color: var(--text-3); }
.flow-issues { display: flex; gap: 8px; flex-wrap: wrap; }
.issue-chip {
  background: rgba(240, 180, 41, .12); border: 1px solid rgba(240, 180, 41, .35);
  color: #f5cd6b; border-radius: 20px; padding: 3px 11px; font-size: 12px; cursor: pointer;
}
.issue-chip.ok { background: rgba(53, 192, 127, .1); border-color: rgba(53, 192, 127, .3); color: #6fd6a5; cursor: default; }
.issue-chip:hover { filter: brightness(1.15); }

.flow-canvas { flex: 1; overflow: auto; position: relative; padding: 40px; }
.flow-inner { position: relative; margin: 0 auto; }
.flow-svg { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.flow-node {
  position: absolute;
  width: 150px;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: 9px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color .14s, transform .14s;
}
.flow-node:hover { border-color: var(--accent); transform: translateY(-2px); }
.flow-node.is-start { border-color: var(--warn); }
.flow-node.is-orphan { opacity: .62; border-style: dashed; }
.fn-thumb { height: 108px; background: var(--bg-2); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.fn-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.fn-name {
  padding: 7px 9px; font-size: 12px; border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.flow-empty { text-align: center; color: var(--text-2); padding: 100px 20px; }

/* ---------- 预览 ---------- */
.preview-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: #07080b;
  display: flex; flex-direction: column;
}
.pv-bar {
  height: 46px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px; background: rgba(20, 23, 30, .92); border-bottom: 1px solid var(--line);
}
.pv-left, .pv-right { display: flex; align-items: center; gap: 6px; flex: 1; }
.pv-right { justify-content: flex-end; }
.pv-center { font-size: 13px; color: var(--text-2); }
.pv-toggle { font-size: 12px; color: var(--text-2); display: flex; align-items: center; gap: 5px; cursor: pointer; margin-right: 6px; }
.pv-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 20px; }
/* 尺寸由 JS 按图片比例算好后写在 style 上，保证点击区域百分比与图片完全对齐 */
.pv-frame {
  position: relative; line-height: 0;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
  border-radius: 6px; overflow: hidden; background: #fff;
}
.pv-frame img { display: block; width: 100%; height: 100%; }
.pv-hotspots { position: absolute; inset: 0; }
.pv-hot {
  position: absolute; cursor: pointer; border-radius: 3px;
  background: transparent; border: 1.5px solid transparent;
  transition: background .18s, border-color .18s;
}
.pv-hot:active { background: rgba(79,124,255,.28); }
.pv-hotspots.reveal .pv-hot,
.pv-hot.flash { background: rgba(79,124,255,.3); border-color: var(--accent); }
.pv-tip {
  text-align: center; color: var(--text-3); font-size: 12px;
  padding: 0 0 16px; transition: opacity .3s;
}
.pv-frame.switching img { animation: pvIn .18s ease-out; }
@keyframes pvIn { from { opacity: .25; } to { opacity: 1; } }

/* ---------- 弹窗 / Toast ---------- */
.modal {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center;
}
.modal-card {
  background: var(--panel); border: 1px solid var(--line-2);
  border-radius: 14px; width: 560px; max-width: calc(100vw - 40px);
  box-shadow: var(--shadow); overflow: hidden;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.modal-head h3 { margin: 0; font-size: 15px; }
.modal-body { padding: 16px; }
.share-option {
  display: flex; align-items: center; gap: 16px;
  padding: 14px; border: 1px solid var(--line); border-radius: 10px;
  margin-bottom: 12px; background: var(--bg-2);
}
.so-text { flex: 1; }
.so-text p { margin: 5px 0 0; line-height: 1.6; }
.share-status { min-height: 18px; }

.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: var(--bg-3); border: 1px solid var(--line-2);
  padding: 10px 18px; border-radius: 10px; z-index: 300;
  box-shadow: var(--shadow); font-size: 13px;
  animation: toastIn .18s ease-out;
}
.toast.danger { border-color: #6b3a38; color: #ff8b85; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2d3340; border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #3b4354; }

/* ---------- 窄屏 ---------- */
@media (max-width: 900px) {
  .panel-left { width: 180px; }
  .panel-right { width: 240px; }
  .home-hero h1 { font-size: 24px; }
}
