/* 促销价签海报机 · 大气简约风 */
:root {
  --ink: #1a1a1a;
  --sub: #6e6e73;
  --line: #e3e3e6;
  --bg: #f5f5f7;
  --panel: #ffffff;
  --accent: #e60012;
  --radius: 14px;
}

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

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

/* ---------- 头部 ---------- */
.site-header {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 26px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.brand h1 { font-size: 21px; font-weight: 700; letter-spacing: .02em; }
.tagline { color: var(--sub); font-size: 13px; margin-top: 2px; }
.local-badge {
  margin-left: auto;
  font-size: 12px; color: var(--sub);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
  white-space: nowrap;
}

/* ---------- 布局 ---------- */
.workspace {
  max-width: 1180px;
  margin: 22px auto 30px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 20px;
  align-items: start;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.panel-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
}
.panel-head h2 { font-size: 15px; font-weight: 700; }
.panel-head .meta { font-size: 12px; color: var(--sub); }
.spacer { flex: 1; }

/* ---------- 表单 ---------- */
.field { display: block; margin-bottom: 12px; }
.field > span {
  display: block;
  font-size: 13px; font-weight: 600;
  margin-bottom: 6px;
}
.field > span em { font-style: normal; color: var(--sub); font-weight: 400; font-size: 12px; }
.field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  background: #fbfbfc;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(230,0,18,.10);
  background: #fff;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr .72fr; gap: 10px; }

.group-label {
  font-size: 13px; font-weight: 600;
  margin: 18px 0 10px;
}

.template-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tpl-card {
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 8px 8px 7px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.tpl-card canvas { width: 100%; height: auto; display: block; border-radius: 6px; }
.tpl-card span { display: block; font-size: 12.5px; font-weight: 600; margin-top: 7px; color: var(--ink); }
.tpl-card:hover { border-color: #c9c9ce; }
.tpl-card.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(230,0,18,.10);
}

.seg {
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: #f0f0f2;
  border-radius: 10px;
  padding: 3px;
  gap: 3px;
}
.seg button {
  border: 0; background: transparent;
  padding: 8px 0;
  font-size: 13.5px; font-family: inherit;
  border-radius: 8px;
  cursor: pointer;
  color: var(--sub);
  transition: background .15s, color .15s;
}
.seg button.is-active {
  background: #fff; color: var(--ink); font-weight: 700;
  box-shadow: 0 1px 3px rgba(0,0,0,.10);
}

.hint { font-size: 12px; color: var(--sub); margin-top: 10px; line-height: 1.6; }
.hint.center { text-align: center; }

/* ---------- 按钮 ---------- */
.ghost-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px; font-family: inherit;
  cursor: pointer; color: var(--ink);
  transition: border-color .15s, background .15s;
}
.ghost-btn:hover { border-color: #c9c9ce; background: #fafafa; }
.primary-btn {
  border: 0;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 9px 22px;
  font-size: 14px; font-weight: 700; font-family: inherit;
  cursor: pointer;
  transition: opacity .15s, transform .15s;
}
.primary-btn:hover { opacity: .88; }
.primary-btn:active { transform: scale(.97); }
.primary-btn.small { padding: 6px 16px; font-size: 13px; }

/* ---------- 预览 ---------- */
.paper-wrap {
  background: #ececef;
  border-radius: 10px;
  padding: 22px;
  display: flex; justify-content: center;
}
.paper {
  background: #fff;
  box-shadow: 0 4px 24px rgba(0,0,0,.14), 0 1px 4px rgba(0,0,0,.10);
  width: min(100%, 520px);
}
.paper canvas { display: block; width: 100%; height: auto; }

/* ---------- 页脚 ---------- */
.site-footer {
  text-align: center;
  color: var(--sub);
  font-size: 12.5px;
  padding: 6px 20px 30px;
}

/* ---------- 打印 ---------- */
#printArea { display: none; }
@media print {
  body * { visibility: hidden; }
  #printArea { display: block; position: absolute; inset: 0; }
  #printArea img {
    visibility: visible;
    width: 210mm; height: 297mm;
    display: block;
  }
  @page { size: A4; margin: 0; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .workspace { grid-template-columns: 1fr; }
  .header-inner { flex-wrap: wrap; }
  .local-badge { margin-left: 0; }
  .paper-wrap { padding: 12px; }
}
@media (max-width: 480px) {
  .workspace { padding: 0 12px; }
  .field-row { grid-template-columns: 1fr 1fr; }
  .field-unit { grid-column: span 2; }
  .template-grid { grid-template-columns: repeat(3, 1fr); gap: 7px; }
  .brand h1 { font-size: 18px; }
  /* 面板头允许换行，标题/规格/按钮不许被压断字（设计审计修正 2026-11-17） */
  .panel-head { flex-wrap: wrap; }
  .panel-head h2, .panel-head .meta, .panel-head .ghost-btn, .panel-head .primary-btn {
    white-space: nowrap; flex-shrink: 0;
  }
}
