/* ===========================================================
   橙点 POS · 设计系统（tokens / reset / 基础组件）
   =========================================================== */
:root {
  --orange: #ff6a13;
  --orange-2: #ff8a3d;
  --orange-deep: #e85400;
  --orange-50: #fff6f0;
  --orange-100: #ffe7d6;
  --orange-200: #ffd2b3;

  --ink: #14171a;
  --ink-2: #2b3238;
  --ink-3: #5b6670;
  --muted: #8a929b;

  --line: #ece7e1;
  --line-2: #f4f0ea;
  --bg: #fbfaf8;
  --bg-2: #f6f2ec;
  --white: #fff;

  --ok: #16a34a;
  --ok-bg: #eaf7ee;
  --warn: #d97706;
  --warn-bg: #fff5e5;
  --danger: #e5484d;
  --danger-bg: #fdecec;
  --info: #2f6fed;
  --info-bg: #eaf1ff;

  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 30px;
  --r-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(20, 23, 26, 0.05), 0 10px 26px -16px rgba(20, 23, 26, 0.18);
  --shadow-md: 0 2px 6px rgba(20, 23, 26, 0.05), 0 28px 56px -28px rgba(20, 23, 26, 0.24);
  --shadow-orange: 0 10px 24px -10px rgba(255, 106, 19, 0.55);

  --font: "MiSans", "HarmonyOS Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Consolas, monospace;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --nav-h: 68px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
p,
figure,
ul,
ol {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
}

::selection {
  background: var(--orange-200);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- 布局工具 ---------- */
.container {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: clamp(18px, 4vw, 40px);
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.between {
  justify-content: space-between;
}

.stack {
  display: flex;
  flex-direction: column;
}

.grow {
  flex: 1;
}

.tnum {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 文字 ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--orange-deep);
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 18px;
  height: 1.5px;
  background: currentColor;
  border-radius: 2px;
  opacity: 0.55;
}

.display {
  font-size: clamp(38px, 5.4vw, 68px);
  line-height: 1.04;
  letter-spacing: -0.035em;
  font-weight: 750;
}

.h2 {
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.14;
  letter-spacing: -0.03em;
  font-weight: 720;
}

.h3 {
  font-size: clamp(20px, 2vw, 26px);
  line-height: 1.25;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.lead {
  color: var(--ink-3);
  font-size: clamp(15px, 1.25vw, 17px);
  line-height: 1.75;
}

.text-orange {
  color: var(--orange);
}

.text-muted {
  color: var(--muted);
}

/* ---------- 按钮 ---------- */
.btn {
  --btn-bg: var(--white);
  --btn-fg: var(--ink);
  --btn-line: var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 22px;
  border-radius: var(--r-pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1px solid var(--btn-line);
  font-size: 14.5px;
  font-weight: 650;
  white-space: nowrap;
  transition: transform 0.16s var(--ease), box-shadow 0.2s var(--ease),
    background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
  user-select: none;
}

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

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  --btn-bg: var(--orange);
  --btn-fg: #fff;
  --btn-line: transparent;
  box-shadow: var(--shadow-orange);
}

.btn-primary:hover {
  --btn-bg: var(--orange-deep);
}

.btn-ink {
  --btn-bg: var(--ink);
  --btn-fg: #fff;
  --btn-line: transparent;
}

.btn-ghost {
  --btn-bg: transparent;
  --btn-line: transparent;
  --btn-fg: var(--ink-2);
}

.btn-ghost:hover {
  --btn-bg: var(--orange-50);
  --btn-fg: var(--orange-deep);
}

.btn-line {
  --btn-bg: transparent;
}

.btn-line:hover {
  --btn-line: var(--orange-200);
  --btn-bg: var(--orange-50);
  --btn-fg: var(--orange-deep);
}

.btn-sm {
  height: 36px;
  padding: 0 16px;
  font-size: 13px;
}

.btn-lg {
  height: 54px;
  padding: 0 30px;
  font-size: 16px;
}

.btn-block {
  width: 100%;
}

.btn[disabled] {
  opacity: 0.55;
  pointer-events: none;
}

.btn .ico {
  width: 18px;
  height: 18px;
}

/* ---------- 图标 ---------- */
.ico {
  width: 20px;
  height: 20px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ico-fill {
  fill: currentColor;
  stroke: none;
}

/* ---------- 徽标 / 标签 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: var(--r-pill);
  background: var(--orange-50);
  color: var(--orange-deep);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--orange-100);
  white-space: nowrap;
}

.tag-ok {
  background: var(--ok-bg);
  color: #15803d;
  border-color: #cdebd6;
}

.tag-warn {
  background: var(--warn-bg);
  color: var(--warn);
  border-color: #ffe6bf;
}

.tag-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: #f8d4d5;
}

.tag-mute {
  background: #f2f3f5;
  color: var(--ink-3);
  border-color: #e6e8eb;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

/* ---------- 表单 ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

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

.input,
.select,
.textarea {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  font-size: 14.5px;
  transition: border-color 0.16s var(--ease), box-shadow 0.16s var(--ease),
    background-color 0.16s var(--ease);
}

.textarea {
  height: auto;
  min-height: 92px;
  padding: 12px 14px;
  resize: vertical;
  line-height: 1.6;
}

.input::placeholder,
.textarea::placeholder {
  color: #b3b8be;
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: #ddd6cd;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 4px rgba(255, 106, 19, 0.12);
}

.select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a929b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 38px;
}

.input-icon {
  position: relative;
}

.input-icon .ico {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.input-icon .input {
  padding-left: 42px;
}

.switch {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: var(--r-pill);
  background: #dcdfe3;
  transition: background-color 0.2s var(--ease);
  flex: none;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s var(--ease);
}

.switch[aria-checked="true"] {
  background: var(--orange);
}

.switch[aria-checked="true"]::after {
  transform: translateX(18px);
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

/* ---------- 滚动条 ---------- */
* {
  scrollbar-width: thin;
  scrollbar-color: #d8d3cc transparent;
}

::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-thumb {
  background: #d8d3cc;
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: #c3bdb4;
  background-clip: padding-box;
  border: 2px solid transparent;
}

::-webkit-scrollbar-track {
  background: transparent;
}

/* ---------- 动效 ---------- */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes floaty {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-9px);
  }
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: var(--d, 0ms);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ---------- 通用弹层 ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(16, 18, 21, 0.42);
  backdrop-filter: blur(3px);
  z-index: 80;
  animation: fadeIn 0.18s var(--ease);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 18px;
  pointer-events: none;
}

.modal[hidden],
.overlay[hidden] {
  display: none;
}

.modal .modal-card {
  pointer-events: auto;
  width: min(560px, 100%);
  max-height: min(86vh, 860px);
  overflow: auto;
  background: #fff;
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
  animation: popIn 0.24s var(--ease);
}

.toast-wrap {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 18px;
  border-radius: var(--r-pill);
  background: rgba(20, 23, 26, 0.94);
  color: #fff;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.5);
  animation: popIn 0.22s var(--ease);
  max-width: 88vw;
}

.toast .ico {
  width: 17px;
  height: 17px;
  color: var(--orange-2);
}

.toast-ok .ico {
  color: #4ade80;
}

.toast-err .ico {
  color: #f87171;
}
