/* 卡片 */
.card {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
  transition: box-shadow .2s;
}
.card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.04); }

.card-title {
  font-weight: 700;
  color: #1e293b;
  font-size: 14px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 8px;
  border-bottom: 1px dashed #cbd5e1;
}

/* 表单 */
label {
  display: block;
  margin-top: 12px;
  margin-bottom: 4px;
  font-weight: 600;
  font-size: 13px;
  color: #475569;
}

input, select, textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
  color: #1e293b;
  transition: all .2s;
  font-family: inherit;
}
input[type="color"] { padding: 2px; height: 36px; cursor: pointer; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
input[type="number"], select { height: 36px; }
select { cursor: pointer; }
textarea { height: 160px; resize: vertical; line-height: 1.5; }

.tip { margin-top: 8px; font-size: 12px; color: #94a3b8; line-height: 1.5; }

/* 按钮 */
button {
  width: 100%;
  height: 42px;
  border: none;
  border-radius: 8px;
  margin-top: 10px;
  cursor: pointer;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  transition: all .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
button:active { transform: scale(.98); }

.btn-primary { background: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: var(--danger-hover); }
.btn-gray { background: var(--gray); }
.btn-gray:hover { background: var(--gray-hover); }
.btn-success { background: var(--success); }
.btn-success:hover { background: var(--success-hover); }
.btn-outline {
  background: #fff;
  color: #475569;
  border: 1px solid #cbd5e1;
}
.btn-outline:hover { background: #f1f5f9; border-color: #94a3b8; }

.row { display: flex; gap: 12px; }
.row > * { flex: 1; }
.action-row { margin-top: 15px; gap: 8px; }
.action-row button { height: 42px; font-size: 14px; margin-top: 0; }

.color-row { gap: 4px; margin-top: 2px; }
.color-label {
  font-size: 10px;
  text-align: center;
  color: #64748b;
  margin-top: 2px;
}

/* 模板列表 */
.template-btns {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.template-btns button {
  margin-top: 0;
  flex: 1;
  min-width: 0;
  font-size: 12px;
  padding: 0 8px;
  height: 36px;
}

.template-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.template-item {
  display: flex;
  gap: 6px;
}
.template-item .apply {
  flex: 1;
  justify-content: flex-start;
  height: 32px;
  font-size: 13px;
  margin-top: 0;
  min-width: 0;
}
.template-item .apply span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.template-item .del {
  height: 32px;
  width: 32px;
  padding: 0;
  flex: none;
  color: #ef4444;
  margin-top: 0;
}
.template-empty {
  font-size: 12px;
  color: #94a3b8;
  text-align: center;
  padding: 8px 0;
}

/* 公告 */
.notice-board {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-left: 4px solid #ef4444;
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 20px;
  font-size: 13px;
  color: #991b1b;
  line-height: 1.6;
}
.notice-board strong { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; font-size: 14px; }
.notice-content { white-space: pre-wrap; }

/* 信息区 */
.info {
  margin-top: 16px;
  padding: 12px;
  border-radius: 8px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  font-size: 13px;
  color: #1e3a8a;
  line-height: 1.6;
}

/* 版权 */
.copyright {
  margin-top: auto;
  padding-top: 20px;
  text-align: center;
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.6;
  border-top: 1px dashed #e2e8f0;
}
.copyright a { color: var(--primary); text-decoration: none; }
.copyright a:hover { text-decoration: underline; }

/* 弹窗 */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.4);
  backdrop-filter: blur(2px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 0;
  transition: opacity .2s;
}
.modal-overlay.show { display: flex; opacity: 1; }
.modal {
  background: #fff;
  width: 90%;
  max-width: 320px;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,.1);
  transform: translateY(10px);
  transition: transform .2s;
}
.modal-overlay.show .modal { transform: translateY(0); }
.modal h3 { margin: 0 0 16px; font-size: 18px; color: #1e293b; }
.modal-actions { display: flex; gap: 12px; margin-top: 24px; }
.modal-actions button { margin-top: 0; }

/* Toast */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(30,41,59,.95);
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: all .3s;
  z-index: 3000;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== 标签 ===== */
.label {
  width: var(--labelWidth);
  height: var(--labelHeight);
  border: var(--borderWidth) var(--borderStyle) var(--borderColor);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #fff;
  position: relative;
}
.label.shape-square { border-radius: 0; }
.label.shape-circle { border-radius: 50%; }
.label.shape-diamond {
  /* 用 clip-path 保持与栅格一致的占位 */
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  border: none;
  /* 用 inner 边框模拟菱形边框 */
}
.label.shape-diamond .inner-wrap {
  border: var(--borderWidth) var(--borderStyle) var(--borderColor);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}

.inner-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: inherit;
}
.label.shape-circle .inner-wrap { border-radius: 50%; }

.top, .bottom {
  flex: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}
.middle { flex: 1; }

.dept, .machine {
  font-weight: var(--fontWeight);
  font-style: var(--fontStyle);
  font-family: var(--fontFamily);
  font-size: var(--labelFontSize);
  text-align: center;
  white-space: nowrap;
  line-height: 1.1;
}
.dept {
  transform: translateY(var(--deptOffset));
  color: var(--textColorDept);
}
.machine {
  transform: translateY(calc(-1 * var(--machineOffset)));
  color: var(--textColorMachine);
}