/* 跨页共享组件 · landing 和工作台都引用 */

/* === BUTTONS === */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: var(--r-md);
  font-size: 14px; font-weight: 600; line-height: 1;
  cursor: pointer; white-space: nowrap;
  transition: opacity 0.12s;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-lg { height: 44px; padding: 0 22px; }
.btn-md { height: 36px; padding: 0 16px; font-size: 13px; }
.btn-sm { height: 32px; padding: 0 14px; font-size: 13px; }
.btn-ink { background: var(--ink); color: #fff; }
.btn-ghost { background: #fff; color: var(--ink); border: 1px solid var(--line-strong); }
.btn-text { background: transparent; color: var(--accent); padding: 0; height: auto; }
.btn-danger { background: #fff; color: var(--red); border: 1px solid rgba(185,28,28,0.32); }

/* === FORM === */
.field { display: grid; gap: 6px; }
.field[hidden] { display: none; }
.field label {
  color: var(--soft); font-size: 12px; font-weight: 600; letter-spacing: 0.02em;
}
.field input, .field select, .field textarea {
  width: 100%; height: 36px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: var(--r-md);
  background: #fff; color: var(--ink); font-size: 13px; outline: none;
}
.field textarea { height: auto; min-height: 64px; padding: 10px 12px; line-height: 1.55; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ink); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
/* 让左右两栏的 label / 快速套用 / 输入框 / 提示 锁到同一组行轨道，输入框就能对齐 */
.field-row > .field {
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 4;
  row-gap: 6px;
}
.field-row {
  grid-template-rows: auto auto auto auto;
  row-gap: 0;
}
.field-row > .field > label { grid-row: 1; align-self: end; }
.field-row > .field > .wb-prompt-quick { grid-row: 2; align-self: end; }
.field-row > .field > input,
.field-row > .field > select,
.field-row > .field > textarea { grid-row: 3; align-self: start; }
.field-row > .field > .wb-platform-hint,
.field-row > .field > .wb-field-hint { grid-row: 4; align-self: start; }
.tag-required {
  display: inline-block;
  padding: 1px 6px; margin-left: 6px;
  border-radius: 3px;
  background: rgba(0, 113, 227, 0.1); color: var(--accent);
  font-size: 10px; font-weight: 700; letter-spacing: 0.04em;
}

/* === MODAL === */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(10, 10, 10, 0.36);
  z-index: 1000;
  display: none;
  align-items: center; justify-content: center;
  padding: 20px;
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.modal-backdrop.open { display: flex; }
.modal {
  width: 100%; max-width: 420px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: 0 24px 60px rgba(10, 10, 10, 0.10);
  overflow: hidden;
}
.modal-head { padding: 22px 24px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 {
  margin: 0 0 4px;
  font-family: var(--serif); font-size: 22px; font-weight: 500;
  letter-spacing: -0.005em;
}
.modal-head p { margin: 0; color: var(--muted); font-size: 13.5px; }
.modal-body { padding: 22px 24px; }
.modal-foot {
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  background: var(--bg);
  font-size: 12.5px; color: var(--soft);
  display: flex; justify-content: space-between; align-items: center;
}
.modal-icon {
  width: 36px; height: 36px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: var(--bg-tan);
  display: grid; place-items: center;
}
.modal-icon.danger { background: var(--red-soft); color: var(--red); }
.modal-icon.warn { background: rgba(245, 158, 11, 0.1); color: #b45309; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* === TOAST === */
.toast-stack {
  position: fixed; right: 24px;
  bottom: max(24px, env(safe-area-inset-bottom, 24px));
  z-index: 900;
  display: grid; gap: 10px;
  width: min(360px, calc(100% - 48px));
}
.toast {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
  padding: 14px 16px;
  box-shadow: 0 12px 28px rgba(10, 10, 10, 0.08);
  display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: center;
  font-size: 13.5px;
}
.toast.success .icon { color: var(--green); }
.toast.info .icon { color: var(--accent); }
.toast.error .icon { color: var(--red); }
.toast .info-meta { color: var(--soft); font-size: 12px; margin-top: 2px; }
.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
