/* =====================================================================
 * app.css —— 界面样式（仅作用于工具外壳，不影响纸张内容）
 * ===================================================================== */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", -apple-system, Segoe UI, sans-serif;
  font-size: 13px;
  color: #2c3138;
  background: #eef0f3;
  overflow: hidden;
}
.app { display: flex; height: 100vh; }

/* ---------------- 左侧控制面板 ---------------- */
.panel {
  width: 348px;
  flex: 0 0 348px;
  background: #fbfbfc;
  border-right: 1px solid #dde1e6;
  overflow-y: auto;
  padding-bottom: 24px;
}
.panel-head {
  padding: 14px 16px 12px;
  border-bottom: 1px solid #e6e9ed;
  background: linear-gradient(#fff, #f6f8fa);
}
.panel-head h1 { margin: 0; font-size: 16px; letter-spacing: .5px; }
.panel-head p { margin: 4px 0 0; font-size: 11.5px; color: #8a9199; }

.controls { padding: 4px 14px; }
.grp { border-bottom: 1px dashed #e4e8ec; padding: 10px 0 12px; }
.grp:last-child { border-bottom: none; }
.grp h2 {
  margin: 0 0 8px; font-size: 12px; font-weight: 700; color: #4a9e63;
  letter-spacing: .8px;
}
.row { margin-bottom: 8px; }
.row .lb {
  display: block; font-size: 12px; color: #5b636c; margin-bottom: 3px;
}
.row .lb em { font-style: normal; color: #a5abb2; font-size: 11px; margin-left: 3px; }
.row input[type=text], .row input[type=number], .row select, .row textarea {
  width: 100%; padding: 5px 7px; border: 1px solid #d5dae0; border-radius: 5px;
  font-size: 12.5px; font-family: inherit; background: #fff; color: #2c3138;
  outline: none;
}
.row input:focus, .row select:focus, .row textarea:focus {
  border-color: #4a9e63; box-shadow: 0 0 0 2px rgba(74,158,99,.14);
}
.row textarea { resize: vertical; line-height: 1.6; }
.row.inline { display: flex; align-items: center; gap: 8px; }
.row.inline .lb { margin: 0; flex: 0 0 auto; }
.row.inline select { flex: 1; }
.row.chk { display: flex; align-items: center; gap: 7px; }
.row.chk label { font-size: 12px; color: #3d444c; }
.row.chk input { width: 15px; height: 15px; accent-color: #4a9e63; }
.hint { margin: 3px 0 0; font-size: 11px; color: #9aa1a8; line-height: 1.5; }
.colorwrap { display: flex; gap: 7px; align-items: center; }
.colorwrap input[type=color] {
  width: 34px; height: 26px; padding: 0; border: 1px solid #d5dae0;
  border-radius: 5px; background: #fff; cursor: pointer;
}
.colorwrap input.hex { flex: 1; font-family: ui-monospace, Consolas, monospace; }

/* 练习格序列 */
.grp-stages { background: #f7faf8; padding: 10px; border-radius: 8px; margin-top: 6px; }
.stage-row { display: flex; align-items: center; gap: 5px; margin-bottom: 6px; }
.stage-row .idx {
  width: 18px; height: 18px; flex: 0 0 18px; border-radius: 50%;
  background: #4a9e63; color: #fff; font-size: 11px; line-height: 18px; text-align: center;
}
.stage-row select { flex: 1; padding: 4px 6px; border: 1px solid #d5dae0; border-radius: 5px; font-size: 12px; }
button.mini {
  width: 24px; height: 24px; flex: 0 0 24px; border: 1px solid #d5dae0; background: #fff;
  border-radius: 5px; cursor: pointer; font-size: 12px; color: #5b636c; line-height: 1;
}
button.mini:hover { background: #f0f3f6; }
button.add {
  width: 100%; padding: 6px; border: 1px dashed #b8cdbf; background: #fff; color: #3f8d57;
  border-radius: 5px; cursor: pointer; font-size: 12px;
}
button.add:hover { background: #f2f9f4; }

/* 操作按钮 */
.actions { padding: 12px 14px 4px; display: flex; flex-direction: column; gap: 8px; }
.actions button {
  padding: 9px 12px; border-radius: 6px; border: 1px solid #d5dae0; background: #fff;
  font-size: 13px; cursor: pointer; color: #2c3138; font-family: inherit;
}
.actions button:hover { background: #f4f6f8; border-color: #c4cbd2; }
.actions button.primary {
  background: #4a9e63; border-color: #4a9e63; color: #fff; font-weight: 700;
}
.actions button.primary:hover { background: #429058; }

/* 状态与统计 */
.status { margin: 8px 14px 0; font-size: 12px; color: #6b7280; min-height: 17px; line-height: 1.5; }
.status.ok { color: #2f855a; }
.status.warn { color: #b26a00; }
.status.err { color: #c0392b; }
.stats {
  margin: 8px 14px 0; padding: 10px 12px; background: #fff; border: 1px solid #e6e9ed;
  border-radius: 8px; font-size: 12px; color: #4b5259; line-height: 1.7;
}
.stats b { color: #2c3138; }
.stats .warn { color: #b26a00; margin: 6px 0 0; font-size: 11.5px; line-height: 1.5; }
.tips {
  margin: 12px 14px 0; padding: 9px 11px; background: #fff8e8; border: 1px solid #f0e0bc;
  border-radius: 7px; font-size: 11.5px; color: #8a6d2f; line-height: 1.6;
}

/* ---------------- 右侧预览 ---------------- */
.preview { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.toolbar {
  flex: 0 0 auto; height: 40px; display: flex; align-items: center; gap: 10px;
  padding: 0 16px; background: #fff; border-bottom: 1px solid #dde1e6;
}
.toolbar .tl { font-size: 12px; color: #6b7280; }
.toolbar input[type=range] { width: 200px; accent-color: #4a9e63; }

.pages {
  flex: 1; overflow: auto; padding: 22px 24px 60px;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  --sheet-w: 130mm;
}
.sheet-wrap {
  width: var(--sheet-w);
  background: #fff;
  box-shadow: 0 2px 14px rgba(28,39,52,.16);
  flex: 0 0 auto;
}
.pages.portrait .sheet-wrap { aspect-ratio: 210 / 297; }
.pages.landscape .sheet-wrap { aspect-ratio: 297 / 210; }
.sheet-wrap svg { display: block; width: 100%; height: 100%; }

/* ===== 返回应用列表（导航页）的悬浮按钮 ===== */
.nav-home{
  position:fixed; right:12px; bottom:12px; z-index:40;
  display:flex; align-items:center; gap:4px;
  padding:7px 12px; border-radius:999px;
  background:rgba(255,255,255,.94);
  border:1px solid rgba(0,0,0,.07);
  box-shadow:0 2px 10px rgba(60,40,10,.18);
  font-size:13px; font-weight:600; line-height:1;
  text-decoration:none; color:#4A4237;
  -webkit-tap-highlight-color:transparent;
}
.nav-home:active{ transform:scale(.96); }
@media print{ .nav-home{ display:none !important; } }
