/* 科研图示工坊 · 静态版样式 */
:root {
  --bg: #eef2f8;
  --panel: #ffffff;
  --border: #dfe6f1;
  --border-strong: #c6d2e6;
  --ink: #101a2e;
  --sub: #5f6d88;
  --brand: #2f6fdd;
  --brand-weak: #eef4ff;
  --radius: 12px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16, 26, 46, .04), 0 10px 30px rgba(16, 26, 46, .07);
  font-family: "Noto Sans SC", "Source Han Sans SC", "Microsoft YaHei", "PingFang SC",
    "Hiragino Sans GB", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
#app { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #cdd8e8; border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #b4c3da; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

.topbar {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 9px 14px; background: #fff; border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(16,26,46,.02);
}
.brand { display: flex; align-items: center; gap: 10px; margin-right: 6px; }
.logo {
  width: 34px; height: 34px; border-radius: 11px; color: #fff; font-weight: 700; font-size: 15px;
  display: flex; align-items: center; justify-content: center; letter-spacing: 0;
  background: linear-gradient(140deg, #4c88f2, #1d45a1);
  box-shadow: 0 6px 16px rgba(47,111,221,.28);
}
.brand h1 { margin: 0; font-size: 13px; line-height: 1.2; letter-spacing: 0; }
.brand p { margin: 1px 0 0; font-size: 10px; color: var(--sub); letter-spacing: .04em; }
.divider { width: 1px; height: 20px; background: var(--border); }
.spacer { flex: 1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border); background: #fff; color: var(--ink);
  border-radius: var(--radius-sm); padding: 7px 11px; font-size: 12.5px; line-height: 1;
  white-space: nowrap; transition: border-color .15s ease, background .15s ease, color .15s ease, box-shadow .15s ease;
}
.btn:hover { border-color: #b7c7e4; background: var(--brand-weak); color: var(--brand); }
.btn:active { transform: translateY(.5px); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.primary {
  background: linear-gradient(180deg, #3f7ff0, #2f6fdd); border-color: #2f6fdd; color: #fff;
  box-shadow: 0 6px 16px rgba(47,111,221,.24);
}
.btn.primary:hover { color: #fff; filter: brightness(1.06); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--brand-weak); }
.btn.active { background: var(--brand-weak); border-color: #b7c7e4; color: var(--brand); }
.btn.icon { width: 32px; height: 32px; padding: 0; font-size: 14px; }
.btn.sm { padding: 5px 9px; font-size: 11.5px; }
@media(max-width:1520px){#btn-zoom-50,#btn-zoom-100{display:none}}

.workspace { flex: 1; min-height: 0; display: flex; gap: 12px; padding: 12px; }
.panel {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column;
}
.left { width: 288px; }
.right { width: 322px; }
.center { flex: 1; min-width: 0; }

.tabs { display: flex; gap: 3px; padding: 8px; border-bottom: 1px solid var(--border); background: #fbfcfe; }
.tabs button {
  flex: 1; border: 0; background: transparent; color: var(--sub);
  border-radius: 7px; padding: 8px 4px; font-size: 12px; transition: .15s ease;
}
.tabs button:hover { background: #f1f5fc; color: var(--ink); }
.tabs button.active { background: var(--brand-weak); color: var(--brand); font-weight: 600; }
.scroll { overflow: auto; flex: 1; min-height: 0; padding: 12px; }
.section-title { font-size: 12px; font-weight: 600; color: var(--sub); margin: 16px 0 8px; }
.section-title:first-child { margin-top: 0; }

.field {
  width: 100%; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px;
  background: #fff; color: var(--ink); font-size: 13px; outline: none; transition: .15s ease;
}
.field:hover { border-color: var(--border-strong); }
.field:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47,111,221,.13); }
.label { display: block; font-size: 12px; color: var(--sub); margin-bottom: 6px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.row { display: flex; gap: 8px; align-items: center; }

.chip {
  display: inline-flex; align-items: center; padding: 4px 9px; border-radius: 999px;
  background: #f4f7fc; border: 1px solid var(--border); font-size: 11px; color: var(--sub);
  transition: .15s ease;
}
.chip:hover { border-color: var(--border-strong); color: var(--ink); }
.chip.on { background: var(--brand-weak); color: var(--brand); border-color: #b7c7e4; font-weight: 600; }

.tpl-card {
  border: 1px solid var(--border); border-radius: 11px; padding: 8px;
  background: #fff; cursor: pointer; margin-bottom: 10px;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.tpl-card:hover {
  border-color: #9dbaf0; box-shadow: 0 10px 24px rgba(47,111,221,.14); transform: translateY(-1px);
}
.tpl-thumb {
  aspect-ratio: 16 / 9; width: 100%; border-radius: 7px; overflow: hidden;
  background: #f5f8fd; border: 1px solid #e7edf7; line-height: 0;
}
.tpl-thumb svg { width: 100%; height: 100%; display: block; }
.tpl-card h3 { margin: 8px 0 0; font-size: 13px; font-weight: 600; }
.tpl-card p {
  margin: 4px 0 0; font-size: 11px; color: var(--sub); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.empty-hint { font-size: 12px; color: #94a3b8; padding: 20px 8px; text-align: center; }

/* ---- 成套出图 ---- */
.suite-hint {
  margin: 0 0 12px; font-size: 11.5px; color: var(--sub); line-height: 1.65;
  background: #f7faff; border: 1px solid var(--border); border-radius: 10px; padding: 9px 10px;
}
.suite-hint b { color: var(--ink); }
.suite-check {
  display: flex; align-items: center; gap: 6px; margin: 9px 0 2px;
  font-size: 11.5px; color: var(--sub); cursor: pointer;
}
.suite-card {
  border: 1px solid var(--border); border-radius: 12px; padding: 11px;
  background: #fff; margin-bottom: 12px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.suite-card:hover { border-color: #9dbaf0; box-shadow: 0 10px 24px rgba(47,111,221,.13); }
.suite-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.suite-head h3 { margin: 0; font-size: 13.5px; font-weight: 700; }
.suite-count {
  font-size: 10.5px; color: var(--brand); background: var(--brand-weak);
  border: 1px solid #cfe0ff; border-radius: 999px; padding: 2px 8px; white-space: nowrap;
}
.suite-meta { margin: 6px 0 8px; font-size: 11px; color: var(--sub); line-height: 1.55; }
.suite-roles { display: flex; flex-wrap: wrap; gap: 4px; }
.suite-role {
  font-size: 10.5px; color: #4d5c78; background: #f4f7fc;
  border: 1px solid var(--border); border-radius: 6px; padding: 2px 6px;
}
.suite-save {
  margin: 14px 0 4px; padding: 10px; border-radius: 10px;
  border: 1px dashed var(--border-strong); background: #fbfcfe;
}
.suite-save .label { margin-bottom: 6px; }
.suite-save .row { gap: 6px; }
.suite-actions { display: flex; gap: 6px; margin-top: 10px; }
.suite-actions .btn:first-child { flex: 1; }
.suite-card.custom { border-left: 3px solid var(--brand); }

.shape-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.shape-btn {
  aspect-ratio: 1; border: 1px solid var(--border); border-radius: 10px; background: #fff;
  color: var(--sub); font-size: 11px; transition: .15s ease;
}
.shape-btn:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-weak); }

.layer-row {
  display: flex; align-items: center; gap: 6px; padding: 7px 8px; border-radius: 8px;
  cursor: pointer; font-size: 12px;
}
.layer-row:hover { background: #f5f8ff; }
.layer-row.selected { background: var(--brand-weak); color: var(--brand); }
.layer-row .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.canvas-stage {
  flex: 1; min-height: 0; overflow: auto; padding: 26px;
  background:
    radial-gradient(1200px 600px at 50% -10%, #ffffff 0%, transparent 60%),
    linear-gradient(45deg, #e7edf7 25%, transparent 25%),
    linear-gradient(-45deg, #e7edf7 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e7edf7 75%),
    linear-gradient(-45deg, transparent 75%, #e7edf7 75%);
  background-size: 100% 100%, 22px 22px, 22px 22px, 22px 22px, 22px 22px;
  background-position: 0 0, 0 0, 0 11px, 11px -11px, -11px 0;
  background-color: #f1f5fb;
}
.canvas-wrap {
  display: inline-block; margin: 0 auto; line-height: 0;
  box-shadow: 0 22px 60px rgba(16, 26, 46, .18); background: #fff; border-radius: 2px;
}
.text-editor {
  position: absolute; z-index: 20; border: 2px solid var(--brand); outline: none;
  resize: none; background: rgba(255,255,255,.97); padding: 8px 10px; overflow: hidden;
  box-shadow: 0 12px 32px rgba(47,111,221,.22); border-radius: 6px;
}

.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch {
  width: 28px; height: 28px; border-radius: 8px; border: 1px solid rgba(0,0,0,.08); cursor: pointer;
  transition: transform .12s ease;
}
.swatch:hover { transform: scale(1.08); }
.swatch.on { outline: 2px solid #111; outline-offset: 1px; }

.theme-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.theme-card {
  border: 1px solid var(--border); border-radius: 11px; padding: 8px; cursor: pointer; background: #fff;
  transition: .15s ease;
}
.theme-card:hover { border-color: var(--border-strong); }
.theme-card.on { border-color: var(--brand); box-shadow: 0 8px 18px rgba(47,111,221,.16); }
.theme-bars { display: flex; gap: 4px; margin-bottom: 6px; }
.theme-bars i { flex: 1; height: 16px; border-radius: 4px; display: block; }
.theme-card span { font-size: 12px; font-weight: 500; }

.export-card {
  border: 1px solid var(--border); border-radius: 11px; padding: 12px; background: #fbfcfe; margin-bottom: 10px;
}
.export-card h4 { margin: 0 0 4px; font-size: 13px; }
.export-card p { margin: 0 0 10px; font-size: 12px; color: var(--sub); line-height: 1.5; }
.export-card p:last-child { margin-bottom: 0; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(6px);
  background: rgba(16,26,46,.94); color: #fff; padding: 10px 16px; border-radius: 999px;
  font-size: 13px; z-index: 100; opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  box-shadow: 0 14px 34px rgba(16,26,46,.3);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 模板参数面板 ---------- */
.param-box {
  border: 1px dashed var(--border-strong); background: #fbfcfe;
  border-radius: var(--radius-sm); padding: 10px 11px;
}
.param-row { margin-bottom: 10px; }
.param-row:last-of-type { margin-bottom: 6px; }
.param-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.param-head .label { margin-bottom: 2px; }
.param-val { font-size: 12px; font-weight: 700; color: var(--brand); }
.param-box input[type="range"] { width: 100%; margin: 4px 0 0; accent-color: var(--brand); }
.param-check { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--sub); cursor: pointer; }
.param-check input { accent-color: var(--brand); }
.param-hint { font-size: 10.5px; color: #94a3b8; line-height: 1.5; margin: 4px 0 0; }
.param-box .btn { width: 100%; margin-top: 8px; }

@media (max-width: 1200px) {
  .left { width: 248px; }
  .right { width: 288px; }
}
