/* ==========================================================================
   加福加德 · 华东活动物料库
   ========================================================================== */

:root {
  --bg: #f6f1e8;
  --bg-deep: #efe6d7;
  --surface: #fffdf8;
  --surface-soft: #faf5eb;
  --ink: #2b241c;
  --ink-soft: #4c4135;
  --muted: #8a7b69;
  --muted-2: #a39481;
  --line: #e8ddcc;
  --line-strong: #d9c9b2;
  --brand: #a8492a;
  --brand-deep: #82341d;
  --brand-soft: #f8e9e1;
  --green: #2f6b4d;
  --green-soft: #e7f0e9;
  --amber: #b07a22;
  --amber-soft: #fbf0d7;
  --red: #b23a2a;
  --red-soft: #fbe7e2;
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --shadow-lg: 0 30px 70px rgba(69, 47, 24, 0.12);
  --shadow-sm: 0 8px 24px rgba(69, 47, 24, 0.06);
  --font-sans: "MiSans", "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
  --font-num: "Bahnschrift", "DIN Alternate", "SF Pro Display", "Segoe UI", var(--font-sans);
}

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

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

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(900px 600px at 8% -12%, #fcf4e4 0%, rgba(252, 244, 228, 0) 58%),
    radial-gradient(900px 520px at 100% 0%, #f2e3cd 0%, rgba(242, 227, 205, 0) 52%),
    var(--bg);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: 0.32;
  background-image: radial-gradient(rgba(89, 64, 36, 0.12) 0.6px, transparent 0.6px);
  background-size: 7px 7px;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 70%);
}

body.modal-open {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

::selection {
  color: #fff;
  background: rgba(168, 73, 42, 0.82);
}

.page-glow {
  position: fixed;
  z-index: -1;
  top: -240px;
  right: -180px;
  width: 720px;
  height: 720px;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(220, 161, 82, 0.2) 0%, rgba(220, 161, 82, 0) 66%);
}

/* --------------------------------------------------------------------------
   顶栏
   -------------------------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid rgba(218, 202, 179, 0.72);
  background: rgba(246, 241, 232, 0.86);
  backdrop-filter: saturate(1.4) blur(18px);
  -webkit-backdrop-filter: saturate(1.4) blur(18px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  width: min(1240px, calc(100% - 48px));
  min-height: 74px;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex: none;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  border-radius: 13px;
  color: #fff8ec;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.18), transparent 45%),
    linear-gradient(145deg, #b95432, #8a351f);
  box-shadow: 0 8px 18px rgba(137, 52, 30, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.15;
}

.brand-copy b {
  font-family: var(--font-serif);
  font-size: 19px;
  letter-spacing: 0.05em;
}

.brand-copy small {
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.16em;
}

.main-nav {
  display: flex;
  gap: 3px;
  margin-left: 8px;
  padding: 4px;
  border: 1px solid rgba(222, 208, 187, 0.8);
  border-radius: 13px;
  background: rgba(238, 229, 214, 0.72);
}

.nav-btn {
  position: relative;
  height: 35px;
  padding: 0 15px;
  border: 0;
  border-radius: 9px;
  color: #756654;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  transition: color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.nav-btn:hover {
  color: var(--ink);
}

.nav-btn.is-active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 3px 10px rgba(72, 51, 26, 0.09);
}

.topbar-tools {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-left: auto;
}

.sync-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-right: 3px;
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
}

.sync-state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3f8b63;
  box-shadow: 0 0 0 3px rgba(63, 139, 99, 0.13);
}

.sync-state.is-loading i {
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(176, 122, 34, 0.13);
  animation: pulse 1.2s ease-in-out infinite;
}

.sync-state.is-error {
  color: var(--red);
}

.sync-state.is-error i {
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(178, 58, 42, 0.13);
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.82); }
}

/* --------------------------------------------------------------------------
   按钮
   -------------------------------------------------------------------------- */

.btn,
.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 11px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.btn {
  height: 39px;
  padding: 0 15px;
  border: 1px solid transparent;
  color: #fff;
  font-size: 13px;
  box-shadow: 0 5px 14px rgba(60, 40, 20, 0.1);
}

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

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

.btn-in {
  background: linear-gradient(145deg, #3c7b5b, #2c6246);
}

.btn-in:hover {
  background: linear-gradient(145deg, #438766, #2f6b4d);
  box-shadow: 0 8px 18px rgba(47, 107, 77, 0.22);
}

.btn-out {
  background: linear-gradient(145deg, #b45532, #953d22);
}

.btn-out:hover {
  background: linear-gradient(145deg, #c05c37, #a24326);
  box-shadow: 0 8px 18px rgba(168, 73, 42, 0.24);
}

.btn-danger {
  background: linear-gradient(145deg, #c14937, #a33524);
}

.btn-hero-ghost {
  color: #fff8ec;
  border-color: rgba(255, 248, 236, 0.28);
  background: rgba(255, 248, 236, 0.07);
  box-shadow: none;
  backdrop-filter: blur(8px);
}

.btn-hero-ghost:hover {
  background: rgba(255, 248, 236, 0.14);
  border-color: rgba(255, 248, 236, 0.42);
}

.ghost-btn {
  height: 37px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  color: #6a5b49;
  background: rgba(255, 253, 248, 0.68);
  font-size: 12.5px;
  box-shadow: none;
}

.ghost-btn:hover {
  color: var(--ink);
  border-color: #c9b394;
  background: #fffdf8;
}

.text-btn {
  padding: 2px 0;
  border: 0;
  color: var(--brand);
  background: none;
  font-size: 12.5px;
  font-weight: 600;
}

.text-btn:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* --------------------------------------------------------------------------
   页面骨架
   -------------------------------------------------------------------------- */

.shell {
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
}

.view {
  display: none;
  padding-bottom: 34px;
}

.view.is-active {
  display: block;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--brand);
  font-family: var(--font-num);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   首屏
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(380px, 0.95fr);
  gap: clamp(28px, 4vw, 64px);
  align-items: center;
  margin-top: 26px;
  padding: clamp(30px, 4vw, 52px);
  overflow: hidden;
  border-radius: var(--radius-xl);
  color: #fff9ef;
  background:
    radial-gradient(900px 420px at 92% -28%, rgba(224, 160, 76, 0.34), transparent 62%),
    radial-gradient(520px 380px at 2% 120%, rgba(126, 74, 40, 0.5), transparent 65%),
    linear-gradient(135deg, #2a2017 0%, #342619 48%, #473021 100%);
  box-shadow: 0 30px 70px rgba(54, 36, 18, 0.28);
}

.hero::before {
  content: "";
  position: absolute;
  top: -190px;
  right: -80px;
  width: 460px;
  height: 460px;
  border: 1px solid rgba(255, 241, 220, 0.13);
  border-radius: 50%;
}

.hero::after {
  content: "";
  position: absolute;
  right: 92px;
  bottom: -230px;
  width: 350px;
  height: 350px;
  border: 1px solid rgba(224, 160, 76, 0.22);
  border-radius: 50%;
}

.hero-main {
  position: relative;
  z-index: 1;
  max-width: 620px;
}

.hero .eyebrow {
  color: #d9a45f;
}

.hero h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(38px, 4.4vw, 62px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.045em;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

.hero h1 span {
  color: #e8b66f;
  white-space: nowrap;
}

.hero-lede {
  max-width: 42ch;
  margin: 18px 0 0;
  color: rgba(255, 248, 236, 0.68);
  font-size: 14px;
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.hero-actions .btn {
  height: 45px;
  padding: 0 21px;
  border-radius: 12px;
}

.stats-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  align-self: stretch;
}

.stat-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 112px;
  padding: 17px 19px;
  border: 1px solid rgba(255, 245, 229, 0.13);
  border-radius: 17px;
  background: rgba(255, 248, 236, 0.065);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

.stat-label {
  color: rgba(255, 248, 236, 0.58);
  font-size: 11.5px;
  letter-spacing: 0.08em;
}

.stat-card strong {
  margin: 3px 0 0;
  font-family: var(--font-num);
  font-size: clamp(28px, 2.7vw, 38px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #fff9ef;
}

.stat-card small {
  margin-top: 3px;
  color: rgba(255, 248, 236, 0.43);
  font-size: 10.5px;
}

.stat-warn strong {
  color: #f0bd75;
}

/* --------------------------------------------------------------------------
   面板与工具栏
   -------------------------------------------------------------------------- */

.panel {
  margin-top: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 27px 30px 16px;
}

.panel-head h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 24px;
  letter-spacing: -0.02em;
}

.panel-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}

.panel-actions {
  display: flex;
  gap: 8px;
  flex: none;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 0 30px 14px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1 1 300px;
  height: 43px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: #f7f0e4;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.search-box:focus-within {
  border-color: #c9a273;
  background: #fffdf8;
  box-shadow: 0 0 0 3px rgba(176, 122, 34, 0.1);
}

.search-box svg {
  flex: none;
  width: 17px;
  height: 17px;
  color: #a08f7b;
}

.search-box input {
  min-width: 0;
  flex: 1;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
}

.search-box input::placeholder {
  color: #ab9b87;
}

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

.search-clear,
.mini-clear {
  display: grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #8c7b67;
  background: #e9ddca;
  font-size: 15px;
  line-height: 1;
}

.search-clear:hover,
.mini-clear:hover {
  color: var(--ink);
  background: #dfcfb7;
}

.select-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 43px;
  padding: 0 8px 0 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffdf8;
  color: var(--muted);
  font-size: 11.5px;
}

.select-wrap > span {
  flex: none;
  white-space: nowrap;
}

.select-wrap select {
  max-width: 150px;
  height: 100%;
  padding: 0 25px 0 2px;
  border: 0;
  outline: 0;
  appearance: none;
  color: var(--ink-soft);
  background: transparent
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a7b69' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")
    no-repeat right 4px center;
  font-size: 12.5px;
  cursor: pointer;
}

.filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 43px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: #746553;
  background: #fffdf8;
  font-size: 12.5px;
  font-weight: 600;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.filter-toggle i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d9c9b2;
  transition: background 0.18s ease, box-shadow 0.18s ease;
}

.filter-toggle:hover {
  border-color: var(--line-strong);
}

.filter-toggle[aria-pressed="true"] {
  color: #8d5a0e;
  border-color: #e5c993;
  background: var(--amber-soft);
}

.filter-toggle[aria-pressed="true"] i {
  background: #c58a2d;
  box-shadow: 0 0 0 3px rgba(197, 138, 45, 0.16);
}

.chip-row {
  display: flex;
  gap: 7px;
  padding: 0 30px 15px;
  overflow-x: auto;
  scrollbar-width: none;
}

.chip-row::-webkit-scrollbar {
  display: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  height: 31px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #776856;
  background: #f7f1e6;
  font-size: 12px;
  font-weight: 600;
  transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.chip:hover {
  background: #f1e7d7;
}

.chip.is-active {
  color: #fffaf1;
  background: #33271c;
}

.chip .chip-count {
  color: inherit;
  opacity: 0.52;
  font-family: var(--font-num);
  font-size: 11px;
}

/* --------------------------------------------------------------------------
   库存表
   -------------------------------------------------------------------------- */

.table-shell {
  overflow-x: auto;
  padding: 0 14px 8px;
  scrollbar-width: thin;
}

.inventory-table,
.records-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.inventory-table th,
.records-table th {
  padding: 10px 12px;
  border-top: 1px solid #f0e7d9;
  border-bottom: 1px solid var(--line);
  color: var(--muted-2);
  background: #fdf9f1;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-align: left;
  white-space: nowrap;
}

.inventory-table th:first-child,
.records-table th:first-child {
  border-top-left-radius: 9px;
}

.inventory-table th:last-child,
.records-table th:last-child {
  border-top-right-radius: 9px;
}

.inventory-table th.num,
.records-table th.num,
.inventory-table td.num,
.records-table td.num {
  text-align: right;
}

.inventory-table td,
.records-table td {
  padding: 12px;
  border-bottom: 1px solid #f1e9dc;
  color: var(--ink-soft);
  vertical-align: middle;
}

.inventory-table tbody tr,
.records-table tbody tr {
  transition: background 0.15s ease;
}

.inventory-table tbody tr:hover,
.records-table tbody tr:hover {
  background: #fcf8f0;
}

.inventory-table tbody tr:last-child td,
.records-table tbody tr:last-child td {
  border-bottom: 0;
}

.item-cell {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 235px;
}

.item-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}

.item-avatar.cat-xuan {
  color: #946218;
  background: #f9edd7;
}

.item-avatar.cat-zhan {
  color: #a24b2e;
  background: #fae7df;
}

.item-avatar.cat-bao {
  color: #3c6b52;
  background: #e7f0e9;
}

.item-avatar.cat-other {
  color: #6d6255;
  background: #eee8dd;
}

.item-copy {
  min-width: 0;
}

.item-name {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
}

.item-name .noted {
  display: inline-grid;
  place-items: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  color: #a08d76;
  background: #f2e9db;
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 700;
}

.mat-card-name .noted {
  display: inline-grid;
  place-items: center;
  width: 14px;
  height: 14px;
  margin-left: 2px;
  border-radius: 50%;
  color: #a08d76;
  background: #f2e9db;
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 700;
  vertical-align: 1px;
}

.item-meta {
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted-2);
  font-size: 11px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 23px;
  padding: 0 9px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.tag.cat-xuan {
  color: #8a5c15;
  background: #faf0dc;
}

.tag.cat-zhan {
  color: #9b4529;
  background: #faeae3;
}

.tag.cat-bao {
  color: #38644d;
  background: #eaf2ec;
}

.tag.cat-other {
  color: #6a5f52;
  background: #f0ebe2;
}

.location {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #746553;
  font-size: 12px;
  white-space: nowrap;
}

.location::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #cbb89f;
}

.inventory-table td.num {
  color: #7e6e5c;
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}

.inventory-table td.num.zero {
  color: #b5a692;
}

.stock-pill {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 3px;
  min-width: 72px;
  padding: 6px 9px;
  border-radius: 9px;
  color: #3d3226;
  background: #f2ece1;
  font-family: var(--font-num);
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.stock-pill small {
  color: inherit;
  opacity: 0.55;
  font-family: var(--font-sans);
  font-size: 9.5px;
  font-weight: 500;
}

.stock-pill.is-low {
  color: #8f5c0e;
  background: var(--amber-soft);
}

.stock-pill.is-zero {
  color: #a33424;
  background: var(--red-soft);
}

.actions-col {
  width: 118px;
  text-align: right !important;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
}

.mini-btn {
  height: 29px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #746553;
  background: #fffdf9;
  font-size: 11.5px;
  font-weight: 600;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.mini-btn.in:hover {
  color: var(--green);
  border-color: #b9d3c4;
  background: var(--green-soft);
}

.mini-btn.out:hover {
  color: var(--brand);
  border-color: #e3c2b5;
  background: var(--brand-soft);
}

.mobile-list {
  display: none;
}

.inventory-table tr.is-flash td {
  animation: flash-row 2.2s ease;
}

.mat-card.is-flash {
  animation: flash-card 2.2s ease;
}

@keyframes flash-row {
  0%, 100% { background: transparent; }
  18%, 58% { background: #fdf1d9; }
}

@keyframes flash-card {
  0%, 100% { border-color: var(--line); box-shadow: none; }
  18%, 58% { border-color: #e2bd7d; box-shadow: 0 0 0 3px rgba(197, 138, 45, 0.11); }
}

/* --------------------------------------------------------------------------
   空状态
   -------------------------------------------------------------------------- */

.empty-state {
  padding: 62px 24px 68px;
  text-align: center;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: 0 auto 15px;
  border: 1px solid var(--line);
  border-radius: 17px;
  color: #a08d76;
  background: #faf5eb;
  font-family: var(--font-serif);
  font-size: 25px;
}

.empty-state h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 19px;
}

.empty-state p {
  margin: 6px 0 17px;
  color: var(--muted);
  font-size: 12.5px;
}

/* --------------------------------------------------------------------------
   记录页
   -------------------------------------------------------------------------- */

.records-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 40px 6px 8px;
}

.records-hero .eyebrow {
  margin-bottom: 9px;
}

.records-hero h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(34px, 3.6vw, 47px);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.records-hero p:not(.eyebrow) {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.records-toolbar {
  justify-content: space-between;
  padding-top: 19px;
  padding-bottom: 16px;
}

.segmented {
  display: flex;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7f0e4;
}

.segmented button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 33px;
  padding: 0 13px;
  border: 0;
  border-radius: 8px;
  color: #796a58;
  background: transparent;
  font-size: 12.5px;
  font-weight: 600;
}

.segmented button span {
  color: inherit;
  opacity: 0.55;
  font-family: var(--font-num);
  font-size: 10.5px;
}

.segmented button.is-active {
  color: var(--ink);
  background: #fffdf8;
  box-shadow: 0 2px 8px rgba(72, 51, 26, 0.08);
}

.record-count {
  color: var(--muted);
  font-size: 12px;
}

.records-table .date-cell {
  color: var(--ink-soft);
  font-family: var(--font-num);
  font-size: 12.5px;
  white-space: nowrap;
}

.type-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 8px;
  border-radius: 7px;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}

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

.type-badge.in {
  color: var(--green);
  background: var(--green-soft);
}

.type-badge.out {
  color: var(--brand);
  background: var(--brand-soft);
}

.record-item {
  min-width: 185px;
}

.record-item b {
  display: block;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

.record-item small {
  color: var(--muted-2);
  font-size: 10.5px;
}

.qty-cell {
  font-family: var(--font-num);
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.qty-cell.in {
  color: var(--green);
}

.qty-cell.out {
  color: var(--brand);
}

.party-cell {
  max-width: 190px;
  overflow: hidden;
  color: #6f604e;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operator-cell {
  white-space: nowrap;
}

.note-cell {
  max-width: 170px;
  overflow: hidden;
  color: var(--muted-2);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.undo-btn {
  height: 28px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #a0927f;
  background: transparent;
  font-size: 11px;
}

.undo-btn:hover {
  color: var(--red);
  border-color: #eed3cc;
  background: var(--red-soft);
}

/* --------------------------------------------------------------------------
   页脚
   -------------------------------------------------------------------------- */

.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
  padding: 8px 0 34px;
  color: #a39481;
  font-size: 10.5px;
  letter-spacing: 0.02em;
}

.footer-sep {
  opacity: 0.55;
}

.mobile-actions {
  display: none;
}

/* --------------------------------------------------------------------------
   弹窗
   -------------------------------------------------------------------------- */

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(35, 26, 16, 0.58);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  animation: fade-in 0.2s ease both;
}

.modal {
  position: relative;
  z-index: 1;
  width: min(680px, 100%);
  max-height: min(92vh, 900px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 25px;
  background: var(--surface);
  box-shadow: 0 40px 110px rgba(28, 18, 8, 0.38);
  animation: modal-pop 0.24s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.item-modal {
  width: min(620px, 100%);
}

.confirm-modal {
  width: min(440px, 100%);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 24px 26px 17px;
  border-bottom: 1px solid #f0e7d9;
}

.modal-badge {
  display: grid;
  place-items: center;
  flex: none;
  width: 43px;
  height: 43px;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(145deg, #3c7b5b, #2c6246);
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 7px 16px rgba(47, 107, 77, 0.2);
}

.modal-layer.mode-out .modal-badge {
  background: linear-gradient(145deg, #b45532, #953d22);
  box-shadow: 0 7px 16px rgba(168, 73, 42, 0.22);
}

.modal-layer.mode-in .modal-badge {
  background: linear-gradient(145deg, #3c7b5b, #2c6246);
}

.badge-neutral {
  color: #f8efe1;
  background: linear-gradient(145deg, #756553, #554838);
  box-shadow: 0 7px 16px rgba(70, 54, 36, 0.2);
}

.badge-danger {
  color: #fff;
  background: linear-gradient(145deg, #c14937, #a33524);
  box-shadow: 0 7px 16px rgba(178, 58, 42, 0.22);
}

.modal-heading {
  min-width: 0;
  padding-top: 1px;
}

.modal-heading h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.modal-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.modal-close {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  margin-left: auto;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #9b8b77;
  background: transparent;
  font-size: 23px;
  font-weight: 300;
  line-height: 1;
}

.modal-close:hover {
  color: var(--ink);
  background: #f5eee2;
}

.modal form {
  padding: 20px 26px 24px;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 6px 26px 24px;
}

.modal form .modal-foot {
  padding: 8px 0 0;
}

.modal-foot .btn,
.modal-foot .ghost-btn {
  height: 42px;
  padding: 0 20px;
}

.confirm-modal .modal-foot {
  padding-top: 4px;
}

/* 表单元素 */

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  margin-bottom: 15px;
}

.field > label {
  color: #5b4d3e;
  font-size: 12.5px;
  font-weight: 600;
}

.field > label em {
  color: var(--brand);
  font-style: normal;
}

.label-hint {
  margin-left: 4px;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 400;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: 0;
  color: var(--ink);
  background: #fff;
  font-size: 13.5px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.field input,
.field select {
  height: 43px;
  padding: 0 12px;
}

.field select {
  padding-right: 34px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a7b69' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  cursor: pointer;
}

.field textarea {
  min-height: 64px;
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.6;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #b2a38f;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: #c19a69;
  box-shadow: 0 0 0 3px rgba(176, 122, 34, 0.1);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 15px;
}

.field-hint {
  min-height: 16px;
  margin: 0;
  color: var(--muted-2);
  font-size: 10.5px;
}

.field-hint.is-warn {
  color: var(--red);
}

.field-hint.is-ok {
  color: var(--green);
}

.form-error {
  margin: 2px 0 0;
  padding: 9px 11px;
  border: 1px solid #f0cec5;
  border-radius: 9px;
  color: var(--red);
  background: #fcf0ed;
  font-size: 12px;
}

/* 物料选择器 */

.material-select {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}

.material-select:focus-within {
  border-color: #c19a69;
  box-shadow: 0 0 0 3px rgba(176, 122, 34, 0.09);
}

.material-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 43px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: #fdfaf4;
}

.material-search svg {
  flex: none;
  width: 16px;
  height: 16px;
  color: #a08f7b;
}

.material-search input {
  min-width: 0;
  flex: 1;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
}

.material-search input::placeholder {
  color: #b2a38f;
}

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

.material-options {
  max-height: 208px;
  overflow-y: auto;
  padding: 6px;
  scrollbar-width: thin;
  scrollbar-color: #d9c9b2 transparent;
}

.material-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 9px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  text-align: left;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.material-option:hover,
.material-option:focus-visible {
  outline: 0;
  border-color: #eadbc7;
  background: #fbf6ec;
}

.material-option:disabled {
  opacity: 0.45;
}

.material-option .item-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 13px;
}

.mo-copy {
  min-width: 0;
  flex: 1;
}

.mo-copy b {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mo-copy small {
  display: block;
  overflow: hidden;
  margin-top: 1px;
  color: var(--muted-2);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mo-stock {
  flex: none;
  color: #776856;
  font-family: var(--font-num);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.mo-stock.is-low {
  color: var(--amber);
}

.mo-stock.is-zero {
  color: var(--red);
}

.material-empty {
  padding: 22px 12px;
  color: var(--muted-2);
  font-size: 12px;
  text-align: center;
}

.material-chosen {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border: 1px solid #e4d2b8;
  border-radius: 13px;
  background: #fcf6ea;
}

.material-chosen .item-avatar {
  width: 38px;
  height: 38px;
}

.chosen-copy {
  min-width: 0;
  flex: 1;
}

.chosen-copy b {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 13.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chosen-copy small {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chosen-stock {
  flex: none;
  padding: 4px 8px;
  border-radius: 7px;
  color: #5e503f;
  background: #eadfcd;
  font-family: var(--font-num);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.chosen-stock.is-low {
  color: #8f5c0e;
  background: #f4e3bd;
}

.chosen-stock.is-zero {
  color: var(--red);
  background: #f7dcd5;
}

/* 数量步进 */

.qty-box {
  display: flex;
  height: 43px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}

.qty-box:focus-within {
  border-color: #c19a69;
  box-shadow: 0 0 0 3px rgba(176, 122, 34, 0.1);
}

.qty-box button {
  flex: none;
  width: 42px;
  padding: 0;
  border: 0;
  color: #776856;
  background: #f6efe3;
  font-size: 18px;
  line-height: 1;
}

.qty-box button:hover {
  color: var(--ink);
  background: #eee4d4;
}

.qty-box input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: #fff;
  font-family: var(--font-num);
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  box-shadow: none;
  appearance: textfield;
}

.qty-box input::-webkit-outer-spin-button,
.qty-box input::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

/* --------------------------------------------------------------------------
   提示条
   -------------------------------------------------------------------------- */

.toast-stack {
  position: fixed;
  z-index: 120;
  bottom: 25px;
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(92vw, 430px);
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 100%;
  padding: 11px 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: #fffaf1;
  background: rgba(43, 36, 28, 0.94);
  box-shadow: 0 14px 34px rgba(35, 24, 12, 0.24);
  backdrop-filter: blur(10px);
  font-size: 12.5px;
  line-height: 1.5;
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.toast::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #86c7a4;
}

.toast.is-error::before {
  background: #f09a87;
}

.toast.is-info::before {
  background: #e9bd7c;
}

.toast.is-show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* --------------------------------------------------------------------------
   动画
   -------------------------------------------------------------------------- */

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-pop {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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

.view.is-active .hero {
  animation: rise 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.view.is-active .inventory-panel {
  animation: rise 0.5s 0.05s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

/* --------------------------------------------------------------------------
   响应式
   -------------------------------------------------------------------------- */

@media (max-width: 1080px) {
  .topbar-inner {
    gap: 16px;
  }

  .topbar-tools .sync-state {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 27px;
  }

  .stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .stat-card {
    min-height: 98px;
    padding: 14px 16px;
  }
}

@media (max-width: 900px) {
  .brand-copy small {
    display: none;
  }

  .main-nav {
    margin-left: 0;
  }

  .topbar-tools .ghost-btn {
    display: none;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  .topbar {
    position: static;
  }

  .topbar-inner {
    width: calc(100% - 28px);
    min-height: 0;
    padding: 11px 0 9px;
    flex-wrap: wrap;
    gap: 9px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    font-size: 21px;
  }

  .brand-copy b {
    font-size: 17px;
  }

  .main-nav {
    order: 3;
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    margin: 0;
  }

  .nav-btn {
    height: 33px;
  }

  .topbar-tools {
    margin-left: auto;
  }

  .topbar-tools .btn {
    display: none;
  }

  .sync-state {
    display: inline-flex;
    margin-right: 0;
  }

  .shell {
    width: calc(100% - 24px);
  }

  .hero {
    margin-top: 13px;
    padding: 26px 21px 22px;
    border-radius: 23px;
  }

  .hero h1 {
    font-size: clamp(35px, 10.5vw, 46px);
    letter-spacing: -0.05em;
  }

  .hero-lede {
    margin-top: 13px;
    font-size: 12.5px;
    line-height: 1.7;
  }

  .hero-actions {
    margin-top: 19px;
  }

  .hero-actions .btn {
    height: 42px;
    padding: 0 17px;
    font-size: 12.5px;
  }

  .stats-grid {
    gap: 8px;
  }

  .stat-card {
    min-height: 88px;
    padding: 12px 13px;
    border-radius: 14px;
  }

  .stat-label {
    font-size: 10.5px;
  }

  .stat-card strong {
    font-size: 27px;
  }

  .stat-card small {
    font-size: 9.5px;
  }

  .panel {
    margin-top: 13px;
    border-radius: 22px;
  }

  .panel-head {
    padding: 21px 18px 13px;
    align-items: flex-start;
  }

  .panel-head h2 {
    font-size: 21px;
  }

  .panel-head p {
    font-size: 11.5px;
  }

  .panel-actions .only-desktop {
    display: none;
  }

  .panel-actions .ghost-btn {
    height: 34px;
    padding: 0 10px;
    font-size: 11.5px;
  }

  .toolbar {
    padding: 0 18px 11px;
    gap: 8px;
  }

  .search-box {
    flex: 1 1 100%;
    height: 42px;
  }

  .select-wrap {
    flex: 1;
    height: 39px;
    padding-left: 11px;
  }

  .select-wrap select {
    width: 100%;
    max-width: none;
  }

  .filter-toggle {
    height: 39px;
    padding: 0 12px;
    font-size: 11.5px;
  }

  .chip-row {
    padding: 0 18px 13px;
  }

  .chip {
    height: 29px;
    padding: 0 11px;
    font-size: 11.5px;
  }

  .table-shell {
    display: none;
  }

  .mobile-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: 0 12px 14px;
  }

  .mat-card {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fffdf9;
  }

  .mat-card-top {
    display: flex;
    align-items: flex-start;
    gap: 10px;
  }

  .mat-card .item-avatar {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    font-size: 14px;
  }

  .mat-card-copy {
    min-width: 0;
    flex: 1;
  }

  .mat-card-name {
    color: var(--ink);
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.35;
  }

  .mat-card-meta {
    margin-top: 2px;
    overflow: hidden;
    color: var(--muted-2);
    font-size: 10.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mat-card .stock-pill {
    min-width: 62px;
    padding: 6px 8px;
    font-size: 14px;
  }

  .mat-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 13px;
    margin: 11px 0 0;
    padding: 10px 0;
    border-top: 1px dashed #eee2d0;
    border-bottom: 1px dashed #eee2d0;
    color: var(--muted);
    font-size: 10.5px;
  }

  .mat-facts b {
    color: #5f5140;
    font-family: var(--font-num);
    font-size: 11.5px;
    font-weight: 600;
  }

  .mat-facts .warn-text {
    color: #a06a16;
  }

  .mat-card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    margin-top: 10px;
  }

  .mat-card-actions .mini-btn {
    height: 34px;
    border-radius: 9px;
    font-size: 12px;
  }

  .mat-card-actions .mini-btn.in {
    color: var(--green);
    border-color: #c7dccf;
    background: #f1f7f3;
  }

  .mat-card-actions .mini-btn.out {
    color: var(--brand);
    border-color: #ebccc1;
    background: #fdf3ef;
  }

  .records-hero {
    padding: 24px 6px 4px;
    align-items: flex-start;
  }

  .records-hero h1 {
    font-size: 34px;
  }

  .records-hero p:not(.eyebrow) {
    font-size: 11.5px;
  }

  .records-hero > .ghost-btn {
    display: none;
  }

  .records-toolbar {
    padding: 14px 18px;
    align-items: flex-start;
  }

  .segmented {
    width: 100%;
  }

  .segmented button {
    flex: 1;
    justify-content: center;
    padding: 0 8px;
  }

  .record-count {
    width: 100%;
    font-size: 11px;
  }

  .record-card {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fffdf9;
  }

  .record-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .record-card-date {
    color: var(--muted);
    font-family: var(--font-num);
    font-size: 11px;
  }

  .record-card-main {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 9px;
  }

  .record-card-item {
    min-width: 0;
    flex: 1;
  }

  .record-card-item b {
    display: block;
    color: var(--ink);
    font-size: 13.5px;
    line-height: 1.35;
  }

  .record-card-item small {
    display: block;
    margin-top: 2px;
    overflow: hidden;
    color: var(--muted-2);
    font-size: 10.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .record-card-qty {
    flex: none;
    font-family: var(--font-num);
    font-size: 18px;
    font-weight: 600;
    line-height: 1.2;
  }

  .record-card-qty.in {
    color: var(--green);
  }

  .record-card-qty.out {
    color: var(--brand);
  }

  .record-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    margin-top: 9px;
    color: var(--muted);
    font-size: 10.5px;
  }

  .record-card-meta b {
    color: #5f5140;
    font-weight: 600;
  }

  .record-card-note {
    margin-top: 8px;
    padding: 7px 9px;
    border-radius: 7px;
    color: #8a7b69;
    background: #faf4e9;
    font-size: 10.5px;
    line-height: 1.5;
  }

  .record-card-foot {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
  }

  .site-footer {
    width: calc(100% - 28px);
    padding: 0 0 92px;
    font-size: 9.5px;
  }

  .site-footer .footer-sep {
    display: none;
  }

  .mobile-actions {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 50;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    padding: 9px 13px calc(9px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(218, 202, 179, 0.8);
    background: rgba(250, 246, 238, 0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }

  .mobile-actions .btn {
    height: 46px;
    border-radius: 12px;
    font-size: 13.5px;
  }

  .modal-layer {
    align-items: flex-end;
    padding: 0;
  }

  .modal {
    width: 100%;
    max-height: 92vh;
    border-radius: 24px 24px 0 0;
    border-bottom: 0;
    animation: sheet-up 0.26s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }

  .confirm-modal {
    width: 100%;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .modal-head {
    padding: 20px 18px 14px;
  }

  .modal-heading h2 {
    font-size: 20px;
  }

  .modal form {
    padding: 17px 18px 20px;
  }

  .modal-foot {
    padding: 4px 18px calc(18px + env(safe-area-inset-bottom));
  }

  .modal form .modal-foot {
    padding: 4px 0 0;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .material-options {
    max-height: 182px;
  }

  .toast-stack {
    bottom: calc(73px + env(safe-area-inset-bottom));
  }

  @keyframes sheet-up {
    from { opacity: 0; transform: translateY(34px); }
    to { opacity: 1; transform: translateY(0); }
  }
}

@media (max-width: 380px) {
  .hero h1 {
    font-size: 32px;
  }

  .stats-grid {
    gap: 7px;
  }

  .stat-card {
    min-height: 82px;
    padding: 11px;
  }

  .stat-card strong {
    font-size: 24px;
  }

  .hero-actions .btn {
    flex: 1;
    padding: 0 10px;
  }
}

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

/* ==========================================================================
   v2：登录、多管理员、照片、客户档案
   ========================================================================== */

body.auth-open {
  overflow: hidden;
}

body.lightbox-open {
  overflow: hidden;
}

.chosen-photo {
  display: block;
  flex: none;
  width: 38px;
  height: 38px;
  overflow: hidden;
  border: 1px solid #e5d5c0;
  border-radius: 10px;
  background: #f7f0e4;
}

.chosen-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.customer-tag {
  display: inline-flex;
  align-items: center;
  height: 18px;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 5px;
  color: #8a5b23;
  background: #f7e8d0;
  font-size: 9.5px;
  font-weight: 600;
  vertical-align: 1px;
}

.undo-locked {
  color: #c4b6a4;
  font-size: 10px;
}

.inventory-table .actions-col {
  width: 164px;
}

.mat-card-actions.three {
  grid-template-columns: repeat(3, 1fr);
}

.mat-card-actions.three .mini-btn {
  padding: 0 6px;
  font-size: 11px;
}

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(460px, 0.98fr);
  overflow: auto;
  background: var(--bg);
}

.auth-art {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 100%;
  padding: clamp(32px, 5vw, 72px);
  overflow: hidden;
  color: #fff9ef;
  background:
    radial-gradient(900px 500px at 92% -15%, rgba(224, 160, 76, 0.34), transparent 62%),
    radial-gradient(600px 420px at 0% 115%, rgba(126, 74, 40, 0.55), transparent 65%),
    linear-gradient(135deg, #2a2017 0%, #342619 48%, #473021 100%);
}

.auth-art::before {
  content: "";
  position: absolute;
  top: -190px;
  right: -130px;
  width: 500px;
  height: 500px;
  border: 1px solid rgba(255, 241, 220, 0.14);
  border-radius: 50%;
}

.auth-art::after {
  content: "";
  position: absolute;
  left: -160px;
  bottom: -220px;
  width: 430px;
  height: 430px;
  border: 1px solid rgba(224, 160, 76, 0.22);
  border-radius: 50%;
}

.auth-art-inner {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  margin: auto;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: clamp(38px, 7vh, 76px);
}

.auth-brand .brand-copy b {
  color: #fff8ec;
}

.auth-brand .brand-copy small {
  color: rgba(255, 248, 236, 0.52);
}

.auth-art .eyebrow {
  color: #d9a45f;
}

.auth-art h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(38px, 4.4vw, 60px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.045em;
}

.auth-art h1 span {
  color: #e8b66f;
  white-space: nowrap;
}

.auth-lede {
  max-width: 34ch;
  margin: 20px 0 0;
  color: rgba(255, 248, 236, 0.64);
  font-size: 14px;
  line-height: 1.8;
}

.auth-points {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
}

.auth-points li {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255, 248, 236, 0.76);
  font-size: 12.5px;
}

.auth-points b {
  color: #d9a45f;
  font-family: var(--font-num);
  font-size: 10.5px;
  letter-spacing: 0.12em;
}

.auth-footnote {
  margin: 44px 0 0;
  color: rgba(255, 248, 236, 0.3);
  font-size: 10px;
  letter-spacing: 0.14em;
}

.auth-main {
  display: grid;
  place-items: center;
  padding: 36px;
  background:
    radial-gradient(700px 500px at 100% 0%, #f2e3cd 0%, rgba(242, 227, 205, 0) 55%),
    var(--bg);
}

.auth-card {
  width: min(430px, 100%);
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 30px 80px rgba(69, 47, 24, 0.13);
}

.auth-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 34px 0;
  color: var(--muted);
  font-size: 12px;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 2px solid #eadcc8;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.auth-form .eyebrow {
  margin-bottom: 8px;
}

.auth-form h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 30px;
  letter-spacing: -0.03em;
}

.auth-sub {
  margin: 8px 0 24px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
}

.auth-form .field {
  margin-bottom: 14px;
}

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

.btn-auth {
  width: 100%;
  height: 46px;
  margin-top: 4px;
  border-radius: 12px;
  background: linear-gradient(145deg, #b45532, #953d22);
  font-size: 14px;
}

.auth-note {
  margin: 14px 0 0;
  color: var(--muted-2);
  font-size: 10.5px;
  line-height: 1.6;
  text-align: center;
}

/* 顶部账号 */

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 39px;
  padding: 3px 6px 3px 3px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.72);
  cursor: pointer;
}

.user-chip:hover {
  border-color: #d2b995;
  background: #fffdf8;
}

.user-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 31px;
  height: 31px;
  border-radius: 9px;
  color: #8a5b23;
  background: #f1e3cd;
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 700;
}

.user-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  line-height: 1.15;
}

.user-meta b {
  max-width: 90px;
  overflow: hidden;
  color: var(--ink);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-meta small {
  color: var(--muted);
  font-size: 9px;
}

.logout-btn {
  height: 26px;
  padding: 0 5px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-size: 10px;
}

.logout-btn:hover {
  color: var(--red);
  background: var(--red-soft);
}

/* 照片 */

.item-photo-btn {
  display: block;
  flex: none;
  padding: 0;
  overflow: hidden;
  border: 1px solid #e5d5c0;
  border-radius: 12px;
  background: #f7f0e4;
  cursor: zoom-in;
  line-height: 0;
}

.item-photo-btn:hover {
  border-color: #c9a273;
}

.item-photo {
  display: block;
  width: 42px;
  height: 42px;
  object-fit: cover;
}

.item-photo.small {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.photo-editor {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 18px;
  padding: 13px;
  border: 1px solid #eadcc8;
  border-radius: 15px;
  background: #fcf6ea;
}

.photo-preview {
  display: grid;
  place-items: center;
  flex: none;
  width: 104px;
  height: 104px;
  overflow: hidden;
  border: 1px dashed #d9c4a5;
  border-radius: 14px;
  color: #b2a38f;
  background: #f4eadb;
  font-size: 10.5px;
  text-align: center;
}

.photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-copy {
  min-width: 0;
  flex: 1;
}

.photo-copy b {
  color: var(--ink);
  font-size: 13px;
}

.photo-copy p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.6;
}

.photo-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 9px;
}

.photo-actions .ghost-btn {
  height: 33px;
  padding: 0 11px;
  font-size: 11.5px;
}

/* 表单补充 */

.readonly-box {
  display: flex;
  align-items: center;
  height: 43px;
  padding: 0 12px;
  border: 1px dashed #d9c8b2;
  border-radius: 11px;
  color: #6a5b49;
  background: #f8f1e5;
  font-size: 13px;
  font-weight: 600;
}

.customer-hint {
  margin-top: 2px;
  padding: 10px 12px;
  border: 1px solid #eadcc8;
  border-radius: 10px;
  color: #6f604e;
  background: #fbf5e9;
  font-size: 11.5px;
  line-height: 1.7;
}

.customer-hint b {
  color: var(--ink);
  font-weight: 600;
}

.customer-hint .hint-row {
  display: flex;
  gap: 6px;
}

.customer-hint .hint-row span:first-child {
  flex: none;
  width: 42px;
  color: var(--muted-2);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 14px;
  color: #6f604e;
  font-size: 12px;
  cursor: pointer;
}

.check-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
}

/* 客户档案 */

.compact-actions {
  margin-top: 0;
}

.customer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  padding: 0 30px 26px;
}

.customer-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fffdf9;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.customer-card:hover {
  border-color: #d9c3a4;
  box-shadow: 0 8px 22px rgba(69, 47, 24, 0.06);
}

.customer-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.customer-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: #9a6630;
  background: #f7e8d0;
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
}

.customer-card-title {
  min-width: 0;
  flex: 1;
}

.customer-card-title b {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-card-title small {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 10.5px;
}

.customer-actions {
  display: flex;
  gap: 4px;
  flex: none;
}

.customer-lines {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-top: 9px;
  border-top: 1px dashed #eee2d0;
}

.customer-line {
  display: flex;
  gap: 7px;
  color: #6f604e;
  font-size: 11.5px;
  line-height: 1.55;
}

.customer-line .label {
  flex: none;
  width: 38px;
  color: var(--muted-2);
}

.customer-line a {
  color: var(--brand);
  text-decoration: none;
  font-family: var(--font-num);
  font-size: 12.5px;
}

.customer-line a:hover {
  text-decoration: underline;
}

.customer-line .copy-address {
  margin-left: auto;
  padding: 0;
  border: 0;
  color: #a08d76;
  background: none;
  font-size: 10px;
}

.customer-line .copy-address:hover {
  color: var(--brand);
}

.customer-note {
  padding: 7px 9px;
  border-radius: 8px;
  color: #8a7b69;
  background: #faf4e9;
  font-size: 10.5px;
  line-height: 1.5;
}

/* 管理后台 */

.user-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 30px 26px;
}

.user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffdf9;
}

.user-row .user-avatar {
  width: 38px;
  height: 38px;
  font-size: 16px;
}

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

.user-row-main b {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font-size: 13.5px;
}

.user-row-main small {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 10.5px;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  height: 21px;
  padding: 0 7px;
  border-radius: 6px;
  font-size: 9.5px;
  font-weight: 700;
}

.role-badge.admin {
  color: #8b3b20;
  background: var(--brand-soft);
}

.role-badge.staff {
  color: #3c6b52;
  background: var(--green-soft);
}

.role-badge.disabled {
  color: #776b5e;
  background: #eee7db;
}

.user-row-actions {
  display: flex;
  gap: 5px;
  flex: none;
}

.user-row-actions .mini-btn {
  height: 30px;
}

.network-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  padding: 0 30px 14px;
}

.network-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffdf9;
}

.network-item .net-copy {
  min-width: 0;
  flex: 1;
}

.network-item b {
  display: block;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 500;
}

.network-item code {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: var(--ink);
  font-family: var(--font-num);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.network-item.primary {
  border-color: #d9b982;
  background: #fdf6e7;
}

.copy-btn {
  flex: none;
  height: 27px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #746553;
  background: #fffdf8;
  font-size: 10px;
}

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

.network-tip {
  margin: 0 30px 26px;
  padding: 12px 14px;
  border: 1px solid #eadcc8;
  border-radius: 12px;
  background: #fbf5e9;
}

.network-tip b {
  color: #5f4e3a;
  font-size: 11.5px;
}

.network-tip p {
  margin: 4px 0 0;
  color: #8a7b69;
  font-size: 10.5px;
  line-height: 1.7;
}

/* 看大图 */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: grid;
  place-items: center;
  padding: 26px;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 17, 10, 0.84);
  backdrop-filter: blur(7px);
}

.lightbox-figure {
  position: relative;
  z-index: 1;
  max-width: min(860px, 92vw);
  margin: 0;
  text-align: center;
}

.lightbox-figure img {
  display: block;
  max-width: 100%;
  max-height: 78vh;
  margin: 0 auto;
  border-radius: 16px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.4);
  object-fit: contain;
}

.lightbox-figure figcaption {
  margin-top: 12px;
  color: rgba(255, 248, 236, 0.78);
  font-size: 12.5px;
}

.lightbox-close {
  position: absolute;
  top: -15px;
  right: -15px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: #fff;
  background: rgba(34, 24, 14, 0.8);
  font-size: 24px;
  line-height: 1;
}

@media (max-width: 1180px) {
  .topbar-tools .sync-state {
    display: none;
  }

  .user-meta small {
    display: none;
  }
}

@media (max-width: 980px) {
  .topbar-tools .ghost-btn {
    display: none;
  }

  .topbar-tools > .btn {
    display: none;
  }

  .user-meta {
    display: none;
  }

  .user-chip {
    padding-right: 3px;
  }
}

@media (max-width: 860px) {
  .auth-screen {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .auth-art {
    min-height: 0;
    padding: 22px 24px 26px;
  }

  .auth-brand {
    margin-bottom: 28px;
  }

  .auth-art h1 {
    font-size: clamp(30px, 8vw, 38px);
  }

  .auth-lede,
  .auth-points,
  .auth-footnote {
    display: none;
  }

  .auth-main {
    padding: 22px 16px 34px;
  }

  .auth-card {
    padding: 26px 22px;
  }

  .customer-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  .main-nav {
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    grid-template-columns: none;
  }

  .main-nav .nav-btn {
    padding: 0 4px;
    font-size: 12px;
    white-space: nowrap;
  }

  .topbar-tools .user-chip {
    height: 36px;
  }

  .topbar-tools .user-avatar {
    width: 29px;
    height: 29px;
  }

  .topbar-tools .logout-btn {
    display: block;
    padding: 0 4px;
    font-size: 9.5px;
  }

  .customer-grid {
    padding: 0 16px 16px;
  }

  .customer-card {
    padding: 14px;
  }

  .customer-actions .mini-btn {
    height: 28px;
    padding: 0 8px;
    font-size: 10.5px;
  }

  .user-list {
    padding: 0 16px 16px;
  }

  .user-row {
    padding: 11px 12px;
  }

  .user-row-actions {
    flex-direction: column;
  }

  .user-row-actions .mini-btn {
    height: 27px;
  }

  .network-list {
    grid-template-columns: 1fr;
    padding: 0 16px 12px;
  }

  .network-tip {
    margin: 0 16px 20px;
  }

  .photo-editor {
    align-items: flex-start;
    gap: 12px;
    padding: 11px;
  }

  .photo-preview {
    width: 86px;
    height: 86px;
  }

  .photo-actions {
    flex-wrap: wrap;
    gap: 7px;
  }

  .field-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .auth-form h2 {
    font-size: 27px;
  }

  .compact-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .compact-actions .btn,
  .compact-actions .ghost-btn {
    height: 37px;
    padding: 0 12px;
    font-size: 11.5px;
  }
}

@media (max-width: 380px) {
  .main-nav .nav-btn {
    padding: 0 6px;
    font-size: 11.5px;
  }

  .user-chip .logout-btn {
    display: none;
  }

  .photo-preview {
    width: 76px;
    height: 76px;
  }
}

