/* 内部点单系统 —— 公共样式 */
:root {
  --brand: #e8552d;
  --brand-soft: #fff1ec;
  --brand-dark: #c8431f;
  --text: #222222;
  --text-2: #4b5563;
  --muted: #7a8290;
  --line: #e4e6ea;
  --line-strong: #cfd3da;
  --bg: #f3f4f6;
  --panel: #ffffff;
  --ok: #0f9d58;
  --ok-soft: #e8f7ef;
  --warn: #b76e00;
  --warn-soft: #fff7e6;
  --danger: #d93a3a;
  --danger-soft: #fdecec;
  --info: #1a6fd4;
  --info-soft: #eaf2fe;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(17, 24, 39, 0.06), 0 6px 18px rgba(17, 24, 39, 0.05);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 700;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: 15px;
  color: inherit;
}

button {
  cursor: pointer;
}

/* ------------------------------- 按钮 ------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.btn:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: #fff;
}

.btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--text-2);
}

.btn-ghost:hover {
  background: var(--brand-soft);
  border-color: transparent;
  color: var(--brand);
}

.btn-danger {
  border-color: var(--danger);
  color: var(--danger);
  background: #fff;
}

.btn-danger:hover {
  background: var(--danger);
  color: #fff;
}

.btn-ok {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}

.btn-ok:hover {
  background: #0b8348;
  border-color: #0b8348;
  color: #fff;
}

.btn-sm {
  height: 30px;
  padding: 0 10px;
  font-size: 14px;
  border-radius: 6px;
}

.btn-block {
  width: 100%;
}

/* ------------------------------- 表单 ------------------------------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.field > label,
.field-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
}

.input,
.select,
.textarea {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.textarea {
  height: auto;
  min-height: 72px;
  padding: 8px 10px;
  resize: vertical;
  line-height: 1.5;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(232, 85, 45, 0.12);
}

.hint {
  font-size: 14px;
  color: var(--muted);
}

/* ------------------------------- 标签 ------------------------------- */
.tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 7px;
  border-radius: 5px;
  font-size: 14px;
  line-height: 1;
  background: #f1f2f4;
  color: var(--text-2);
}

.tag-brand {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.tag-ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.tag-warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.tag-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.tag-info {
  background: var(--info-soft);
  color: var(--info);
}

/* ------------------------------- 弹层 ------------------------------- */
.mask {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s;
}

.mask.show {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 32px);
  overflow: auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(17, 24, 39, 0.22);
  transform: translateY(12px) scale(0.99);
  transition: transform 0.18s;
}

.mask.show .modal {
  transform: none;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.modal-head h3 {
  font-size: 17px;
}

.modal-body {
  padding: 16px;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: #fafbfc;
  border-radius: 0 0 12px 12px;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
}

.icon-btn:hover {
  background: #f1f2f4;
  color: var(--text);
}

/* ------------------------------- 提示 ------------------------------- */
.toast-wrap {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
  pointer-events: none;
}

.toast {
  min-width: 180px;
  max-width: 420px;
  padding: 10px 16px;
  border-radius: 8px;
  background: rgba(34, 34, 34, 0.92);
  color: #fff;
  font-size: 15px;
  box-shadow: var(--shadow);
  animation: toastIn 0.2s ease;
}

.toast.ok {
  background: var(--ok);
}

.toast.err {
  background: var(--danger);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.empty {
  padding: 40px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
}

.empty strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text-2);
  font-size: 16px;
}

/* 滚动条 */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: #d3d6dc;
  border-radius: 6px;
  border: 2px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background: #b9bec7;
  background-clip: content-box;
}
