/* ============================================================
   Hi库房 · 样式
   移动端优先：手机上是「顶栏 + 底部导航」，桌面自动切换为侧栏。
   ============================================================ */

:root {
  --bg: #f4f5f7;
  --bg-warm: #fff8f7;
  --card: #ffffff;
  --ink: #14171d;
  --ink-2: #58606e;
  --ink-3: #8b93a1;
  --line: #e7e9ee;
  --line-2: #f0f2f6;
  --red: #c8102e;
  --red-ink: #a20d25;
  --red-soft: #fdeef0;
  --red-mid: #e23b52;
  --green: #0b7a4b;
  --green-soft: #e8f7ef;
  --amber: #b54708;
  --amber-soft: #fff4e5;
  --amber-line: #f7d9a8;
  --blue: #1d4ed8;
  --blue-soft: #eef2ff;
  --grey-soft: #f3f4f7;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 18px -10px rgba(16, 24, 40, .14);
  --shadow-md: 0 18px 50px -22px rgba(16, 24, 40, .3);
  --r-lg: 18px;
  --r-md: 12px;
  --r-sm: 8px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: ui-monospace, "SF Mono", "Menlo", "Consolas", monospace;
}

* { box-sizing: border-box; }

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

body {
  background:
    radial-gradient(900px 420px at 12% -8%, #fff2f3 0%, rgba(255, 242, 243, 0) 62%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--red); text-decoration: none; }

/* ---------------- 布局 ---------------- */
.app { display: flex; min-height: 100vh; }

.main { flex: 1; min-width: 0; }

.view {
  max-width: 1080px;
  margin: 0 auto;
  padding: 34px 32px 96px;
  outline: none;
}

.sidebar {
  position: sticky;
  top: 0;
  display: none;
  flex-direction: column;
  width: 244px;
  flex: 0 0 244px;
  height: 100vh;
  padding: 24px 16px 18px;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(140%) blur(12px);
  border-right: 1px solid var(--line);
  z-index: 30;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 8px 22px;
}
.side-brand .mark {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: var(--red);
  color: #fff;
  box-shadow: 0 6px 14px -6px rgba(200, 16, 46, .7);
}
.side-brand .mark svg { width: 18px; height: 18px; }
.side-brand b { font-size: 16px; letter-spacing: .01em; }
.side-brand small {
  display: block;
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 500;
  letter-spacing: .02em;
}

.side-group { margin-bottom: 14px; }
.side-group-title {
  padding: 8px 12px 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  color: var(--ink-3);
}

.side-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 2px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  transition: background .16s, color .16s;
}
.side-item svg { width: 18px; height: 18px; flex: 0 0 18px; opacity: .85; }
.side-item:hover { background: var(--grey-soft); color: var(--ink); }
.side-item.active { background: var(--red-soft); color: var(--red-ink); font-weight: 650; }
.side-item.active svg { opacity: 1; }
.side-item .side-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.side-item .side-badge.muted { background: #e9ebf0; color: var(--ink-2); }

.side-foot {
  margin-top: auto;
  padding: 14px 12px 4px;
  border-top: 1px solid var(--line-2);
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--ink-3);
}
.side-foot b { color: var(--ink-2); font-weight: 600; }

/* ---------------- 手机顶栏 / 底部导航 ---------------- */
.mobile-top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px calc(12px + env(safe-area-inset-top, 0px) * 0);
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid rgba(231, 233, 238, .9);
}
.mt-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; }
.mt-brand .mark {
  width: 26px; height: 26px; border-radius: 8px; background: var(--red); color: #fff;
  display: grid; place-items: center;
}
.mt-brand .mark svg { width: 15px; height: 15px; }
.mt-brand small { font-weight: 500; color: var(--ink-3); font-size: 11px; }
.mt-actions { display: flex; align-items: center; gap: 8px; }

.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(160%) blur(16px);
  border-top: 1px solid var(--line);
}
.tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 7px 0 5px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink-3);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .01em;
}
.tab svg { width: 21px; height: 21px; }
.tab.active { color: var(--red); }
.tab .dot-badge {
  position: absolute;
  top: 3px;
  right: calc(50% - 16px);
  min-width: 15px; height: 15px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 9.5px;
  line-height: 15px;
  text-align: center;
  box-shadow: 0 0 0 2px #fff;
}

/* ---------------- 页头 ---------------- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--ink-3);
  text-transform: uppercase;
}
.page-head h1 {
  margin: 0;
  font-size: 27px;
  line-height: 1.25;
  font-weight: 750;
  letter-spacing: -.015em;
}
.page-head h1 em { font-style: normal; color: var(--red); }
.page-sub { margin: 7px 0 0; color: var(--ink-2); font-size: 13.5px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px 0;
  flex-wrap: wrap;
}
.card-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.01em;
}
.card-sub { color: var(--ink-3); font-size: 12.5px; }
.card-tools { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card-body { padding: 14px 20px 20px; }
.card-body.tight { padding: 10px 14px 14px; }
.card + .card { margin-top: 16px; }

/* ---------------- 首页 ---------------- */
.hello {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}
.hello h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.3;
  font-weight: 760;
  letter-spacing: -.02em;
  max-width: 640px;
}
.hello h1 em { font-style: normal; color: var(--red); }
.hello p { margin: 8px 0 0; color: var(--ink-2); font-size: 13.5px; }

.alert-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  margin-bottom: 16px;
  border-radius: 14px;
  border: 1px solid var(--amber-line);
  background: linear-gradient(100deg, #fff8ec, #fffdf8);
  color: var(--amber);
}
.alert-strip.is-expired {
  border-color: #f6c9cd;
  background: linear-gradient(100deg, #fdeef0, #fff8f9);
  color: var(--red-ink);
}
.alert-strip .ico {
  width: 34px; height: 34px; flex: 0 0 34px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow-xs);
}
.alert-strip .ico svg { width: 18px; height: 18px; }
.alert-strip .txt { flex: 1; min-width: 0; }
.alert-strip .txt b { display: block; font-size: 13.5px; }
.alert-strip .txt span { font-size: 12.5px; opacity: .85; }
.alert-strip .btn { flex: 0 0 auto; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.stat {
  position: relative;
  padding: 16px 16px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.stat::after {
  content: "";
  position: absolute;
  right: -24px; top: -24px;
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--red-soft);
  opacity: .55;
}
.stat .stat-label { font-size: 12px; color: var(--ink-3); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.stat .stat-label svg { width: 14px; height: 14px; opacity: .7; }
.stat .stat-num {
  margin-top: 6px;
  font-size: 25px;
  font-weight: 750;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.stat .stat-num .unit { font-size: 12px; font-weight: 600; color: var(--ink-3); margin-left: 3px; letter-spacing: 0; }
.stat .stat-foot { margin-top: 4px; font-size: 11.5px; color: var(--ink-3); }
.stat .stat-foot.warn { color: var(--amber); }
.stat .stat-foot.danger { color: var(--red); }
.stat.accent { background: linear-gradient(160deg, #fff 0%, #fff6f7 100%); border-color: #f8dfe3; }
.stat.accent .stat-num { color: var(--red-ink); }

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.home-grid > .card + .card { margin-top: 0; }

.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.quick {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  box-shadow: var(--shadow-xs);
  text-align: left;
  transition: transform .16s, box-shadow .16s, border-color .16s;
}
.quick:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); border-color: #dcdfe6; }
.quick .q-ico {
  width: 34px; height: 34px; flex: 0 0 34px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: var(--grey-soft);
  color: var(--ink-2);
}
.quick .q-ico.red { background: var(--red-soft); color: var(--red); }
.quick .q-ico.amber { background: var(--amber-soft); color: var(--amber); }
.quick .q-ico.blue { background: var(--blue-soft); color: var(--blue); }
.quick .q-ico.green { background: var(--green-soft); color: var(--green); }
.quick .q-ico svg { width: 17px; height: 17px; }
.quick b { display: block; font-size: 13px; }
.quick span { font-size: 11.5px; color: var(--ink-3); }

/* ---------------- 临期 / 提醒列表 ---------------- */
.alert-list { display: flex; flex-direction: column; }
.alert-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line-2);
  position: relative;
}
.alert-row:last-child { border-bottom: 0; }
.alert-row::before {
  content: "";
  width: 4px; height: 30px;
  border-radius: 4px;
  background: var(--ink-3);
  flex: 0 0 4px;
  opacity: .35;
}
.alert-row.lv-expired::before { background: var(--red); opacity: 1; }
.alert-row.lv-urgent::before { background: #e8590c; opacity: 1; }
.alert-row.lv-warn::before { background: #f0a020; opacity: 1; }
.alert-row.lv-watch::before { background: #8f9bb3; opacity: .8; }
.alert-row .ar-main { flex: 1; min-width: 0; }
.alert-row .ar-title { display: flex; align-items: center; gap: 7px; font-weight: 650; font-size: 13.5px; flex-wrap: wrap; }
.alert-row .ar-sub { margin-top: 2px; color: var(--ink-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alert-row .ar-days {
  flex: 0 0 auto;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--ink-2);
  white-space: nowrap;
}
.alert-row .ar-days b { font-size: 17px; margin-right: 1px; }
.alert-row .ar-days.lv-expired { color: var(--red); }
.alert-row .ar-days.lv-urgent { color: #d9480f; }
.alert-row .ar-days.lv-warn { color: #b54708; }
.alert-row .ar-days.lv-watch { color: var(--ink-2); }
.alert-row .ar-qty { flex: 0 0 auto; font-size: 12px; color: var(--ink-2); width: 72px; text-align: right; font-variant-numeric: tabular-nums; }

.life {
  height: 4px;
  border-radius: 4px;
  background: #eef0f4;
  overflow: hidden;
  margin-top: 6px;
}
.life i { display: block; height: 100%; border-radius: 4px; background: var(--green); }
.life.lv-urgent i { background: #e8590c; }
.life.lv-warn i { background: #f0a020; }
.life.lv-expired i { background: var(--red); }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: .01em;
  white-space: nowrap;
  transition: background .15s, border-color .15s, transform .12s, box-shadow .15s;
}
.btn svg { width: 16px; height: 16px; }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  box-shadow: 0 6px 16px -8px rgba(200, 16, 46, .75);
}
.btn-primary:hover { background: var(--red-ink); border-color: var(--red-ink); }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { border-color: #d3d7df; color: var(--ink); background: #fafbfc; }
.btn-soft { background: var(--red-soft); border-color: transparent; color: var(--red-ink); }
.btn-soft:hover { background: #fbe2e6; }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-danger { background: #fff; border-color: #f3c7cc; color: var(--red); }
.btn-danger:hover { background: var(--red-soft); }
.btn-white { background: rgba(255, 255, 255, .92); border-color: rgba(0, 0, 0, .06); color: var(--ink); box-shadow: var(--shadow-xs); }
.btn-sm { min-height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 9px; }
.btn-sm svg { width: 14px; height: 14px; }
.btn-xs { min-height: 27px; padding: 0 8px; font-size: 12px; border-radius: 7px; }
.btn-block { width: 100%; }
.btn-icon {
  width: 34px; height: 34px;
  display: inline-grid; place-items: center;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-2);
}
.btn-icon:hover { background: var(--grey-soft); }
.btn-icon svg { width: 17px; height: 17px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ---------------- 表单 ---------------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 4px; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 6px;
}
.field > label .req { color: var(--red); }
.field .hint { margin: 0; font-size: 11.5px; color: var(--ink-3); }
.field .hint.warn { color: var(--amber); }
.field .err { margin: 0; font-size: 12px; color: var(--red); font-weight: 500; }

.input, .select, textarea.input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #dfe3e9;
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
  color: var(--ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  appearance: none;
}
.select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238b93a1' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
}
textarea.input { min-height: 70px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, textarea.input:focus {
  border-color: var(--red-mid);
  box-shadow: 0 0 0 3px rgba(200, 16, 46, .1);
}
.input::placeholder { color: #a9b0bc; }
.input[readonly] { background: #f7f8fa; color: var(--ink-2); }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row.three { grid-template-columns: 1.2fr .8fr .8fr; }

.input-group { display: flex; align-items: stretch; position: relative; }
.input-group .input { padding-right: 52px; }
.input-group .suffix {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  font-size: 12.5px; color: var(--ink-3); pointer-events: none;
}

.chip-radio { display: flex; flex-wrap: wrap; gap: 7px; }
.chip-radio input { position: absolute; opacity: 0; pointer-events: none; }
.chip-radio label {
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 12.5px;
  color: var(--ink-2);
  cursor: pointer;
  transition: all .15s;
  user-select: none;
}
.chip-radio input:checked + label {
  border-color: var(--red);
  background: var(--red-soft);
  color: var(--red-ink);
  font-weight: 600;
}
.chip-radio input:focus-visible + label { box-shadow: 0 0 0 3px rgba(200, 16, 46, .14); }

/* ---------------- 徽标 ---------------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 21px;
  padding: 0 7px;
  border-radius: 6px;
  background: var(--grey-soft);
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 650;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.badge-expired { background: var(--red-soft); color: #b42318; }
.badge-urgent { background: #fff0e6; color: #c2410c; }
.badge-warn { background: var(--amber-soft); color: var(--amber); }
.badge-watch { background: #eef1f6; color: #475467; }
.badge-ok { background: var(--green-soft); color: var(--green); }
.badge-none { background: var(--grey-soft); color: var(--ink-3); }
.badge-muted { background: var(--grey-soft); color: var(--ink-3); }
.badge-red { background: var(--red); color: #fff; }
.badge-dot::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .7; }

/* ---------------- 库存 ---------------- */
.filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.filters .search {
  position: relative;
  flex: 1 1 220px;
  min-width: 160px;
}
.filters .search svg {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--ink-3);
}
.filters .search .input { padding-left: 34px; min-height: 40px; background: #fff; }
.filters .select { width: auto; min-width: 108px; min-height: 40px; padding-top: 8px; padding-bottom: 8px; font-size: 13px; }

.seg {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  background: #edeff3;
  overflow-x: auto;
  max-width: 100%;
  scrollbar-width: none;
}
.seg::-webkit-scrollbar { display: none; }
.seg button {
  border: 0;
  background: transparent;
  padding: 6px 11px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
}
.seg button.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-xs); }
.seg button .n { color: var(--ink-3); font-weight: 500; margin-left: 3px; }

.stock-list { display: flex; flex-direction: column; gap: 10px; }
.stock-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.stock-card.open { border-color: #dfe3e9; box-shadow: var(--shadow-sm); }
.stock-top {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  cursor: pointer;
}
.stock-top:hover { background: #fcfcfd; }
.stock-id { flex: 1; min-width: 0; }
.stock-name {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -.01em;
  flex-wrap: wrap;
}
.stock-meta {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--ink-3);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.stock-qty { text-align: right; flex: 0 0 auto; }
.stock-qty b {
  font-size: 19px;
  font-weight: 750;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.stock-qty .u { font-size: 11.5px; color: var(--ink-3); margin-left: 2px; }
.stock-qty small { display: block; font-size: 11px; color: var(--ink-3); }
.stock-qty small.danger { color: var(--red); }
.stock-qty small.warn { color: var(--amber); }
.stock-qty.is-low b { color: var(--red); }
.chev { color: var(--ink-3); transition: transform .2s; display: inline-flex; }
.chev svg { width: 16px; height: 16px; }
.stock-card.open .chev { transform: rotate(90deg); }

.batches {
  border-top: 1px solid var(--line-2);
  background: #fbfbfd;
  padding: 4px 16px 12px;
}
.batch-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed #e9ebf0;
  flex-wrap: wrap;
}
.batch-row:last-child { border-bottom: 0; }
.batch-main { flex: 1 1 200px; min-width: 0; }
.batch-main b { font-size: 13px; font-weight: 650; }
.batch-main .bmeta { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; display: flex; gap: 8px; flex-wrap: wrap; }
.batch-num { text-align: right; font-variant-numeric: tabular-nums; font-size: 13.5px; font-weight: 650; flex: 0 0 auto; }
.batch-num small { display: block; font-weight: 500; font-size: 10.5px; color: var(--ink-3); }
.batch-ops { display: flex; gap: 5px; flex: 0 0 auto; }

.zero-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px; border: 1px dashed #d9dde4; border-radius: 14px;
  color: var(--ink-3); font-size: 13px; background: #fbfbfc;
}

/* ---------------- 表格 ---------------- */
.table { width: 100%; }
.table .th, .table .td { padding: 10px 10px; }
.table .thead {
  display: grid;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-3);
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
}
.table .tr {
  display: grid;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid var(--line-2);
  font-size: 13px;
}
.table .tr:last-child { border-bottom: 0; }
.table .tr.voided { opacity: .45; text-decoration: line-through; }
.table .num { font-variant-numeric: tabular-nums; }
.table .muted { color: var(--ink-3); font-size: 12px; }

/* ---------------- 空状态 ---------------- */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 40px 20px;
  text-align: center;
  color: var(--ink-3);
}
.empty .e-ico {
  width: 46px; height: 46px;
  border-radius: 14px;
  background: var(--grey-soft);
  display: grid; place-items: center;
  color: var(--ink-3);
  margin-bottom: 2px;
}
.empty .e-ico svg { width: 22px; height: 22px; }
.empty b { color: var(--ink-2); font-size: 13.5px; }
.empty span { font-size: 12.5px; max-width: 320px; }

/* ---------------- 提示条 ---------------- */
.note {
  display: flex;
  gap: 9px;
  padding: 11px 13px;
  border-radius: 11px;
  background: #f7f8fa;
  border: 1px solid var(--line-2);
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.6;
}
.note .n-ico { flex: 0 0 auto; color: var(--ink-3); display: inline-flex; margin-top: 1px; }
.note svg { width: 15px; height: 15px; }
.note.warn { background: var(--amber-soft); border-color: #f6e2c0; color: #8a4b08; }
.note.danger { background: var(--red-soft); border-color: #f6cdd2; color: var(--red-ink); }
.note.ok { background: var(--green-soft); border-color: #c6ead8; color: #0a6b42; }

/* ---------------- 详情块 ---------------- */
.kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}
.kv { min-width: 0; }
.kv .k { font-size: 11.5px; color: var(--ink-3); }
.kv .v { font-size: 14px; font-weight: 650; margin-top: 2px; font-variant-numeric: tabular-nums; word-break: break-word; }

.pick-list { display: flex; flex-direction: column; gap: 8px; }
.pick {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  text-align: left;
  transition: border-color .15s, background .15s;
}
.pick:hover { border-color: #d4d9e1; background: #fcfcfd; }
.pick.selected { border-color: var(--red); background: var(--red-soft); }
.pick .p-main { flex: 1; min-width: 0; }
.pick .p-title { font-weight: 650; font-size: 13.5px; display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.pick .p-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.pick .p-right { text-align: right; flex: 0 0 auto; }
.pick .p-right b { font-size: 15px; font-variant-numeric: tabular-nums; }
.pick .p-right small { display: block; font-size: 11px; color: var(--ink-3); }

.batch-pick { display: flex; flex-direction: column; gap: 8px; }
.batch-opt {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.batch-opt:hover { border-color: #d5dae2; }
.batch-opt.checked { border-color: var(--red); background: #fffafb; box-shadow: 0 0 0 1px var(--red) inset; }
.batch-opt input { accent-color: var(--red); width: 16px; height: 16px; flex: 0 0 16px; }
.batch-opt .bo-main { flex: 1; min-width: 0; }
.batch-opt .bo-title { font-size: 13px; font-weight: 650; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.batch-opt .bo-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.batch-opt .bo-qty { text-align: right; font-size: 13px; font-variant-numeric: tabular-nums; font-weight: 650; white-space: nowrap; }
.batch-opt .bo-qty small { display: block; font-size: 10.5px; font-weight: 500; color: var(--ink-3); }

.selected-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
  margin-bottom: 14px;
}
.selected-bar .sb-main { flex: 1; min-width: 0; }
.selected-bar b { font-size: 14px; }

/* ---------------- 弹层 ---------------- */
.modal-root { position: relative; z-index: 100; }
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(16, 20, 28, .42);
  backdrop-filter: blur(3px);
  animation: fade-in .16s ease-out;
}
.modal {
  width: 100%;
  max-width: 560px;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--shadow-md);
  animation: pop-in .18s cubic-bezier(.2, .9, .3, 1);
  overflow: hidden;
}
.modal.wide { max-width: 720px; }
.modal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px 12px;
}
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.modal-head .x { margin-left: auto; }
.modal-body { padding: 4px 20px 18px; overflow: auto; }
.modal-foot {
  display: flex;
  gap: 9px;
  justify-content: flex-end;
  padding: 12px 20px calc(14px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line-2);
  background: #fcfcfd;
}
@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(8px) scale(.985); } }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(78px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 12px);
  z-index: 200;
  max-width: min(88vw, 460px);
  padding: 10px 16px;
  border-radius: 11px;
  background: rgba(20, 23, 29, .94);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s, transform .18s;
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: #9f1239; }
.toast.ok { background: #065f46; }

/* ---------------- 首页专用 ---------------- */
.dist { margin-top: 4px; }
.dist-bar { display: flex; height: 8px; border-radius: 6px; overflow: hidden; background: #eef0f4; }
.dist-bar i { height: 100%; }
.dist-bar .s-expired { background: var(--red); }
.dist-bar .s-urgent { background: #e8590c; }
.dist-bar .s-warn { background: #f0a020; }
.dist-bar .s-watch { background: #aab4c5; }
.dist-legend { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 9px; font-size: 11.5px; color: var(--ink-3); }
.dist-legend span { display: inline-flex; align-items: center; gap: 5px; }
.dist-legend i { width: 7px; height: 7px; border-radius: 2px; display: inline-block; }

.today-strip {
  display: flex;
  gap: 18px;
  padding: 10px 0 2px;
  flex-wrap: wrap;
}
.today-strip .ts { font-size: 12px; color: var(--ink-3); }
.today-strip .ts b { display: block; font-size: 15px; color: var(--ink); font-variant-numeric: tabular-nums; margin-top: 1px; }

.ledger-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1.6fr) minmax(0, 1fr) 74px;
  gap: 10px;
  align-items: center;
  padding: 10px 2px;
  border-bottom: 1px solid var(--line-2);
  font-size: 12.5px;
}
.ledger-row:last-child { border-bottom: 0; }
.ledger-row .lt { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.ledger-row .li { min-width: 0; }
.ledger-row .li b { display: block; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ledger-row .li small { color: var(--ink-3); font-size: 10.5px; }
.ledger-row .lq { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.ledger-row .lq .in { color: var(--green); }
.ledger-row .lq .out { color: var(--ink-2); }
.ledger-row .lq .loss { color: var(--red); }

.type-pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 38px; height: 21px; padding: 0 6px;
  border-radius: 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .02em;
}
.type-in { background: var(--green-soft); color: var(--green); }
.type-out { background: #eef1f6; color: #475467; }
.type-loss { background: var(--red-soft); color: var(--red); }
.type-adjust { background: var(--blue-soft); color: var(--blue); }

/* ---------------- 清账 ---------------- */
.count-table { display: flex; flex-direction: column; }
.count-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) 90px 112px 84px;
  gap: 10px;
  align-items: center;
  padding: 9px 4px;
  border-bottom: 1px solid var(--line-2);
}
.count-row.head { font-size: 11px; font-weight: 600; color: var(--ink-3); padding-top: 2px; }
.count-row .ci b { font-size: 13px; font-weight: 650; display: block; }
.count-row .ci small { font-size: 11px; color: var(--ink-3); }
.count-row .csys { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.count-row .cactual .input { min-height: 36px; padding: 6px 9px; font-size: 13.5px; text-align: right; font-variant-numeric: tabular-nums; }
.count-row .cdiff { font-size: 12.5px; font-weight: 650; text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-3); }
.count-row .cdiff.up { color: var(--blue); }
.count-row .cdiff.down { color: var(--red); }

.count-bar {
  position: sticky;
  bottom: 16px;
  z-index: 15;
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 12px 16px;
  margin-top: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .96);
  border: 1px solid var(--line);
  box-shadow: 0 14px 30px -14px rgba(16, 24, 40, .25);
  backdrop-filter: blur(8px);
  flex-wrap: wrap;
}
.count-bar .cb-stat { font-size: 11.5px; color: var(--ink-3); }
.count-bar .cb-stat b { display: block; font-size: 14px; color: var(--ink); font-variant-numeric: tabular-nums; }
.count-bar .cb-stat b.up { color: var(--blue); }
.count-bar .cb-stat b.down { color: var(--red); }
.count-bar .cb-actions { margin-left: auto; display: flex; gap: 8px; }

/* ---------------- 设置 ---------------- */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.dict-row { padding: 13px 0; border-bottom: 1px solid var(--line-2); }
.dict-row:last-child { border-bottom: 0; padding-bottom: 0; }
.dict-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.dict-head b { font-size: 13px; }
.dict-head .count { font-size: 11px; color: var(--ink-3); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 6px 0 10px;
  border-radius: 999px;
  background: var(--grey-soft);
  font-size: 12px;
  color: var(--ink-2);
}
.chip button {
  width: 18px; height: 18px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: transparent;
  color: var(--ink-3);
  font-size: 14px;
  line-height: 1;
  padding: 0;
}
.chip button:hover { background: #e2e5ea; color: var(--red); }
.dict-add { display: flex; gap: 7px; margin-top: 8px; max-width: 320px; }
.dict-add .input { min-height: 36px; padding: 6px 10px; font-size: 13px; border-radius: 9px; }
.toast-mini { font-size: 11.5px; color: var(--green); }

.setting-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line-2);
}
.setting-line:last-child { border-bottom: 0; }
.setting-line .sl-main { min-width: 0; }
.setting-line b { display: block; font-size: 13px; font-weight: 650; }
.setting-line small { display: block; font-size: 11.5px; color: var(--ink-3); margin-top: 2px; line-height: 1.5; }
.setting-line .sl-ctl { flex: 0 0 auto; }

.switch { position: relative; display: inline-block; width: 44px; height: 26px; flex: 0 0 44px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track {
  position: absolute; inset: 0;
  border-radius: 999px;
  background: #d7dbe3;
  transition: background .18s;
}
.switch .track::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
  transition: transform .18s;
}
.switch input:checked + .track { background: var(--red); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px rgba(200, 16, 46, .16); }

.num-input { width: 92px; min-height: 36px; padding: 6px 9px; text-align: left; font-variant-numeric: tabular-nums; }

.data-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.hr { height: 1px; background: var(--line-2); margin: 14px 0; }

/* ---------------- 打印 ---------------- */
.print-area { display: none; }

@media print {
  @page { size: A4 portrait; margin: 14mm; }
  body { background: #fff; margin: 0; }
  body > *:not(.print-area) { display: none !important; }
  .print-area {
    display: block !important;
    position: static;
    width: auto;
    padding: 0;
    color: #000;
  }
  .print-area h1 { font-size: 19px; margin: 0 0 2px; }
  .print-area .p-meta { font-size: 11px; color: #444; margin-bottom: 10px; }
  .print-area table { width: 100%; border-collapse: collapse; font-size: 11px; table-layout: fixed; }
  .print-area th, .print-area td { border: 1px solid #999; padding: 5px 6px; text-align: left; word-break: break-all; }
  .print-area th { background: #f2f2f2; }
  .print-area .p-foot { margin-top: 10px; font-size: 10.5px; color: #444; display: flex; justify-content: space-between; }
}

/* ---------------- 响应式 ---------------- */
@media (min-width: 960px) {
  .sidebar { display: flex; }
  .mobile-top, .tabbar { display: none; }
  .view { padding: 40px 40px 80px; }
  .toast { bottom: 32px; }
  .modal-backdrop { align-items: center; }
}

@media (max-width: 959px) {
  .view { padding: 20px 16px 96px; }
  .modal { max-height: 92vh; }
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal {
    max-width: 100%;
    border-radius: 20px 20px 0 0;
    animation: sheet-in .22s cubic-bezier(.2, .9, .3, 1);
    max-height: 92vh;
  }
  .modal.wide { max-width: 100%; }
  @keyframes sheet-in { from { transform: translateY(40px); opacity: .6; } }
  .page-head h1 { font-size: 23px; }
  .hello h1 { font-size: 23px; }
  .home-grid { grid-template-columns: 1fr; }
  .home-grid > .card + .card { margin-top: 0; }
  .quick-grid { grid-template-columns: 1fr 1fr; }
  .count-bar { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
}

@media (max-width: 720px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .home-grid { gap: 12px; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .hello { flex-direction: column; gap: 12px; }
  .hello .btn { align-self: flex-start; }
  .field-row, .field-row.three { grid-template-columns: 1fr 1fr; }
  .field-row.three > :first-child { grid-column: 1 / -1; }
  .count-row { grid-template-columns: minmax(0, 1fr) 74px 96px 60px; }
  .stock-top { gap: 10px; }
  .stock-qty b { font-size: 17px; }
  .batch-row { gap: 8px; }
  .batch-ops { width: 100%; justify-content: flex-end; }
  .alert-row .ar-qty { display: none; }
  .alert-strip { align-items: flex-start; flex-wrap: wrap; }
  .alert-strip .btn { margin-left: 46px; }
  .ledger-row { grid-template-columns: 44px minmax(0, 1fr) 64px; }
  .ledger-row .ldept { display: none; }
  .card-body { padding: 12px 16px 16px; }
  .card-head { padding: 16px 16px 0; }
  .stock-top { padding: 13px 14px; }
  .batches { padding: 2px 14px 10px; }
}

@media (max-width: 420px) {
  .stat .stat-num { font-size: 22px; }
  .stat { padding: 13px 13px 12px; }
  .quick { padding: 10px 11px; }
  .quick .q-ico { width: 30px; height: 30px; flex-basis: 30px; }
  .filters .search { flex: 1 1 100%; }
  .filters .select { flex: 1; }
  .field-row, .field-row.three { grid-template-columns: 1fr; }
  .field-row.three > :first-child { grid-column: auto; }
  .page-head h1 { font-size: 21px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ============================================================
   补充组件
   ============================================================ */
.muted { color: var(--ink-3); }

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.split > * { min-width: 0; }
.split > .card + .card { margin-top: 0; }

.link-btn {
  border: 0;
  background: none;
  padding: 0;
  color: var(--red);
  font-size: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.alert-bell { position: relative; }
.icon-badge {
  position: absolute;
  top: 1px; right: 0;
  min-width: 15px; height: 15px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 15px;
  text-align: center;
  box-shadow: 0 0 0 2px #fff;
}

/* 临期汇总 */
.exp-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.es-item {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-xs);
}
.es-item b {
  display: block;
  font-size: 22px;
  font-weight: 750;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}
.es-item span { font-size: 11.5px; color: var(--ink-3); }
.es-item.danger b { color: var(--red); }
.es-item.warn b { color: #d9480f; }
.es-item.amber b { color: var(--amber); }
.es-item.grey b { color: var(--ink-2); }

/* 临期条目 */
.exp-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  margin-bottom: 9px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid #cfd6e0;
  border-radius: 14px;
  box-shadow: var(--shadow-xs);
}
.exp-item.lv-expired { border-left-color: var(--red); }
.exp-item.lv-urgent { border-left-color: #e8590c; }
.exp-item.lv-warn { border-left-color: #f0a020; }
.exp-item.lv-watch { border-left-color: #aab4c5; }
.exp-main { flex: 1; min-width: 0; }
.exp-title { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.exp-title b { font-size: 14.5px; letter-spacing: -.01em; }
.exp-sub { margin-top: 2px; font-size: 11.5px; color: var(--ink-3); }
.exp-side {
  flex: 0 0 auto;
  text-align: center;
  font-size: 22px;
  font-weight: 750;
  line-height: 1.05;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}
.exp-side span { display: block; font-size: 10px; font-weight: 600; color: var(--ink-3); letter-spacing: .02em; }
.exp-side.lv-expired { color: var(--red); }
.exp-side.lv-urgent { color: #d9480f; }
.exp-side.lv-warn { color: var(--amber); }
.exp-ops { display: flex; gap: 5px; flex-wrap: wrap; flex: 0 0 auto; }

/* 报损单 */
.loss-card {
  padding: 14px 16px;
  margin-bottom: 10px;
  background: #fff;
  border: 1px solid #f2e2c8;
  border-radius: 14px;
}
.lc-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lc-head b { font-size: 14px; }
.lc-time { margin-left: auto; font-size: 11px; color: var(--ink-3); }
.lc-meta { margin-top: 5px; font-size: 12px; color: var(--ink-2); }
.lc-note {
  margin-top: 7px;
  padding: 7px 10px;
  border-radius: 8px;
  background: #f7f8fa;
  font-size: 12px;
  color: var(--ink-2);
}
.lc-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--ink-3);
}
.lc-ops { display: flex; gap: 6px; }

@media (max-width: 959px) {
  .split { grid-template-columns: 1fr; gap: 14px; }
  .split > .card + .card { margin-top: 0; }
}

@media (max-width: 720px) {
  .exp-item { flex-wrap: wrap; gap: 10px; }
  .exp-side { margin-left: auto; }
  .exp-ops { width: 100%; justify-content: flex-end; }
  .exp-summary { gap: 8px; }
  .es-item { padding: 10px 12px; }
  .es-item b { font-size: 19px; }
}

@media (max-width: 420px) {
  .exp-summary { grid-template-columns: 1fr 1fr; }
}
.sync-dot {
  display: inline-block;
  width: 6px; height: 6px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 2px rgba(11, 122, 75, .14);
  vertical-align: 1px;
}
.sync-dot.cloud { background: #2563eb; box-shadow: 0 0 0 2px rgba(37, 99, 235, .16); }
.sync-dot.danger { background: var(--red); box-shadow: 0 0 0 2px rgba(200, 16, 46, .16); }

@media (max-width: 720px) {
  .seg { flex-wrap: wrap; overflow: visible; }
  .seg button { padding: 6px 9px; }
}
.note { flex-wrap: wrap; }
.note .btn { margin-top: 2px; }
