/* ==========================================================
   追鲜 FoodOps · macOS 门店端
   tokens.css — 设计变量与基础元件
   ========================================================== */

:root{
  /* 桌面 */
  --desk-bg:      #dfe3e8;
  --desk-bg-2:    #d3d8de;

  /* 材质 */
  --material-bar: rgba(248,248,250,.72);
  --material-dock: rgba(244,245,247,.62);
  --material-pop: rgba(250,250,252,.82);

  /* 窗口 */
  --win-bg:       #ffffff;
  --win-bg-soft:  #f6f6f8;
  --win-side:     #f1f1f4;
  --win-titlebar: #f2f2f5;
  --titlebar-inactive: #f7f7f9;

  /* 文字 */
  --ink:      #1d1d1f;
  --ink-2:    #5c5c61;
  --ink-3:    #8a8a8f;
  --ink-4:    #b4b4b9;
  --ink-inv:  #ffffff;

  /* 线条 */
  --line:        rgba(0,0,0,.09);
  --line-soft:   rgba(0,0,0,.055);
  --line-strong: rgba(0,0,0,.16);
  --win-line:    rgba(0,0,0,.13);

  /* 主题色 */
  --accent:      #0a6cff;
  --accent-soft: rgba(10,108,255,.10);
  --green:       #12a150;
  --green-soft:  rgba(18,161,80,.11);
  --orange:      #c46a00;
  --orange-soft: rgba(255,159,10,.14);
  --red:         #d92c20;
  --red-soft:    rgba(217,44,32,.10);
  --gray-badge:  rgba(0,0,0,.055);

  /* 交通灯 */
  --tl-red:    #ff5f57;
  --tl-yellow: #febc2e;
  --tl-green:  #28c840;

  /* 圆角 */
  --r-win: 11px;
  --r-lg: 14px;
  --r-md: 9px;
  --r-sm: 6px;

  /* 阴影 */
  --sh-win: 0 0 0 .5px rgba(0,0,0,.10), 0 12px 26px rgba(0,0,0,.13), 0 34px 64px rgba(0,0,0,.16);
  --sh-win-active: 0 0 0 .5px rgba(0,0,0,.12), 0 16px 34px rgba(0,0,0,.17), 0 44px 80px rgba(0,0,0,.22);
  --sh-pop: 0 0 0 .5px rgba(0,0,0,.10), 0 10px 30px rgba(0,0,0,.16);
  --sh-dock: 0 0 0 .5px rgba(255,255,255,.55) inset, 0 12px 30px rgba(0,0,0,.16), 0 2px 8px rgba(0,0,0,.10);

  /* 尺寸 */
  --menubar-h: 26px;
  --dock-h: 68px;
  --dock-bottom: 14px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
          "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-num: "SF Mono", "SF Pro Text", ui-monospace, Menlo, Consolas, monospace;
}

*{ box-sizing: border-box; }

html,body{
  height:100%; margin:0; padding:0;
  overflow:hidden;
  font-family: var(--font);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body{ background: var(--desk-bg); user-select:none; }

button{ font-family: inherit; color: inherit; border:0; background:none; padding:0; cursor:default; }
input,select,textarea{ font-family: inherit; font-size: inherit; color: inherit; }
svg{ display:block; }
.ic{ width:14px; height:14px; fill:none; stroke:currentColor; stroke-width:1.35; stroke-linecap:round; stroke-linejoin:round; }

/* ---------- 滚动条 ---------- */
.scroll{ overflow:auto; scrollbar-width:thin; }
.scroll::-webkit-scrollbar{ width:11px; height:11px; }
.scroll::-webkit-scrollbar-thumb{
  background: rgba(0,0,0,.20); border-radius:6px;
  border:3px solid transparent; background-clip: content-box;
}
.scroll::-webkit-scrollbar-thumb:hover{ background: rgba(0,0,0,.34); background-clip: content-box; }
.scroll::-webkit-scrollbar-track{ background:transparent; }

/* ---------- 通用按钮 ---------- */
.btn{
  display:inline-flex; align-items:center; gap:5px;
  height:24px; padding:0 9px;
  border-radius: var(--r-sm);
  font-size:12px; font-weight:500; line-height:1;
  background:#fff; color: var(--ink);
  box-shadow: 0 0 0 .5px rgba(0,0,0,.17), 0 1px 1.5px rgba(0,0,0,.07);
  white-space:nowrap;
  transition: background .12s;
}
.btn:hover{ background:#f3f3f5; }
.btn:active{ background:#e8e8ea; }
.btn.primary{
  background: var(--accent); color:#fff;
  box-shadow: 0 0 0 .5px rgba(0,0,0,.12), 0 1px 2px rgba(10,108,255,.35);
}
.btn.primary:hover{ background:#0a60e0; }
.btn.ghost{ background:transparent; box-shadow:none; color: var(--ink-2); }
.btn.ghost:hover{ background: rgba(0,0,0,.05); }
.btn.danger{ color: var(--red); }
.btn.lg{ height:28px; padding:0 12px; font-size:12.5px; border-radius:7px; }
.btn[disabled]{ opacity:.42; pointer-events:none; }

/* ---------- 分段控件 ---------- */
.seg{
  display:inline-flex; padding:2px;
  background: rgba(0,0,0,.055); border-radius:7px;
}
.seg button{
  height:21px; padding:0 10px; border-radius:5px;
  font-size:11.5px; color: var(--ink-2); font-weight:500;
  transition: background .12s, color .12s;
}
.seg button:hover{ color: var(--ink); }
.seg button.on{
  background:#fff; color: var(--ink);
  box-shadow: 0 0 0 .5px rgba(0,0,0,.10), 0 1px 2px rgba(0,0,0,.09);
}

/* ---------- 输入 ---------- */
.field{
  height:24px; padding:0 7px;
  border-radius: var(--r-sm);
  background:#fff;
  box-shadow: 0 0 0 .5px rgba(0,0,0,.16), inset 0 1px 1px rgba(0,0,0,.035);
  border:0; outline:none;
  font-size:12px;
}
.field:focus{ box-shadow: 0 0 0 2.5px rgba(10,108,255,.28), 0 0 0 .5px var(--accent); }
textarea.field{ height:auto; padding:6px 7px; resize:vertical; line-height:1.5; }
select.field{ padding-right:20px; appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='10'%3E%3Cpath d='M1 3.5 4 7l3-3.5' fill='none' stroke='%236e6e73' stroke-width='1.2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 6px center; }

.search-field{ position:relative; display:inline-flex; align-items:center; }
.search-field .ic{ position:absolute; left:6px; color: var(--ink-3); width:12px; height:12px; }
.search-field input{ padding-left:22px; width:150px; }

/* ---------- 表格 ---------- */
.tbl{ width:100%; border-collapse:separate; border-spacing:0; font-size:12px; }
.tbl thead th{
  position:sticky; top:0; z-index:2;
  text-align:left; font-weight:500; font-size:11px; color: var(--ink-3);
  padding:6px 10px;
  background: var(--win-bg-soft);
  border-bottom:.5px solid var(--line);
  white-space:nowrap;
}
.tbl thead th.sortable{ cursor:default; }
.tbl thead th.sortable:hover{ color: var(--ink); background:#ededf0; }
.tbl thead th .sort-arrow{ display:inline-block; width:8px; margin-left:3px; color: var(--ink-4); font-size:9px; }
.tbl thead th.sorted .sort-arrow{ color: var(--accent); }
.tbl tbody td{
  padding:7px 10px; border-bottom:.5px solid var(--line-soft);
  white-space:nowrap; color: var(--ink);
}
.tbl tbody tr.row-click{ cursor:default; }
.tbl tbody tr:hover td{ background: rgba(0,0,0,.028); }
.tbl tbody tr.sel td{ background: var(--accent-soft); }
.tbl tbody tr.sel:hover td{ background: rgba(10,108,255,.14); }
.tbl .num{ font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.tbl .muted{ color: var(--ink-3); }

/* ---------- 状态标签 ---------- */
.tag{
  display:inline-flex; align-items:center; gap:4px;
  height:18px; padding:0 6px; border-radius:4px;
  font-size:11px; font-weight:500; line-height:1;
  background: var(--gray-badge); color: var(--ink-2);
  white-space:nowrap;
}
.tag .dot{ width:5px; height:5px; border-radius:50%; background:currentColor; }
.tag.ok{ background: var(--green-soft); color: var(--green); }
.tag.warn{ background: var(--orange-soft); color: var(--orange); }
.tag.bad{ background: var(--red-soft); color: var(--red); }
.tag.info{ background: var(--accent-soft); color: var(--accent); }
.tag.plain{ background:transparent; box-shadow: inset 0 0 0 .5px var(--line-strong); }

/* ---------- 分隔 ---------- */
.hr{ height:.5px; background: var(--line); margin:0; border:0; }
.spacer{ flex:1; }

/* ---------- 工具类 ---------- */
.row{ display:flex; align-items:center; gap:8px; }
.col{ display:flex; flex-direction:column; }
.mono{ font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.nowrap{ white-space:nowrap; }
.hidden{ display:none !important; }
