/* ═══ 方块社 · 二维码工坊 —— 包豪斯三原色风 ═══ */
:root {
  --paper: #f6f4ee;
  --ink: #14120e;
  --red: #e0392b;
  --yellow: #f2b705;
  --blue: #1a5fb4;
  --mono: "Consolas", "Courier New", monospace;
  --sans: "Segoe UI", "Microsoft YaHei", sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  min-height: 100vh;
  padding-bottom: 60px;
  background-image: linear-gradient(var(--ink) 2px, transparent 2px);
  background-size: 100% 2px;
  background-position: 0 0;
  background-repeat: no-repeat;
}

/* ── 包豪斯门头 ── */
.bauhaus-head { display: flex; align-items: center; gap: 20px; padding: 34px 5% 24px; }
.shapes { display: flex; gap: 10px; align-items: center; }
.sq { width: 44px; height: 44px; background: var(--red); }
.ci { width: 44px; height: 44px; border-radius: 50%; background: var(--yellow); }
.tr { width: 0; height: 0; border-left: 22px solid transparent; border-right: 22px solid transparent; border-bottom: 44px solid var(--blue); }
.title-block { flex: 1; }
.title-block h1 { font-size: clamp(34px, 5vw, 54px); font-weight: 900; letter-spacing: 10px; line-height: 1; }
.title-block p { margin-top: 10px; font-family: var(--mono); font-size: 12px; letter-spacing: 2px; color: #5a554a; }
.head-card {
  background: var(--ink); color: var(--paper);
  padding: 12px 22px; text-align: center; min-width: 130px;
}
.head-card b { display: block; font-size: 20px; font-weight: 900; letter-spacing: 3px; }
.head-card i { font-style: normal; font-size: 11px; letter-spacing: 4px; color: var(--yellow); }

/* ── 布局 ── */
.layout { padding: 0 5%; display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.layout .panel:nth-child(1) { grid-row: span 2; }
@media (max-width: 860px) { .layout { grid-template-columns: 1fr; } }

.panel { background: #fff; border: 3px solid var(--ink); padding: 20px; box-shadow: 6px 6px 0 var(--ink); }
.p-title {
  font-size: 15px; font-weight: 900; letter-spacing: 6px;
  border-left: 12px solid var(--red); padding-left: 10px;
  margin-bottom: 16px; display: flex; align-items: center;
}
.panel:nth-child(3) .p-title { border-left-color: var(--blue); }
.panel:nth-child(4) .p-title { border-left-color: var(--yellow); }

/* ── 码型格 ── */
.type-grid { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 20px; }
.type-grid li {
  border: 2px solid var(--ink); cursor: pointer; text-align: center;
  padding: 10px 4px; font-size: 13px; letter-spacing: 2px; user-select: none;
  background: #fff; transition: all .1s;
}
.type-grid li b {
  display: block; font-size: 20px; font-weight: 900; margin-bottom: 2px;
}
.type-grid li:hover { background: var(--paper); }
.type-grid li.on { background: var(--ink); color: #fff; }
.type-grid li.on b { color: var(--yellow); }

/* ── 表单 ── */
.form .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.form label.fl { font-size: 13px; font-weight: 700; letter-spacing: 2px; min-width: 58px; }
.form input[type="text"], .form input[type="tel"], .form input[type="email"], .form input[type="number"], .form select {
  font-family: var(--sans); font-size: 14px;
  border: 2px solid var(--ink); background: #fff; padding: 9px 10px; outline: none; flex: 1; min-width: 120px;
}
.form input:focus { box-shadow: 3px 3px 0 var(--yellow); }
.form textarea {
  font-family: var(--sans); font-size: 14px; width: 100%;
  border: 2px solid var(--ink); padding: 9px 10px; min-height: 90px; resize: vertical; outline: none;
}

/* ── 按钮 ── */
.btn {
  font-family: var(--sans); font-size: 14px; font-weight: 900; letter-spacing: 3px;
  border: 3px solid var(--ink); background: var(--yellow); color: var(--ink);
  padding: 10px 24px; cursor: pointer; box-shadow: 4px 4px 0 var(--ink);
}
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn.big { width: 100%; margin-top: 6px; background: var(--red); color: #fff; font-size: 16px; padding: 13px; }
.btn.dark { background: var(--ink); color: var(--paper); }
.btn.ghost { background: #fff; }

/* ── 成品台 ── */
.qr-stage {
  background: repeating-conic-gradient(#e7e3d8 0 25%, #fff 0 50%) 0 0 / 20px 20px;
  border: 2px solid var(--ink); padding: 14px;
  display: flex; justify-content: center; align-items: center; min-height: 200px;
}
.qr-stage canvas { max-width: 100%; image-rendering: pixelated; }
.stage-note { margin-top: 10px; font-family: var(--mono); font-size: 12px; color: #5a554a; line-height: 1.7; }
.dl-row { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.dl-row .btn { flex: 1; min-width: 110px; }

/* ── 制版选项 ── */
.opt .row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.opt .lab { font-size: 13px; font-weight: 700; letter-spacing: 2px; min-width: 44px; }
.opt label { font-size: 13px; }
input[type="radio"], input[type="checkbox"] { accent-color: var(--red); }
input[type="color"] {
  width: 44px; height: 32px; border: 2px solid var(--ink); background: #fff; padding: 2px; cursor: pointer;
}
.up-label {
  border: 2px solid var(--ink); background: var(--yellow); padding: 6px 14px;
  font-weight: 700; cursor: pointer; font-size: 13px;
}

/* ── 近作 ── */
.history { list-style: none; }
.history li {
  display: flex; gap: 10px; align-items: center;
  border: 2px solid var(--ink); margin-bottom: 8px; padding: 8px 12px; cursor: pointer; background: #fff;
}
.history li:hover { background: var(--paper); }
.history li.empty { cursor: default; color: #5a554a; font-size: 13px; }
.history li .h-ty {
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  background: var(--blue); color: #fff; padding: 2px 8px; white-space: nowrap;
}
.history li .h-tx {
  flex: 1; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.history li .h-tm { font-family: var(--mono); font-size: 11px; color: #5a554a; }

/* ── 底部状态轨 ── */
.rail {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 12px;
  background: var(--ink); color: var(--paper);
  font-family: var(--mono); font-size: 12px; letter-spacing: 1px;
  padding: 10px 5%; z-index: 50;
}
.st-dots { flex: 1; border-bottom: 2px dotted rgba(246,244,238,.3); height: 1px; }
