/* ==========================================================================
   FENTILA 店员调价 — Authentic Retail Mini-Program & Mobile App Workbench
   ========================================================================== */
:root {
  /* Warm Architectural Neutrals (Unified Hue Family) */
  --page-top: #F2EFE9;
  --page-mid: #E5E0D7;
  --page-bot: #D9D3C8;
  --canvas: #FAF8F5;
  --canvas-pane: #F7F5F0;
  --rail-bg: #EFECE6;
  --surface: #FFFFFF;
  --surface-glass: rgba(255, 255, 255, 0.88);
  --header-glass: rgba(250, 248, 245, 0.90);
  --sunken: #F0EDE7;
  --sunken-2: #E6E1D9;
  --placeholder: #EBE6DE;

  /* Hairlines (Warm Charcoal Tint) */
  --hairline: rgba(34, 28, 24, 0.075);
  --hairline-strong: rgba(34, 28, 24, 0.135);

  /* Ink */
  --ink: #1C1917;
  --ink-2: #443F3B;
  --ink-3: #5F5953;
  --ink-4: #76706A;

  /* Brand Terracotta / Espresso Accent */
  --accent: #9A4E32;
  --accent-strong: #7D3B23;
  --accent-soft: #F6ECE6;
  --accent-soft-2: #EFE0D7;
  --accent-line: rgba(154, 78, 50, 0.30);

  /* Semantic States */
  --ok: #1D7A4C;
  --ok-bg: #E5F4EC;
  --ok-line: rgba(29, 122, 76, 0.22);
  --warn: #945205;
  --warn-bg: #FCF0DC;
  --warn-line: rgba(148, 82, 5, 0.24);
  --danger: #B43225;
  --danger-bg: #FCE9E6;
  --danger-line: rgba(180, 50, 37, 0.24);

  /* Radii, Tinted Shadows & Motion */
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 14px;
  --r-xl: 16px;
  --shadow-1: 0 1px 2px rgba(34, 26, 20, 0.045);
  --shadow-2: 0 3px 8px -1px rgba(34, 26, 20, 0.075);
  --shadow-sheet: 0 -6px 20px rgba(28, 22, 18, 0.14);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 180ms;

  /* Z-Index Scale */
  --z-chrome: 15;
  --z-sheet: 40;
  --z-drawer: 60;
  --z-toast: 80;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
}

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

button {
  -webkit-appearance: none;
  appearance: none;
}

input,
textarea {
  user-select: text;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.num,
.mono {
  font-variant-numeric: tabular-nums;
}

.mono {
  font-family: var(--font-mono);
}

/* Hide desktop scrollbars inside mobile app containers for authentic App feel */
.grid-pane,
.history-scroll,
.sheet-body,
.diff-list,
.category-rail {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.grid-pane::-webkit-scrollbar,
.history-scroll::-webkit-scrollbar,
.sheet-body::-webkit-scrollbar,
.diff-list::-webkit-scrollbar,
.category-rail::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

/* --------------------------------------------------------------------------
   0. App Shell & Desktop Mobile-Device Hardware Bezel
   -------------------------------------------------------------------------- */
.app-shell {
  position: relative;
  width: 100%;
  height: 100dvh;
  background: var(--canvas);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.device-statusbar,
.home-indicator {
  display: none;
}

@media (min-width: 540px) {
  body {
    background:
      radial-gradient(960px 580px at 50% 0%, rgba(255, 253, 249, 0.85) 0%, rgba(255, 253, 249, 0) 70%),
      linear-gradient(180deg, var(--page-top) 0%, var(--page-mid) 56%, var(--page-bot) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
  }

  .app-shell {
    width: 428px;
    max-width: 100%;
    height: min(94dvh, 896px);
    border-radius: 44px;
    box-shadow:
      0 0 0 1.5px #33302E,
      0 0 0 9px #191817,
      0 0 0 10.5px #57524D,
      0 30px 72px -12px rgba(28, 22, 17, 0.34),
      0 10px 26px -6px rgba(28, 22, 17, 0.16);
  }

  /* Simulated iOS Status Bar + Dynamic Island */
  .device-statusbar {
    flex-shrink: 0;
    height: 40px;
    padding: 10px 26px 4px;
    background: var(--header-glass);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    z-index: var(--z-chrome);
  }

  .status-time {
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ink);
    line-height: 1;
    justify-self: start;
  }

  .dynamic-island {
    width: 98px;
    height: 25px;
    border-radius: 999px;
    background: #0E0E10;
    box-shadow: inset 0 0 0 0.75px rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 8px;
    gap: 6px;
  }

  .island-sensor {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #1B1C22;
  }

  .island-lens {
    width: 8.5px;
    height: 8.5px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #2D3E66 0%, #141A29 55%, #090B10 100%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  }

  .status-icons {
    justify-self: end;
    display: inline-flex;
    align-items: center;
    gap: 5.5px;
    color: var(--ink);
  }

  .status-svg.is-signal {
    width: 15px;
    height: 10.5px;
  }

  .status-svg.is-wifi {
    width: 14px;
    height: 10.5px;
  }

  .status-battery {
    display: inline-flex;
    align-items: center;
    gap: 1.5px;
  }

  .status-battery-body {
    width: 21px;
    height: 10.5px;
    border-radius: 3.2px;
    border: 1.2px solid rgba(28, 25, 23, 0.42);
    padding: 1.3px;
    display: flex;
    align-items: stretch;
  }

  .status-battery-fill {
    display: block;
    width: 86%;
    border-radius: 1.4px;
    background: var(--ink);
  }

  .status-battery-cap {
    display: block;
    width: 1.5px;
    height: 4px;
    border-radius: 0 1.5px 1.5px 0;
    background: rgba(28, 25, 23, 0.42);
  }

  /* Bottom iOS Home Indicator */
  .home-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 16px;
    padding-bottom: 4px;
    background: transparent;
  }

  .home-indicator span {
    width: 126px;
    height: 4.5px;
    border-radius: 999px;
    background: rgba(28, 25, 23, 0.22);
  }
}

/* --------------------------------------------------------------------------
   1. Authentic Mini-Program Navigation Header
   -------------------------------------------------------------------------- */
.top-header {
  flex-shrink: 0;
  padding: calc(8px + var(--safe-top)) 14px 7px;
  background: var(--canvas);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  z-index: var(--z-chrome);
}

@media (min-width: 540px) {
  .top-header {
    padding-top: 4px;
  }
}

.brand-cluster {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.brand-monogram {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(155deg, #2D2622 0%, #171412 100%);
  color: #FAF6F0;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(28, 22, 18, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.brand-title-group {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

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

.brand-mark {
  font-size: 16.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--ink);
  line-height: 1.1;
}

.brand-pill {
  display: inline-flex;
  align-items: center;
  padding: 1.5px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid rgba(154, 78, 50, 0.16);
  color: var(--accent-strong);
  font-size: 10.5px;
  font-weight: 650;
  line-height: 1.3;
  white-space: nowrap;
}

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

.brand-sub-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin-top: 2px;
}

.brand-sub {
  font-size: 11px;
  color: var(--ink-3);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Official WeChat Mini-Program Right Capsule (84x30) */
.mp-capsule {
  position: relative;
  width: 84px;
  height: 30px;
  padding: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(28, 25, 23, 0.11);
  box-shadow: 0 1px 3px rgba(28, 22, 18, 0.04);
  display: inline-grid;
  grid-template-columns: 1fr 1px 1fr;
  align-items: center;
  color: var(--ink);
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.mp-capsule:hover {
  background: #FFFFFF;
}

.mp-capsule:active {
  background: var(--sunken);
  transform: scale(0.96);
}

.mp-capsule-half {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.mp-capsule-dots {
  display: inline-flex;
  align-items: center;
  gap: 2.5px;
}

.mp-capsule-dots i {
  width: 3.5px;
  height: 3.5px;
  border-radius: 50%;
  background: var(--ink);
  display: block;
}

.mp-capsule-dots i:nth-child(2) {
  width: 4.5px;
  height: 4.5px;
}

.mp-capsule-divider {
  width: 1px;
  height: 15px;
  background: rgba(28, 25, 23, 0.13);
}

.mp-capsule-ring {
  width: 14.5px;
  height: 14.5px;
  border-radius: 50%;
  border: 1.6px solid var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mp-capsule-ring::after {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ink);
}

.conn-dot {
  position: absolute;
  top: -2px;
  right: -1px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid var(--canvas);
  background: #D98A1B;
  transition: background var(--dur) var(--ease);
}

.conn-dot.is-online {
  background: var(--ok);
}

/* --------------------------------------------------------------------------
   2. Header Revision Status Pill (Global Scope Locked — Store Picker Removed)
   -------------------------------------------------------------------------- */
.top-header {
  border-bottom: 1px solid var(--hairline);
}

.rev-pill {
  flex: none;
  height: 19px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  padding: 0 6.5px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 650;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.rev-pill:active {
  transform: scale(0.97);
}

.rev-pill::before {
  content: "";
  width: 5.5px;
  height: 5.5px;
  border-radius: 50%;
  background: var(--ink-4);
}

.rev-pill.is-synced {
  background: var(--ok-bg);
  border-color: var(--ok-line);
  color: var(--ok);
}

.rev-pill.is-synced::before {
  background: var(--ok);
  box-shadow: 0 0 0 2.5px rgba(29, 122, 76, 0.16);
}

.rev-pill.is-offline {
  background: var(--warn-bg);
  border-color: var(--warn-line);
  color: var(--warn);
}

.rev-pill.is-offline::before {
  background: #D98A1B;
}

.rev-chev {
  opacity: 0.7;
  margin-left: -1px;
  font-size: 13px;
}

/* --------------------------------------------------------------------------
   3. Views & Shelf Workbench
   -------------------------------------------------------------------------- */
.views {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--canvas-pane);
}

.view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  animation: viewIn var(--dur) var(--ease);
}

@keyframes viewIn {
  from { opacity: 0.55; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

/* Native App Sunken Search Bar */
.search-bar {
  flex-shrink: 0;
  padding: 9px 14px 9px;
  background: var(--canvas);
  border-bottom: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-bar .search-input-wrap {
  flex: 1;
  min-width: 0;
}

.shelf-history-btn {
  position: relative;
  flex-shrink: 0;
  height: 37px;
  padding: 0 10px;
  border-radius: 11px;
  border: 1px solid var(--hairline-strong);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease), transform 120ms var(--ease);
}

.shelf-history-btn:hover {
  border-color: var(--accent-line);
  color: var(--ink);
}

.shelf-history-btn:active {
  background: var(--sunken);
  transform: scale(0.97);
}

.shelf-history-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--ink-3);
}

.shelf-history-btn:hover .shelf-history-icon {
  color: var(--accent);
}

.shelf-history-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.search-input-wrap {
  width: 100%;
  height: 37px;
  background: var(--sunken);
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 0 9px 0 11px;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.search-input-wrap:focus-within {
  background: var(--surface);
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-input-wrap.is-compact {
  height: 35px;
}

.search-icon {
  width: 15px;
  height: 15px;
  color: var(--ink-3);
  flex-shrink: 0;
}

.search-input-wrap:focus-within .search-icon {
  color: var(--accent);
}

.search-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.search-input:focus-visible {
  outline: none;
}

.search-input::placeholder {
  color: var(--ink-3);
  font-weight: 400;
}

.search-input::-webkit-search-cancel-button {
  display: none;
}

.search-kbd-hint {
  flex-shrink: 0;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(34, 28, 24, 0.07);
  color: var(--ink-3);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.3;
  pointer-events: none;
}

.search-input-wrap:focus-within .search-kbd-hint {
  display: none;
}

.search-clear-btn {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: var(--sunken-2);
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.search-clear-btn svg {
  width: 10px;
  height: 10px;
}

/* Split Shelf Layout */
.split-body {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

.category-rail {
  width: 82px;
  flex-shrink: 0;
  background: var(--rail-bg);
  border-right: 1px solid var(--hairline);
  overflow-y: auto;
  padding: 6px 0 24px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.cat-tab {
  position: relative;
  width: 100%;
  min-height: 48px;
  padding: 8px 6px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

.cat-tab:active {
  background: rgba(34, 28, 24, 0.04);
}

.cat-tab.is-active {
  background: var(--canvas-pane);
  color: var(--ink);
  font-weight: 700;
}

.cat-tab.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3.5px;
  height: 18px;
  border-radius: 0 4px 4px 0;
  background: var(--accent);
}

.cat-count-badge {
  min-width: 16px;
  height: 16px;
  padding: 0 4.5px;
  border-radius: 999px;
  background: var(--accent);
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Right Product Pane */
.grid-pane {
  flex: 1;
  min-width: 0;
  background: var(--canvas-pane);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 10px 18px;
}

.pane-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 2px 8px;
}

.pane-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.pane-meta {
  font-size: 11px;
  color: var(--ink-3);
  white-space: nowrap;
}

.search-banner {
  margin-bottom: 9px;
  padding: 7px 10px;
  border-radius: var(--r-sm);
  background: var(--accent-soft);
  border: 1px solid rgba(154, 78, 50, 0.14);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 550;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.search-banner button {
  border: none;
  background: var(--surface);
  color: var(--accent-strong);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
  padding: 2px 8px;
  box-shadow: var(--shadow-1);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  align-content: start;
}

.product-card {
  background: var(--surface);
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-1);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}

@media (hover: hover) {
  .product-card:hover {
    border-color: var(--hairline-strong);
    box-shadow: var(--shadow-2);
    transform: translateY(-1px);
  }
}

.product-card:active {
  transform: scale(0.982);
}

.product-card.is-changed,
.product-card.is-modified {
  border-color: var(--accent-line);
  box-shadow: 0 2px 6px rgba(154, 78, 50, 0.08);
}

.card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  background: var(--placeholder);
  overflow: hidden;
}

.card-media::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 40%;
  background: linear-gradient(180deg, rgba(20, 16, 14, 0) 0%, rgba(20, 16, 14, 0.28) 100%);
  pointer-events: none;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  opacity: 0;
  transition: opacity 220ms var(--ease);
}

.card-img.is-loaded {
  opacity: 1;
}

.card-img.is-error {
  display: none;
}

.badge-sku {
  position: absolute;
  z-index: 1;
  left: 6px;
  bottom: 6px;
  padding: 2px 6.5px;
  border-radius: 6px;
  background: rgba(24, 21, 19, 0.84);
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.45;
  max-width: calc(100% - 50px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge-colours {
  position: absolute;
  z-index: 1;
  right: 6px;
  bottom: 6px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink-2);
  font-size: 10px;
  font-weight: 650;
  line-height: 1.45;
}

.badge-state {
  position: absolute;
  z-index: 1;
  top: 6px;
  right: 6px;
  padding: 2.5px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--warn);
  background: rgba(252, 240, 220, 0.95);
  border: 1px solid rgba(166, 94, 6, 0.18);
  box-shadow: 0 1px 4px rgba(24, 20, 16, 0.08);
}

.badge-state.is-synced {
  color: var(--ok);
  background: rgba(229, 244, 236, 0.95);
  border-color: rgba(29, 122, 76, 0.18);
}

.card-body {
  padding: 8px 9px 9px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-title {
  margin: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.card-price-row.has-pending-actions {
  flex-wrap: wrap;
  row-gap: 6px;
}

.card-action-group {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.card-action-group .btn-edit-pill,
.card-action-group .btn-remove-pill {
  width: 100%;
  padding: 4px 0;
  text-align: center;
}

.btn-remove-pill {
  flex-shrink: 0;
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  padding: 3.5px 9.5px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}

@media (hover: hover) {
  .btn-remove-pill:hover {
    background: #FFF1F0;
    border-color: rgba(180, 35, 24, 0.28);
    color: #B42318;
  }
}

.btn-remove-pill:active {
  background: var(--sunken);
  transform: scale(0.95);
}

.price-cluster {
  display: flex;
  align-items: baseline;
  gap: 3.5px;
  min-width: 0;
  overflow: hidden;
}

.price-current {
  color: var(--accent);
  font-size: 15.5px;
  font-weight: 750;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.price-current .yen {
  font-size: 11px;
  font-weight: 700;
  margin-right: 1px;
}

.price-origin {
  color: var(--ink-3);
  font-size: 10.5px;
  text-decoration: line-through;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.price-multi-tag {
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-size: 9.5px;
  font-weight: 650;
  padding: 1px 4.5px;
  border-radius: 4px;
  white-space: nowrap;
}

.btn-edit-pill {
  flex-shrink: 0;
  border: 1px solid rgba(154, 78, 50, 0.18);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  padding: 3.5px 9.5px;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.3;
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur) var(--ease);
}

@media (hover: hover) {
  .btn-edit-pill:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #FFFFFF;
  }
}

.btn-edit-pill:active {
  background: var(--accent-strong);
  color: #FFFFFF;
  transform: scale(0.95);
}

.card-changed-at,
.card-modified-date {
  margin: 0;
  padding-top: 5px;
  border-top: 1px solid var(--hairline);
  font-size: 10.5px;
  font-weight: 550;
  line-height: 1.3;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.empty-state {
  padding: 44px 20px;
  text-align: center;
}

.empty-state-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 10px;
  border-radius: 14px;
  background: var(--sunken);
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.empty-state-icon svg {
  width: 22px;
  height: 22px;
}

.empty-state-title {
  font-size: 14px;
  font-weight: 650;
  color: var(--ink);
  margin: 0 0 5px;
}

.empty-state-desc {
  font-size: 12px;
  color: var(--ink-3);
  margin: 0 auto 14px;
  line-height: 1.55;
  max-width: 24em;
}

.empty-state-btn {
  border: 1px solid var(--hairline-strong);
  background: var(--surface);
  color: var(--ink);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 12.5px;
  font-weight: 650;
  box-shadow: var(--shadow-1);
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   3b. 改价历史 View
   -------------------------------------------------------------------------- */
.history-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 0 22px;
}

.history-head {
  padding: 9px 14px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.history-head-text {
  flex: 1;
  min-width: 0;
}

.history-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.25;
}

.history-sub {
  margin: 0;
  font-size: 12px;
  font-weight: 550;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hx-window {
  display: inline-flex;
  align-items: center;
  background: var(--sunken);
  border-radius: 9px;
  padding: 2.5px;
  gap: 2px;
  flex-shrink: 0;
}

.hx-window-btn {
  border: none;
  border-radius: 7px;
  height: 26px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 600;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.hx-window-btn.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(28, 22, 18, 0.08);
}

/* Modern Bill-Style History List */
.hx-list {
  padding: 0 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hx-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 2px 6px;
  font-size: 12px;
  color: var(--ink-3);
}

.hx-day-head strong {
  font-weight: 650;
  color: var(--ink-2);
}

.hx-card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}

.hx-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
}

.hx-row + .hx-row {
  border-top: 1px solid var(--hairline);
}

.hx-thumb {
  width: 44px;
  height: 58px;
  border-radius: 7px;
  background: var(--placeholder);
  object-fit: cover;
  object-position: top center;
  flex-shrink: 0;
}

.hx-thumb.is-blank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
  font-size: 10.5px;
  font-weight: 650;
}

.hx-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hx-top {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.hx-colour {
  flex-shrink: 0;
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--sunken);
  color: var(--ink-2);
  font-size: 10.5px;
  font-weight: 600;
}

.hx-title {
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hx-price {
  margin-top: 1px;
}

.hx-note {
  margin: 0;
  font-size: 11.5px;
  color: var(--ink-3);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hx-side {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
}

.hx-meta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.hx-time {
  font-size: 11.5px;
  color: var(--ink-3);
}

.hx-status {
  display: inline-flex;
  align-items: center;
  gap: 3.5px;
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
}

.hx-status::before {
  content: "";
  width: 4.5px;
  height: 4.5px;
  border-radius: 50%;
  background: currentColor;
}

.hx-status.is-synced {
  background: var(--ok-bg);
  color: var(--ok);
}

.hx-status.is-pending {
  background: var(--warn-bg);
  color: var(--warn);
}

.hx-empty {
  margin-top: 18px;
}

.icon-btn {
  width: 33px;
  height: 33px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--ink-2);
  box-shadow: var(--shadow-1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.icon-btn svg {
  width: 16.5px;
  height: 16.5px;
}

.icon-btn:active {
  background: var(--sunken);
  transform: scale(0.94);
}

.icon-btn.is-spinning svg {
  animation: spin 0.8s linear infinite;
}

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

.history-kpis {
  margin: 0 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-1);
}

.kpi {
  padding: 10px 12px 11px;
  min-width: 0;
}

.kpi + .kpi {
  border-left: 1px solid var(--hairline);
}

.kpi-label {
  font-size: 11px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-value {
  margin: 2px 0 0;
  font-size: 19px;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.kpi.is-pending .kpi-value {
  color: var(--warn);
}

.history-tools {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 9px 14px 9px;
  background: var(--canvas-pane);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.history-tools .search-input-wrap {
  flex: 1;
  min-width: 0;
}

.history-sheet {
  height: 84%;
  max-height: 88%;
}

.history-sheet-header {
  align-items: center;
  padding: 10px 14px 10px 16px;
}

.history-sheet-title-wrap {
  flex: 1;
  min-width: 0;
}

.history-sheet-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.history-sheet-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--canvas-pane);
}

.history-tools.is-stuck {
  border-bottom: 1px solid var(--hairline);
}

.segmented {
  display: flex;
  background: var(--sunken);
  border-radius: 11px;
  padding: 3px;
  gap: 2px;
}

.segmented-btn {
  flex: 1;
  border: none;
  border-radius: 8.5px;
  height: 29px;
  padding: 0 6px;
  font-size: 12.5px;
  font-weight: 550;
  background: transparent;
  color: var(--ink-2);
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.segmented-btn.is-active {
  background: var(--surface);
  color: var(--ink);
  font-weight: 650;
  box-shadow: 0 1px 2px rgba(28, 22, 18, 0.08), 0 0 0 0.5px var(--hairline);
}

.history-notice {
  margin: 0 14px 8px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  color: var(--warn);
  font-size: 12px;
  line-height: 1.5;
}

/* Timeline */
.timeline {
  padding: 0 14px;
}

.tl-day {
  margin: 6px 0 2px;
}

.tl-day-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 0 8px;
  font-size: 12px;
  font-weight: 650;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.tl-day-head span {
  font-weight: 500;
  color: var(--ink-3);
}

.tl-list {
  list-style: none;
  margin: 0;
  padding: 0 0 0 14px;
  position: relative;
}

.tl-list::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 6px;
  bottom: 14px;
  width: 1px;
  background: var(--hairline-strong);
}

.tl-item {
  position: relative;
  padding-bottom: 12px;
}

.tl-item::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--canvas-pane);
  border: 1.5px solid var(--ink-4);
}

.tl-item.is-synced::before {
  border-color: var(--ok);
  background: var(--ok);
}

.tl-item.is-pending::before {
  border-color: #D98A1B;
  background: var(--canvas-pane);
}

.tl-item.is-batch::before {
  border-color: var(--ink);
  background: var(--ink);
}

.tl-time {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 12px;
  line-height: 1.3;
}

.tl-time time {
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  font-weight: 650;
  letter-spacing: 0.01em;
}

.tl-kind {
  color: var(--ink-3);
}

.tl-card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-1);
  padding: 10px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.tl-thumb {
  width: 44px;
  height: 58px;
  border-radius: var(--r-xs);
  background: var(--placeholder);
  object-fit: cover;
  object-position: top center;
  flex-shrink: 0;
}

.tl-thumb.is-blank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
  font-size: 11px;
}

.tl-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.tl-row1 {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.sku-pill {
  flex-shrink: 0;
  padding: 1px 6px;
  border-radius: var(--r-xs);
  background: var(--ink);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
}

.tl-title {
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tl-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 19px;
  padding: 0 6px;
  border-radius: 5px;
  background: var(--sunken);
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.tag.is-scope {
  background: transparent;
  border: 1px solid var(--hairline-strong);
  color: var(--ink-3);
}

.tag.is-local {
  background: var(--warn-bg);
  color: var(--warn);
}

.tl-price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 5px;
  font-variant-numeric: tabular-nums;
}

.tl-price del {
  color: var(--ink-3);
  font-size: 12.5px;
}

.tl-price .arrow {
  color: var(--ink-4);
  font-size: 12px;
}

.tl-price strong {
  color: var(--accent);
  font-size: 15px;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.tl-price .restore-label {
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 600;
}

.delta {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  align-self: center;
}

.delta.is-down {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.delta.is-up,
.delta.is-restore {
  background: var(--sunken);
  color: var(--ink-2);
}

.tl-note {
  margin: 0;
  font-size: 11.5px;
  color: var(--ink-3);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.tl-side {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.sync-pill::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.sync-pill.is-synced {
  background: var(--ok-bg);
  color: var(--ok);
}

.sync-pill.is-pending {
  background: var(--warn-bg);
  color: var(--warn);
}

.sync-pill.is-muted {
  background: var(--sunken);
  color: var(--ink-3);
}

.btn-reedit {
  border: 1px solid var(--hairline-strong);
  background: var(--surface);
  color: var(--ink);
  border-radius: 999px;
  height: 26px;
  padding: 0 10px;
  font-size: 11.5px;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--dur) var(--ease);
}

.btn-reedit:active {
  background: var(--sunken);
}

.tl-card.is-batch {
  background: var(--surface);
}

.batch-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--ink);
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.batch-icon.is-rollback {
  background: var(--sunken);
  color: var(--ink);
}

.batch-icon svg {
  width: 16px;
  height: 16px;
}

.batch-release {
  font-size: 13px;
  font-weight: 650;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.batch-meta {
  margin: 0;
  font-size: 11.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.batch-items {
  list-style: none;
  margin: 2px 0 0;
  padding: 6px 0 0;
  border-top: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.batch-items li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.batch-items li span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-items li span:last-child {
  flex-shrink: 0;
  color: var(--ink);
  font-weight: 600;
}

.batch-items del {
  color: var(--ink-3);
  font-weight: 400;
  margin-right: 3px;
}

/* --------------------------------------------------------------------------
   3c. 销售数据分析中心 (2-Section Hub: AI分析 · 诊断销售)
   -------------------------------------------------------------------------- */
.view-analytics {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--canvas-pane);
}

.hub-nav {
  flex-shrink: 0;
  padding: 7px 14px 8px;
  background: var(--canvas);
  border-bottom: 1px solid var(--hairline);
}

.hub-seg {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  background: var(--sunken);
}

.hub-tab {
  border: none;
  border-radius: 7.5px;
  height: 30px;
  padding: 0 6px;
  background: transparent;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.hub-tab:active {
  opacity: 0.82;
}

.hub-tab.is-active,
.hub-tab[aria-selected="true"] {
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(28, 22, 18, 0.08);
}

.hub-panes {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.hub-pane {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.hub-mount {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   4. Unified OS Bottom Chrome: Floating Sync Capsule + 2-Tab App Dock
   -------------------------------------------------------------------------- */
.os-bottom {
  flex-shrink: 0;
  position: relative;
  z-index: var(--z-chrome);
  background: var(--surface);
  border-top: 1px solid var(--hairline);
}

.sync-bar-wrap {
  display: none;
  position: relative;
  padding: 7px 10px 3px;
}

.sync-bar-wrap[hidden],
.sync-bar-wrap[data-has-pending="false"] {
  display: none !important;
}

.app-shell[data-view="shelf"][data-has-pending="true"] .sync-bar-wrap:not([hidden]),
.app-shell[data-view="analytics"][data-hub="diag"][data-has-pending="true"] .sync-bar-wrap:not([hidden]) {
  display: block;
}

/* Taobao-style slide-up pending price-edit cart drawer */
.pending-cart-drawer {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: calc(100% + 4px);
  z-index: 5;
  background: var(--surface);
  border: 1px solid var(--hairline-strong);
  border-radius: 14px;
  box-shadow: 0 -6px 24px rgba(24, 20, 18, 0.14), 0 4px 12px rgba(24, 20, 18, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: min(52vh, 320px);
  animation: cartDrawerUp 180ms var(--ease);
}

.pending-cart-drawer[hidden] {
  display: none !important;
}

@keyframes cartDrawerUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.pending-cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background: linear-gradient(180deg, #FFFDFB 0%, #FAF5F1 100%);
  border-bottom: 1px solid var(--hairline);
  flex-shrink: 0;
}

.pending-cart-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.pending-cart-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.pending-cart-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  height: 19px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.pending-cart-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.pending-cart-clear-btn {
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--hairline-strong);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}

.pending-cart-clear-btn:active {
  background: var(--sunken);
}

.pending-cart-close-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: var(--sunken);
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.pending-cart-close-btn:active {
  background: var(--sunken-2);
}

.pending-cart-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 12px 6px;
}

.pending-cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 0;
}

.pending-cart-item + .pending-cart-item {
  border-top: 1px solid var(--hairline);
}

.pending-cart-item-info {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.pending-cart-item-head {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.pending-cart-item-sku {
  flex-shrink: 0;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--ink);
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.pending-cart-item-title {
  min-width: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pending-cart-item-colour {
  flex-shrink: 0;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--sunken);
  color: var(--ink-2);
  font-size: 10px;
  font-weight: 600;
}

.pending-cart-item-price {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.pending-cart-item-price del {
  color: var(--ink-3);
  font-size: 11.5px;
}

.pending-cart-item-price .arrow {
  color: var(--ink-4);
  font-size: 11px;
}

.pending-cart-item-price strong {
  color: var(--accent);
  font-size: 13.5px;
  font-weight: 750;
}

.pending-cart-item-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.pending-cart-edit-btn {
  flex-shrink: 0;
  height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid rgba(154, 78, 50, 0.22);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 11.5px;
  font-weight: 650;
  cursor: pointer;
}

.pending-cart-edit-btn:active {
  background: var(--accent);
  color: #FFFFFF;
}

.pending-cart-remove-btn {
  flex-shrink: 0;
  height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid var(--hairline-strong);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}

.pending-cart-remove-btn:active {
  background: var(--sunken);
}

.sync-bar {
  padding: 7px 8px 7px 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, #FFFDFB 0%, #FBF3EE 100%);
  border: 1px solid var(--accent-line);
  box-shadow: 0 4px 14px rgba(154, 78, 50, 0.14);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}

.sync-cart-trigger {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  border-radius: 999px;
  padding: 2px 4px 2px 2px;
  user-select: none;
}

.sync-cart-trigger:active {
  opacity: 0.82;
}

.sync-cart-icon-wrap {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

.sync-state-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sync-state-icon svg {
  width: 17px;
  height: 17px;
}

.cart-badge {
  position: absolute;
  top: -3px;
  right: -4px;
  min-width: 17px;
  height: 17px;
  padding: 0 4.5px;
  border-radius: 999px;
  background: var(--accent);
  color: #FFFFFF;
  border: 1.5px solid #FFFDFB;
  font-size: 10px;
  font-weight: 750;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}

.sync-status {
  min-width: 0;
  flex: 1;
}

.sync-status-title {
  margin: 0 0 1px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sync-status-sub {
  margin: 0;
  font-size: 11px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-sync-cta {
  flex-shrink: 0;
  height: 33px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 14px;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--ink-3);
  background: var(--sunken);
  cursor: default;
  white-space: nowrap;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.btn-sync-cta.is-active {
  background: linear-gradient(180deg, #A9583A 0%, #8B4227 100%);
  color: #FFFFFF;
  box-shadow: 0 3px 10px rgba(154, 78, 50, 0.28);
  cursor: pointer;
}

.btn-sync-cta.is-active:active {
  transform: scale(0.97);
}

.btn-sync-cta.is-preview {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--hairline-strong);
  box-shadow: var(--shadow-1);
  cursor: pointer;
}

.btn-sync-cta.is-preview:active {
  background: var(--sunken);
}

.btn-sync-cta:disabled {
  cursor: progress;
  opacity: 0.85;
}

/* 2-Tab Native Bottom Navigation Dock */
.os-dock {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 5px 14px calc(4px + var(--safe-bottom));
}

.dock-tab {
  position: relative;
  border: none;
  background: transparent;
  padding: 5px 4px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--ink-3);
  cursor: pointer;
  border-radius: 12px;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.dock-tab:active {
  transform: scale(0.96);
}

.dock-tab.is-active {
  color: var(--accent-strong);
}

.dock-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 26px;
  border-radius: 999px;
  transition: background var(--dur) var(--ease);
}

.dock-tab.is-active .dock-icon-wrap {
  background: var(--accent-soft);
}

.dock-icon {
  width: 21px;
  height: 21px;
  transition: transform var(--dur) var(--ease);
}

.dock-tab.is-active .dock-icon {
  transform: translateY(-0.5px);
}

.dock-tab.is-active .dock-icon rect,
.dock-tab.is-active .dock-icon circle {
  fill: rgba(154, 78, 50, 0.16);
}

.dock-label {
  font-size: 11px;
  font-weight: 550;
  line-height: 1.15;
  letter-spacing: 0.01em;
}

.dock-tab.is-active .dock-label {
  font-weight: 700;
  color: var(--ink);
}

/* Shelf pending count badge on Tab 1 */
.dock-count {
  position: absolute;
  top: -3px;
  left: calc(50% + 6px);
  min-width: 16px;
  height: 16px;
  padding: 0 4.5px;
  border-radius: 999px;
  background: var(--accent);
  color: #FFFFFF;
  border: 1.5px solid #FFFFFF;
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* History pending dot on Tab 2 */
.dock-dot {
  position: absolute;
  top: 1px;
  right: 9px;
  width: 7.5px;
  height: 7.5px;
  border-radius: 50%;
  background: #D98A1B;
  border: 1.5px solid #FFFFFF;
}

/* 销存诊断 Alert Dot & Badge on Tab 3 (Moved to Bottom-Right Dock) */
.dock-tab-diag .diag-dot {
  position: absolute;
  top: 2px;
  left: 9px;
  width: 6.5px;
  height: 6.5px;
  border-radius: 50%;
  background: var(--ink-4);
  display: none;
}

.dock-tab-diag:has(.diag-badge:empty) .diag-dot {
  display: block;
}

.diag-dot.is-warn {
  background: #D98A1B;
}

.diag-dot.is-critical {
  background: var(--danger);
}

.diag-dot.is-ok {
  background: var(--ok);
}

.dock-tab-diag .diag-badge {
  position: absolute;
  top: -4px;
  left: calc(50% + 4px);
  display: inline-flex;
  align-items: center;
  height: 16.5px;
  padding: 0 5.5px;
  border-radius: 999px;
  background: var(--warn-bg);
  color: var(--warn);
  border: 1.5px solid #FFFFFF;
  box-shadow: 0 1px 4px rgba(28, 22, 18, 0.12);
  font-size: 9.5px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
}

.dock-tab-diag .diag-badge:empty {
  display: none;
}

.dock-tab-diag.is-critical .diag-badge {
  background: var(--danger);
  color: #FFFFFF;
}

.dock-tab-diag.is-ok .diag-badge {
  background: var(--ok-bg);
  color: var(--ok);
}

/* --------------------------------------------------------------------------
   5. Bottom Sheets (Price Edit, Settings, Sync Receipt)
   -------------------------------------------------------------------------- */
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 20, 18, 0.42);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: var(--z-sheet);
  animation: fadeIn var(--dur) var(--ease);
}

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

.bottom-sheet {
  width: 100%;
  max-height: 88%;
  background: var(--canvas);
  border-radius: 16px 16px 0 0;
  box-shadow: var(--shadow-sheet);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: var(--safe-bottom);
  animation: sheetSlideUp 220ms var(--ease);
}

@keyframes sheetSlideUp {
  from { transform: translateY(26px); opacity: 0.65; }
  to { transform: translateY(0); opacity: 1; }
}

.sheet-handle {
  width: 38px;
  height: 4.5px;
  border-radius: 999px;
  background: var(--sunken-2);
  margin: 9px auto 0;
  flex-shrink: 0;
}

.sheet-header {
  padding: 10px 16px 12px;
  border-bottom: 1px solid var(--hairline);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.sheet-title {
  margin: 0 0 3px;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}

.sheet-sub {
  margin: 0;
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.5;
}

.receipt-title-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 3px;
}

.receipt-title-row .sheet-title {
  margin: 0;
}

.sheet-close-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--sunken);
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}

.sheet-close-btn svg {
  width: 11px;
  height: 11px;
}

.sheet-body {
  padding: 14px 16px 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  min-height: 0;
}

.sheet-footer {
  padding: 10px 16px 14px;
  border-top: 1px solid var(--hairline);
  background: var(--surface);
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

/* Price editing sheet */
.edit-product-head {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.edit-thumb {
  width: 52px;
  height: 69px;
  border-radius: var(--r-sm);
  background: var(--placeholder);
  object-fit: cover;
  object-position: top center;
  flex-shrink: 0;
  border: 1px solid var(--hairline);
}

.edit-meta {
  min-width: 0;
}

.edit-meta-title {
  margin: 0 0 3px;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ink);
}

.edit-meta-sku {
  font-size: 12px;
  color: var(--ink-2);
  margin: 0 0 4px;
  font-variant-numeric: tabular-nums;
}

.edit-meta-prices {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.edit-meta-prices strong {
  color: var(--accent);
  font-weight: 700;
}

.edit-suggest {
  margin: 0 0 12px;
  padding: 8px 11px;
  border-radius: var(--r-sm);
  background: var(--accent-soft);
  border: 1px solid rgba(154, 78, 50, 0.16);
  color: var(--accent-strong);
  font-size: 12px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

.mode-switch {
  display: flex;
  background: var(--sunken);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
  margin-bottom: 14px;
}

.mode-btn {
  flex: 1;
  border: none;
  border-radius: 8px;
  height: 32px;
  padding: 0 8px;
  font-size: 12.5px;
  font-weight: 550;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

.mode-btn.is-active {
  background: var(--surface);
  color: var(--ink);
  font-weight: 650;
  box-shadow: 0 1px 2px rgba(24, 24, 27, 0.08), 0 0 0 1px var(--hairline);
}

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

.uniform-input-card {
  background: var(--surface);
  border: 1.5px solid var(--hairline-strong);
  border-radius: var(--r-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.uniform-input-card:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.yen-prefix {
  font-size: 21px;
  font-weight: 700;
  color: var(--accent);
}

.price-main-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  font-size: 26px;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--ink);
  background: transparent;
  font-variant-numeric: tabular-nums;
}

.price-main-input:focus-visible {
  outline: none;
}

.price-main-input::placeholder {
  color: var(--ink-3);
  font-weight: 500;
  font-size: 18px;
}

.uniform-hint {
  font-size: 12px;
  color: var(--ink-3);
  margin: 0 0 14px;
}

/* Per-colour rows */
.colour-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.colour-row {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.colour-row.is-focused {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.colour-row-left {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  flex: 1;
}

.colour-row-thumb {
  width: 36px;
  height: 48px;
  border-radius: var(--r-xs);
  background: var(--placeholder);
  object-fit: cover;
  object-position: top center;
  flex-shrink: 0;
}

.colour-row-info {
  min-width: 0;
}

.colour-row-name {
  font-size: 13px;
  font-weight: 650;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.same-style-tag,
.lead-colour-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--sunken);
  color: var(--ink-2);
}

.same-style-tag {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.colour-row-sub {
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

.colour-row-input-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--canvas);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-sm);
  padding: 5px 8px;
  width: 104px;
  flex-shrink: 0;
}

.colour-row-input-wrap span {
  font-size: 13px;
  font-weight: 650;
  color: var(--accent);
}

.colour-price-input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.colour-price-input:focus-visible {
  outline: none;
}

/* Quick chips */
.quick-chips-label {
  font-size: 12px;
  color: var(--ink-2);
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-variant-numeric: tabular-nums;
}

.quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.chip-btn {
  border: 1px solid var(--hairline-strong);
  background: var(--surface);
  color: var(--ink);
  border-radius: 999px;
  height: 30px;
  padding: 0 12px;
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.chip-btn:active {
  background: var(--sunken);
}

.chip-btn.is-reset {
  color: var(--accent-strong);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  margin: 0 0 6px;
}

.text-input {
  width: 100%;
  height: 38px;
  border: 1px solid var(--hairline-strong);
  background: var(--surface);
  border-radius: 10px;
  padding: 0 12px;
  font-size: 13px;
  color: var(--ink);
  outline: none;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.text-input:focus-visible {
  outline: none;
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.text-input::placeholder {
  color: var(--ink-3);
}

.text-input.mono {
  font-size: 12.5px;
}

/* Modal Footer Buttons */
.btn-secondary {
  height: 42px;
  border: 1px solid var(--hairline-strong);
  background: var(--surface);
  color: var(--ink);
  border-radius: 999px;
  padding: 0 18px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}

.btn-secondary:active {
  background: var(--sunken);
}

.btn-primary {
  flex: 1;
  height: 42px;
  border: none;
  background: linear-gradient(180deg, #2B2522 0%, #191614 100%);
  color: #FFFFFF;
  border-radius: 999px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 650;
  box-shadow: 0 4px 12px rgba(28, 22, 18, 0.20);
  cursor: pointer;
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}

.btn-primary:active {
  transform: scale(0.985);
}

.btn-primary:disabled {
  background: var(--sunken-2);
  color: var(--ink-3);
  box-shadow: none;
  cursor: not-allowed;
}

.btn-secondary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Clean compact price header row (replaces removed 快捷调价 row) */
.price-input-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 8px;
}

.price-input-head .price-input-label {
  margin: 0;
}

.quick-reset-wrap {
  display: inline-flex;
  align-items: center;
}

.quick-reset-wrap .chip-btn.is-reset {
  height: 26px;
  padding: 0 10px;
  font-size: 11.5px;
  border-radius: 999px;
}

/* 3-Button Price Edit Modal Footer (390px mobile-friendly, zero wrap/clip) */
.edit-sheet-footer {
  padding: 10px 12px 14px;
  gap: 7px;
  align-items: center;
}

.edit-sheet-footer > .btn-secondary[data-close="edit"] {
  flex: 0 0 auto;
  height: 40px;
  padding: 0 13px;
  font-size: 13px;
  white-space: nowrap;
}

.edit-sheet-footer > .btn-save-draft {
  flex: 1 1 0;
  min-width: 0;
  height: 40px;
  padding: 0 8px;
  font-size: 12.5px;
  font-weight: 650;
  white-space: nowrap;
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.edit-sheet-footer > .btn-direct-sync {
  flex: 1 1 0;
  min-width: 0;
  height: 40px;
  padding: 0 8px;
  font-size: 12.5px;
  font-weight: 650;
  white-space: nowrap;
  background: linear-gradient(180deg, #A9583A 0%, #8B4227 100%);
  box-shadow: 0 3px 10px rgba(154, 78, 50, 0.24);
}

@media (max-width: 375px) {
  .edit-sheet-footer {
    padding: 10px 10px 14px;
    gap: 6px;
  }
  .edit-sheet-footer > .btn-secondary[data-close="edit"] {
    padding: 0 10px;
    font-size: 12px;
  }
  .edit-sheet-footer > .btn-save-draft,
  .edit-sheet-footer > .btn-direct-sync {
    padding: 0 6px;
    font-size: 11.5px;
  }
}

.link-btn {
  border: none;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  padding: 0;
}

/* Settings & Receipt Cards */
.status-card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  padding: 6px 12px;
  margin-bottom: 14px;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  color: var(--ink-2);
  padding: 7px 0;
}

.status-row + .status-row {
  border-top: 1px solid var(--hairline);
}

.status-value {
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
  text-align: right;
  min-width: 0;
  overflow-wrap: anywhere;
}

.status-value.mono {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-2);
}

.status-value.is-accent {
  color: var(--accent);
}

.status-value.is-ok {
  color: var(--ok);
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 650;
  font-size: 12.5px;
  color: var(--ink);
}

.status-indicator .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #D98A1B;
}

.status-indicator.is-online .dot {
  background: var(--ok);
}

.pill-pass {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--ok-bg);
  color: var(--ok);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.server-url-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.server-url-row .text-input {
  flex: 1;
  min-width: 0;
}

.btn-inline {
  border: none;
  border-radius: 10px;
  padding: 0 14px;
  background: var(--ink);
  color: #FFFFFF;
  font-size: 12.5px;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
}

.btn-inline:disabled {
  opacity: 0.6;
}

.lan-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.lan-chip {
  border: 1px solid var(--hairline-strong);
  background: var(--surface);
  color: var(--ink-2);
  border-radius: var(--r-sm);
  height: 28px;
  padding: 0 9px;
  font-size: 11.5px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.lan-chip.is-current {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 600;
}

.settings-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-action-row {
  width: 100%;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--r-md);
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  transition: background var(--dur) var(--ease);
}

.btn-action-row:active {
  background: var(--sunken);
}

.btn-action-row .row-hint {
  color: var(--ink-3);
  font-weight: 500;
}

.btn-action-row.is-danger {
  color: var(--danger);
  border-color: var(--danger-line);
  background: var(--surface);
}

.btn-action-row.btn-logout-row {
  color: var(--ink-2);
  border-color: var(--hairline-strong);
  background: var(--surface);
}

/* Settings Audit Log Collapsible Block (云端操作记录) */
.audit-fold-wrap {
  margin-bottom: 14px;
}

.audit-fold {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  overflow: hidden;
}

.audit-fold-head {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  cursor: pointer;
  user-select: none;
}

.audit-fold-head::-webkit-details-marker {
  display: none;
}

.audit-fold-title-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.audit-fold-chev {
  font-size: 11px;
  color: var(--ink-3);
  transition: transform var(--dur) var(--ease);
  display: inline-block;
}

.audit-fold[open] .audit-fold-chev {
  transform: rotate(90deg);
}

.audit-fold-title {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--ink);
}

.audit-fold-count {
  font-size: 11px;
  color: var(--ink-3);
}

.audit-refresh-btn {
  border: 1px solid var(--hairline-strong);
  background: var(--canvas);
  color: var(--ink-2);
  border-radius: 999px;
  height: 24px;
  padding: 0 9px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}

.audit-refresh-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.audit-fold-body {
  border-top: 1px solid var(--hairline);
  padding: 6px 12px 10px;
}

.audit-empty {
  margin: 6px 0 2px;
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.5;
}

.audit-list {
  display: flex;
  flex-direction: column;
  max-height: 220px;
  overflow-y: auto;
}

.audit-row {
  padding: 7px 0;
}

.audit-row + .audit-row {
  border-top: 1px solid var(--hairline);
}

.audit-row-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}

.audit-time {
  font-size: 11px;
  color: var(--ink-3);
}

.audit-client {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 10.5px;
  font-weight: 600;
}

.audit-fail-badge {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--danger-bg, rgba(180, 46, 46, 0.1));
  color: var(--danger);
  font-size: 10.5px;
  font-weight: 650;
}

.audit-summary {
  margin: 0;
  font-size: 12px;
  color: var(--ink);
  line-height: 1.45;
  word-break: break-word;
}

.audit-more-btn {
  margin-top: 6px;
  width: 100%;
  border: 1px dashed var(--hairline-strong);
  background: transparent;
  color: var(--accent-strong);
  border-radius: var(--r-sm);
  height: 28px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}

/* Cloud Access Gate Lockscreen (FENTILA 暖白锁屏遮罩) */
.auth-lock-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: radial-gradient(circle at 50% 18%, #FFFDFB 0%, #FAF8F5 58%, #F2ECE4 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-lock-overlay[hidden] {
  display: none !important;
}

.auth-lock-card {
  width: 100%;
  max-width: 360px;
  background: #FFFFFF;
  border: 1px solid rgba(124, 77, 58, 0.14);
  border-radius: 18px;
  padding: 28px 24px 22px;
  box-shadow: 0 18px 48px rgba(42, 31, 24, 0.10), 0 2px 8px rgba(42, 31, 24, 0.04);
  text-align: center;
}

.auth-lock-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.auth-lock-monogram {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(180deg, #9A4E32 0%, #7C4D3A 100%);
  color: #FAF8F5;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.auth-lock-wordmark {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #2B2420;
}

.auth-lock-title {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 700;
  color: #1F1A17;
  line-height: 1.35;
}

.auth-lock-sub {
  margin: 0 0 18px;
  font-size: 13px;
  color: #7A6E65;
}

.auth-lock-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}

.auth-lock-input-wrap {
  display: flex;
  align-items: center;
  background: #FAF8F5;
  border: 1.5px solid rgba(124, 77, 58, 0.22);
  border-radius: 11px;
  padding: 0 10px 0 12px;
  height: 44px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.auth-lock-input-wrap:focus-within {
  border-color: #8B4227;
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(154, 78, 50, 0.12);
}

.auth-lock-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14.5px;
  color: #1F1A17;
}

.auth-lock-toggle {
  border: none;
  background: transparent;
  color: #7A6E65;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 6px;
  cursor: pointer;
  flex-shrink: 0;
}

.auth-lock-error {
  margin: 0;
  font-size: 12px;
  color: #B42E2E;
  line-height: 1.45;
  padding: 0 2px;
}

.auth-lock-submit {
  width: 100%;
  height: 44px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(180deg, #9A4E32 0%, #7C3D26 100%);
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(139, 66, 39, 0.24);
  transition: opacity 150ms ease, transform 120ms ease;
}

.auth-lock-submit:active:not(:disabled) {
  transform: scale(0.985);
}

.auth-lock-submit:disabled {
  opacity: 0.65;
  cursor: default;
}

.auth-lock-foot {
  margin: 16px 0 0;
  font-size: 11.5px;
  color: #9A8F86;
}

.diff-list {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  padding: 4px 12px;
  max-height: 220px;
  overflow-y: auto;
}

.diff-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.diff-item + .diff-item {
  border-top: 1px solid var(--hairline);
}

.diff-item-left {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-2);
}

.diff-item-left strong {
  color: var(--ink);
  font-weight: 650;
}

.diff-item-right {
  flex-shrink: 0;
  font-weight: 700;
  color: var(--accent);
}

.diff-item-right del {
  color: var(--ink-3);
  font-weight: 400;
  margin-right: 4px;
}

/* --------------------------------------------------------------------------
   6. Preview Drawer & Toast
   -------------------------------------------------------------------------- */
.preview-drawer {
  position: absolute;
  inset: 0;
  background: var(--canvas);
  z-index: var(--z-drawer);
  display: flex;
  flex-direction: column;
  animation: drawerSlideIn 260ms var(--ease);
}

@keyframes drawerSlideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.preview-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: var(--canvas);
}

.toast {
  position: absolute;
  left: 50%;
  bottom: calc(84px + var(--safe-bottom));
  transform: translateX(-50%);
  max-width: 88%;
  width: max-content;
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(24, 21, 19, 0.94);
  color: #FFFFFF;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.45;
  text-align: center;
  z-index: var(--z-toast);
  box-shadow: 0 4px 12px rgba(24, 20, 18, 0.22);
  pointer-events: none;
  animation: toastIn 200ms var(--ease);
}

.app-shell[data-view="shelf"][data-has-pending="true"] .toast,
.app-shell[data-view="analytics"][data-hub="diag"][data-has-pending="true"] .toast {
  bottom: calc(140px + var(--safe-bottom));
}

@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 6px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* --------------------------------------------------------------------------
   Reduced Motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
