/* ============================================================================
 * 工作室设计墙外壳样式（与风格无关，六套原型共用）
 * 风格主题色通过 body.ldsb.sty-<key> 的 CSS 变量注入
 * ==========================================================================*/
:root {
  --ld-scale: .66;
  --ld-nav-h: 62px;
  --ld-ins-w: 336px;
  --ld-ink: #17181c;
  --ld-mut: #83868f;
  --ld-line: #e7e5e0;
  --ld-paper: #f4f2ed;
  --ld-accent: #a8432e;
}

* { box-sizing: border-box; }

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

body {
  background: var(--ld-paper);
  color: var(--ld-ink);
  font-family: "Inter", "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.ldsb {
  height: 100%;
  display: grid;
  grid-template-rows: var(--ld-nav-h) 1fr;
  grid-template-columns: 1fr auto;
  grid-template-areas: "nav nav" "main ins";
  opacity: 0;
  transition: opacity .35s ease;
}
.ldsb.ld-ready { opacity: 1; }
.ldsb > .ld-nav { grid-area: nav; }
.ldsb > .ld-main { grid-area: main; }
.ldsb > .ld-inspector { grid-area: ins; }

/* ------------------------------------------------------------------ 顶栏 -- */
.ld-nav {
  display: flex; align-items: center; gap: 22px;
  padding: 0 18px 0 20px;
  background: rgba(255, 255, 255, .72);
  backdrop-filter: blur(18px) saturate(1.6);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  border-bottom: 1px solid var(--ld-line);
  z-index: 40;
}

.ld-brand { display: flex; align-items: center; gap: 10px; flex: none; }
.ld-logo {
  width: 32px; height: 32px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--ld-ink); color: #fff;
  font: 600 15px/1 "Songti SC", "Noto Serif SC", serif;
  letter-spacing: 0;
}
.ld-brand-t { display: flex; flex-direction: column; gap: 1px; line-height: 1.1; }
.ld-brand-t b { font-size: 13.5px; letter-spacing: .02em; }
.ld-brand-t span { font-size: 10.5px; color: var(--ld-mut); letter-spacing: .04em; }

.ld-tabs { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.ld-tabs::-webkit-scrollbar { display: none; }
.ld-tab {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 11px 7px 9px; border-radius: 999px;
  text-decoration: none; color: #4a4d55; white-space: nowrap;
  transition: background .2s ease, color .2s ease, transform .2s ease;
  font-size: 12.5px;
}
.ld-tab i { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.ld-tab b { font-weight: 600; letter-spacing: .03em; }
.ld-tab em { font-style: normal; font-size: 9px; letter-spacing: .12em; color: #a8abb3; text-transform: uppercase; }
.ld-tab:hover { background: rgba(0, 0, 0, .05); transform: translateY(-1px); }
.ld-tab-on { background: var(--ld-ink); color: #fff; }
.ld-tab-on em { color: rgba(255, 255, 255, .55); }
.ld-tab-on:hover { background: var(--ld-ink); transform: none; }

.ld-acts { display: flex; align-items: center; gap: 6px; flex: none; }
.ld-btn {
  font: inherit; font-size: 12px; letter-spacing: .02em;
  padding: 7px 12px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--ld-line); background: #fff; color: #3b3e46;
  text-decoration: none; white-space: nowrap;
  transition: all .18s ease;
}
.ld-btn:hover { border-color: #cfccc4; transform: translateY(-1px); box-shadow: 0 3px 10px rgba(0, 0, 0, .05); }
.ld-btn-on { background: var(--ld-ink); border-color: var(--ld-ink); color: #fff; }

/* ------------------------------------------------------------------ 舞台 -- */
.ld-main { position: relative; overflow: hidden; }

.ld-stage {
  height: 100%;
  display: flex; align-items: center;
  gap: 26px;
  padding: 34px 40px 26px;
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: thin;
  cursor: grab;
}
.ld-stage.ld-grabbing { cursor: grabbing; }
.ld-stage::-webkit-scrollbar { height: 8px; }
.ld-stage::-webkit-scrollbar-thumb { background: #d8d5cc; border-radius: 99px; }
.ld-stage::-webkit-scrollbar-track { background: transparent; }

/* 设计墙的细微网格底 */
.ld-main::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(0, 0, 0, .055) 1px, transparent 0);
  background-size: 22px 22px;
  mask-image: radial-gradient(ellipse at 40% 40%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse at 40% 40%, #000 20%, transparent 78%);
}

.ld-phone-wrap { flex: none; display: flex; flex-direction: column; align-items: center; gap: 12px; }

/* 外框尺寸 = 内容 390×844 + 左右/上下各 11px 边框，避免内容被裁 */
.ld-phone {
  position: relative;
  width: calc((390px + 22px) * var(--ld-scale));
  height: calc((844px + 22px) * var(--ld-scale));
  border-radius: calc(54px * var(--ld-scale));
  background: #0e0f12;
  padding: calc(11px * var(--ld-scale));
  box-shadow:
    0 0 0 calc(1.2px) #2c2e35,
    0 1px 1px rgba(255, 255, 255, .35) inset,
    0 24px 48px -18px rgba(20, 18, 14, .38),
    0 8px 18px -8px rgba(20, 18, 14, .22);
  cursor: zoom-in;
  transition: transform .35s cubic-bezier(.2, .8, .2, 1), box-shadow .35s ease;
}
.ld-phone:hover {
  transform: translateY(-4px) scale(1.012);
  box-shadow:
    0 0 0 calc(1.2px) #2c2e35,
    0 1px 1px rgba(255, 255, 255, .35) inset,
    0 34px 60px -20px rgba(20, 18, 14, .46),
    0 10px 22px -8px rgba(20, 18, 14, .26);
}

.ld-phone-notch {
  position: absolute; top: calc(11px * var(--ld-scale)); left: 50%;
  transform: translateX(-50%);
  width: calc(118px * var(--ld-scale)); height: calc(30px * var(--ld-scale));
  background: #0e0f12; border-radius: 0 0 calc(18px * var(--ld-scale)) calc(18px * var(--ld-scale));
  z-index: 30; pointer-events: none;
}

.ld-viewport {
  position: absolute;
  top: calc(11px * var(--ld-scale));
  left: calc(11px * var(--ld-scale));
  width: calc(390px * var(--ld-scale));
  height: calc(844px * var(--ld-scale));
  border-radius: calc(44px * var(--ld-scale));
  overflow: hidden;
  background: #fff;
  color-scheme: light;
  isolation: isolate;
}
.ld-body { width: 100%; height: 100%; overflow: hidden; }
.ld-body > * {
  width: 390px; height: 844px;
  transform: scale(var(--ld-scale));
  transform-origin: 0 0;
}

/* 屏幕切换动效 */
.ld-body-in > * { animation: ldIn .34s cubic-bezier(.22, .85, .28, 1) both; }
.ld-body-back > * { animation: ldBack .3s cubic-bezier(.22, .85, .28, 1) both; }
@keyframes ldIn { from { opacity: .2; transform: scale(var(--ld-scale)) translateX(16px); } to { opacity: 1; transform: scale(var(--ld-scale)) translateX(0); } }
@keyframes ldBack { from { opacity: .2; transform: scale(var(--ld-scale)) translateX(-16px); } to { opacity: 1; transform: scale(var(--ld-scale)) translateX(0); } }

/* 状态栏（真机时间/信号/电量，压在页面顶部） */
.ld-status {
  position: absolute; top: calc(11px * var(--ld-scale)); left: 0; right: 0;
  height: calc(46px * var(--ld-scale));
  padding: 0 calc(30px * var(--ld-scale)) 0 calc(32px * var(--ld-scale));
  display: flex; align-items: center; justify-content: space-between;
  font: 600 calc(14px * var(--ld-scale)) / 1 "SF Pro Text", "Inter", system-ui, sans-serif;
  letter-spacing: .01em;
  z-index: 25; pointer-events: none;
  color: var(--ld-status-ink, #111);
  padding-top: calc(6px * var(--ld-scale));
}
.ld-status-t { padding-top: calc(4px * var(--ld-scale)); }
.ld-status-r { display: flex; align-items: center; gap: calc(5px * var(--ld-scale)); padding-top: calc(4px * var(--ld-scale)); }
.ld-status-r svg { height: calc(11px * var(--ld-scale)); width: auto; }

.ld-homebar { position: absolute; bottom: calc(18px * var(--ld-scale)); left: 0; right: 0; display: grid; place-items: center; z-index: 26; pointer-events: none; }
.ld-homebar i {
  display: block; width: calc(134px * var(--ld-scale)); height: calc(5px * var(--ld-scale));
  border-radius: 99px; background: var(--ld-homebar-ink, #10121a); opacity: .82;
}

/* Toast */
.ld-toast {
  position: absolute; left: 50%; bottom: calc(120px * var(--ld-scale));
  transform: translate(-50%, 12px);
  padding: calc(11px * var(--ld-scale)) calc(20px * var(--ld-scale));
  border-radius: calc(14px * var(--ld-scale));
  background: rgba(20, 22, 28, .9); color: #fff;
  font-size: calc(14px * var(--ld-scale)); letter-spacing: .02em;
  max-width: 78%;
  opacity: 0; pointer-events: none;
  transition: opacity .22s ease, transform .22s cubic-bezier(.2, .9, .3, 1);
  z-index: 40; text-align: center; line-height: 1.4;
  backdrop-filter: blur(8px);
}
.ld-toast-on { opacity: 1; transform: translate(-50%, 0); }
.ld-toast-err { background: rgba(190, 46, 46, .94); }
.ld-toast-ok { background: rgba(24, 122, 74, .94); }

.ld-caption { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: #6d7079; letter-spacing: .02em; }
.ld-cap-i { font: 600 10px/1 "Inter", monospace; letter-spacing: .06em; color: var(--ld-accent); background: rgba(0, 0, 0, .05); padding: 3px 5px; border-radius: 4px; }
.ld-cap-n { font-weight: 600; color: #3a3d45; }
.ld-cap-k { font: 400 9.5px/1 "Inter", monospace; color: #a8abb3; letter-spacing: .06em; }

/* -------------------------------------------------------------- 单屏模式 -- */
.ld-stage-focus { justify-content: center; gap: 0; cursor: default; padding: 22px 30px 18px; }
.ld-focus { position: relative; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.ld-stage-focus .ld-phone { cursor: default; --ld-scale: .9; }
.ld-stage-focus .ld-phone:hover { transform: none; }
.ld-rail { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; max-width: 700px; }
.ld-rail button {
  font: inherit; font-size: 12px; padding: 6px 13px; border-radius: 999px;
  border: 1px solid var(--ld-line); background: #fff; color: #4a4d55; cursor: pointer;
  transition: all .18s ease;
}
.ld-rail button:hover { transform: translateY(-1px); border-color: #cfccc4; }
.ld-rail button.on { background: var(--ld-ink); border-color: var(--ld-ink); color: #fff; }

/* -------------------------------------------------------------- 核对侧栏 -- */
.ld-inspector {
  width: var(--ld-ins-w);
  border-left: 1px solid var(--ld-line);
  background: rgba(255, 255, 255, .6);
  backdrop-filter: blur(10px);
  display: flex; flex-direction: column;
  transition: width .28s ease, opacity .28s ease, border-color .28s ease;
  overflow: hidden;
}
.ld-inspector.ld-off { width: 0; opacity: 0; border-color: transparent; }

.ld-ins-h { padding: 16px 16px 10px; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.ld-ins-h b { font-size: 13px; letter-spacing: .02em; display: block; }
.ld-ins-h span { font-size: 10.5px; color: var(--ld-mut); }
.ld-ins-pct { font: 600 12px/1 "Inter", monospace; letter-spacing: .02em; color: var(--ld-mut); }
.ld-ins-pct b { font-size: 17px; color: var(--ld-accent); }

.ld-ins-bar { height: 3px; margin: 0 16px; border-radius: 99px; background: #e8e5dd; overflow: hidden; }
.ld-ins-bar i { display: block; height: 100%; background: var(--ld-accent); border-radius: 99px; transition: width .5s cubic-bezier(.2, .8, .2, 1); }

.ld-ins-flow { padding: 14px 16px 10px; border-bottom: 1px dashed var(--ld-line); }
.ld-ins-flow > b { font-size: 10px; letter-spacing: .12em; color: var(--ld-mut); font-weight: 600; text-transform: uppercase; }
.ld-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; margin-top: 8px; }
.ld-flow button {
  font: inherit; font-size: 11px; padding: 3px 7px; border-radius: 5px; cursor: pointer;
  border: none; background: rgba(0, 0, 0, .05); color: #4a4d55; transition: all .15s ease;
}
.ld-flow button:hover { background: var(--ld-ink); color: #fff; }
.ld-flow i { font-style: normal; font-size: 9px; color: #bbb; }

.ld-ins-list { flex: 1; overflow-y: auto; padding: 6px 10px 10px; scrollbar-width: thin; }
.ld-ins-list::-webkit-scrollbar { width: 6px; }
.ld-ins-list::-webkit-scrollbar-thumb { background: #dcd9d0; border-radius: 99px; }

.ld-spec-g { margin-top: 8px; }
.ld-spec-h { display: flex; align-items: center; justify-content: space-between; padding: 5px 6px; }
.ld-spec-h b { font-size: 11.5px; letter-spacing: .02em; color: #34373e; }
.ld-spec-h span { font: 500 10px/1 "Inter", monospace; color: var(--ld-mut); }

.ld-spec-row {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 7px 8px; border-radius: 7px; cursor: pointer;
  transition: background .16s ease;
}
.ld-spec-row:hover { background: rgba(0, 0, 0, .04); }
.ld-spec-row > i {
  flex: none; width: 13px; height: 13px; margin-top: 1px; border-radius: 4px;
  border: 1.2px solid #cfccc4; display: grid; place-items: center;
  font-style: normal; font-size: 9px; color: #fff;
  transition: all .2s cubic-bezier(.2, .9, .3, 1);
}
.ld-spec-hit > i { background: #2f8f5b; border-color: #2f8f5b; transform: scale(1.02); }
.ld-spec-row > div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ld-spec-row b { font-size: 11.5px; font-weight: 500; color: #2f323a; letter-spacing: .01em; }
.ld-spec-row span { font-size: 10px; color: #9a9da5; line-height: 1.45; }
.ld-spec-hit b { color: #2f8f5b; }

.ld-ins-foot {
  padding: 10px 16px 14px; border-top: 1px solid var(--ld-line);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.ld-ins-foot span { font-size: 9.5px; color: #a8abb3; letter-spacing: .02em; }
.ld-btn-sm {
  font: inherit; font-size: 11px; padding: 5px 10px; border-radius: 7px; cursor: pointer;
  border: 1px solid var(--ld-line); background: #fff; color: #4a4d55;
}
.ld-btn-sm:hover { border-color: #c9c6bd; }

/* ------------------------------------------------------------- 响应式 ---- */
@media (max-width: 1280px) {
  :root { --ld-scale: .56; --ld-ins-w: 300px; }
  .ld-tab em { display: none; }
}
@media (max-width: 900px) {
  .ld-inspector { display: none; }
  .ld-brand-t span { display: none; }
}
