/* ============================================================
   刀模下载页专用样式（class 统一以 dm- 前缀）
   布局：左参数表单 + 右实时预览（引擎 dieline-engine.js 驱动）
   ============================================================ */

/* ---------- 顶部标题区 ---------- */
.dm-hero {
  background: linear-gradient(180deg, var(--c-ink) 0%, var(--c-ink-deep) 100%);
  padding: 36px 0 30px;
  color: #fff;
}

.dm-hero-inner {
  text-align: center;
}

.dm-hero-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.dm-hero-desc {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
}

/* ---------- 两栏布局 ---------- */
.dm-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 20px;
  margin-top: 28px;
  align-items: start;
}

/* ---------- 参数表单 ---------- */
.dm-form {
  margin-top: 0;
}

.dm-field {
  margin-bottom: 16px;
}

.dm-field:last-child {
  margin-bottom: 0;
}

.dm-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--c-ink);
  margin-bottom: 6px;
}

/* 参数副提示（引擎 hint） */
.dm-hint {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--c-muted);
  margin-top: 2px;
}

/* 盒型/配件下拉 */
.dm-select {
  width: 100%;
  height: 44px;
}

/* 模板说明 */
.dm-note {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.6;
}

/* 数字输入 */
#dm-params .input {
  width: 100%;
  height: 42px;
}

/* 导出按钮组 */
.dm-export-row {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.dm-export {
  flex: 1;
}

/* 提交按钮 */
.dm-submit {
  margin-top: 22px;
  height: 50px;
  font-size: 16px;
}

.dm-tip {
  margin-top: 12px;
  text-align: center;
}

/* ---------- 实时预览 ---------- */
.dm-preview-card {
  min-height: 460px;
  display: flex;
  flex-direction: column;
}

.dm-preview {
  flex: 1;
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  background:
    linear-gradient(45deg, rgba(15, 23, 42, 0.03) 25%, transparent 25%, transparent 75%, rgba(15, 23, 42, 0.03) 75%),
    linear-gradient(45deg, rgba(15, 23, 42, 0.03) 25%, transparent 25%, transparent 75%, rgba(15, 23, 42, 0.03) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 8px 8px;
  border-radius: var(--r-sm, 8px);
  padding: 12px;
}

.dm-preview svg {
  max-width: 100%;
  height: auto;
}

.dm-preview-placeholder {
  color: var(--c-muted);
  font-size: 14px;
}

.dm-preview-error {
  color: #c2410c;
}

.dm-meta {
  margin-top: 12px;
  font-size: 12px;
  text-align: center;
}

/* ---------- 图例 ---------- */
.dm-legend {
  margin-top: 22px;
}

.dm-legend-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--c-ink);
  margin-bottom: 14px;
}

.dm-legend-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dm-legend-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--c-text-sub);
}

.dm-legend-list strong {
  color: var(--c-ink);
  font-weight: 600;
}

/* 线型示意：实线 = 剪切，虚线 = 折痕 */
.dm-line {
  display: inline-block;
  width: 56px;
  height: 0;
  border-top: 2px solid var(--c-ink);
  flex-shrink: 0;
}

.dm-line-cut {
  border-top-style: solid;
  border-top-color: var(--c-ink);
}

.dm-line-fold {
  border-top-style: dashed;
  border-top-color: var(--c-orange);
}

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .dm-layout {
    grid-template-columns: 1fr;
  }
  .dm-preview-card {
    min-height: 320px;
  }
}

@media (max-width: 600px) {
  .dm-hero-title {
    font-size: 22px;
  }
}
