/* =========================================================
 * 宁国工厂后台 · 设计系统 (Claude-inspired)
 * 暖米色 + 珊瑚橙 + 衬线标题，纸质感的运营后台
 * ========================================================= */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Source+Serif+4:opsz,wght@8..60,400;8..60,500;8..60,600;8..60,700&display=swap");

:root {
  color-scheme: light;

  /* —— 暖中性色（米色 / 沙色） —— */
  --cream-50:  #faf9f5;
  --cream-100: #f5f4ed;
  --cream-150: #efece3;
  --cream-200: #e8e4d8;
  --cream-300: #d4cfc2;
  --cream-400: #b8b3a4;
  --cream-500: #8b8676;
  --cream-600: #6b6760;
  --cream-700: #4a4843;
  --cream-800: #2d2c28;
  --cream-900: #1c1c1a;

  /* —— 品牌色：Claude coral —— */
  --coral-50:  #fdf6f2;
  --coral-100: #fae8df;
  --coral-200: #f3cdb9;
  --coral-300: #e6a786;
  --coral-400: #d28b6f;
  --coral-500: #cc785c;
  --coral-600: #b56549;
  --coral-700: #8e4d36;
  --coral-800: #663626;

  /* —— 旧 brand-* token 兼容映射 (保留以避免未替换处崩溃) —— */
  --brand-50:  var(--coral-50);
  --brand-100: var(--coral-100);
  --brand-200: var(--coral-200);
  --brand-300: var(--coral-300);
  --brand-400: var(--coral-400);
  --brand-500: var(--coral-500);
  --brand-600: var(--coral-600);
  --brand-700: var(--coral-700);
  --brand-800: var(--coral-800);

  /* —— 状态色（柔和版本） —— */
  --green-50:  #f1f5ec;
  --green-100: #dfe9d2;
  --green-500: #6b8e58;
  --green-600: #557047;
  --green-700: #3f5435;

  --amber-50:  #faf3e3;
  --amber-100: #f3e3bd;
  --amber-500: #c9923f;
  --amber-600: #a87830;
  --amber-700: #835c25;

  --rose-50:  #f9ecea;
  --rose-100: #efd1cc;
  --rose-500: #b85a52;
  --rose-600: #99453f;
  --rose-700: #743430;

  --sky-50:  #eef2f5;
  --sky-100: #d9e1e8;
  --sky-500: #6a8499;
  --sky-600: #506b81;

  /* —— 旧中性色兼容映射 —— */
  --zinc-50:  var(--cream-50);
  --zinc-100: var(--cream-100);
  --zinc-150: var(--cream-150);
  --zinc-200: var(--cream-200);
  --zinc-300: var(--cream-300);
  --zinc-400: var(--cream-400);
  --zinc-500: var(--cream-500);
  --zinc-600: var(--cream-600);
  --zinc-700: var(--cream-700);
  --zinc-800: var(--cream-800);
  --zinc-900: var(--cream-900);

  /* —— 语义别名 —— */
  --bg:             var(--cream-100);
  --bg-elevated:    #ffffff;
  --surface:        #ffffff;
  --surface-soft:   var(--cream-50);
  --surface-subtle: #fbfaf5;
  --surface-muted:  var(--cream-150);
  --line:           var(--cream-200);
  --line-soft:      var(--cream-150);
  --line-strong:    var(--cream-300);
  --text:           var(--cream-800);
  --text-strong:    var(--cream-900);
  --muted:          var(--cream-500);
  --muted-strong:   var(--cream-700);

  --primary:        var(--coral-500);
  --primary-strong: var(--coral-600);
  --primary-soft:   var(--coral-50);
  --primary-ring:   rgba(204, 120, 92, 0.22);

  --success:        var(--green-600);
  --success-strong: var(--green-700);
  --success-soft:   var(--green-50);

  --warning:        var(--amber-600);
  --warning-strong: var(--amber-700);
  --warning-soft:   var(--amber-50);

  --danger:         var(--rose-600);
  --danger-strong:  var(--rose-700);
  --danger-soft:    var(--rose-50);

  --info:           var(--sky-600);
  --info-soft:      var(--sky-50);

  /* —— 字体 —— */
  --font-serif: "Source Serif 4", "Tiempos Headline", "GT Super Text", "Iowan Old Style", "Source Han Serif SC", "Songti SC", Georgia, "Times New Roman", serif;
  --font-sans:  "Inter", system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  --font-mono:  "JetBrains Mono", "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* —— 阴影（更柔、更暖） —— */
  --shadow-xs: 0 1px 2px rgba(60, 50, 35, 0.04);
  --shadow-sm: 0 1px 2px rgba(60, 50, 35, 0.05), 0 1px 3px rgba(60, 50, 35, 0.04);
  --shadow-md: 0 4px 12px -2px rgba(60, 50, 35, 0.07), 0 2px 6px -1px rgba(60, 50, 35, 0.04);
  --shadow-lg: 0 10px 32px -6px rgba(60, 50, 35, 0.12), 0 4px 12px -2px rgba(60, 50, 35, 0.06);
  --shadow-pop: 0 20px 44px -12px rgba(60, 50, 35, 0.18), 0 6px 16px -6px rgba(60, 50, 35, 0.08);

  /* —— 圆角 —— */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius:    10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-pill: 999px;

  /* —— 间距 —— */
  --gap-1: 4px;
  --gap-2: 8px;
  --gap-3: 12px;
  --gap-4: 16px;
  --gap-5: 20px;
  --gap-6: 24px;
  --gap-8: 32px;

  /* —— 运动 —— */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --t-fast: 120ms;
  --t:      180ms;
  --t-slow: 260ms;
}

/* ========== Reset / base ========== */

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

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

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 540px at 88% -80px, rgba(204, 120, 92, 0.10), transparent 65%),
    radial-gradient(700px 480px at -120px 140px, rgba(196, 168, 120, 0.10), transparent 70%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
}

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

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

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

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

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--text-strong);
}

h1 {
  font-size: clamp(24px, 1.9vw, 30px);
  line-height: 1.2;
  font-weight: 500;
}

h2 {
  font-size: 20px;
  line-height: 1.3;
  font-weight: 500;
}

h3 {
  font-size: 15px;
  line-height: 1.4;
  font-weight: 600;
}

p {
  color: var(--muted);
}

::selection {
  background: var(--brand-100);
  color: var(--brand-800);
}

/* ========== Utility ========== */

.hidden { display: none !important; }
.preline { white-space: pre-line; }
.muted-text { color: var(--muted); }

/* ========== Login screen ========== */

body[data-role="LOGIN"] {
  min-height: 100vh;
  background:
    radial-gradient(760px 420px at 82% 18%, rgba(181, 101, 73, 0.14), transparent 68%),
    radial-gradient(680px 360px at 18% 82%, rgba(139, 134, 118, 0.16), transparent 64%),
    linear-gradient(135deg, #f7f3ea 0%, #eee8dc 48%, #e2d4c2 100%),
    var(--bg);
  overflow-x: hidden;
}

body[data-role="LOGIN"]::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(74, 72, 67, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(74, 72, 67, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(120deg, transparent, #000 30%, #000 70%, transparent);
  opacity: 0.42;
}

body[data-role="LOGIN"]::after {
  content: none;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  isolation: isolate;
}

.login-stage {
  width: min(100%, 920px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.78fr);
  gap: 14px;
  align-items: stretch;
  animation: loginEnter 420ms var(--ease) both;
}

.login-brand-panel,
.login-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(90, 82, 70, 0.14);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.74);
  -webkit-backdrop-filter: blur(16px) saturate(128%);
  backdrop-filter: blur(16px) saturate(128%);
  box-shadow: 0 24px 58px rgba(60, 50, 35, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

.login-brand-panel {
  min-height: 460px;
  display: grid;
  align-content: space-between;
  padding: 32px;
  color: rgba(255, 255, 255, 0.92);
  background:
    linear-gradient(135deg, rgba(45, 44, 40, 0.98), rgba(74, 64, 54, 0.95) 58%, rgba(102, 54, 38, 0.88)),
    var(--cream-900);
}

.login-brand-panel::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(250, 232, 223, 0.12);
  border-radius: 16px;
  pointer-events: none;
}

.login-brand-panel::after {
  content: none;
}

.login-brand-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(250, 232, 223, 0.2);
  border-radius: 15px;
  background: linear-gradient(135deg, rgba(204, 120, 92, 0.86), rgba(102, 54, 38, 0.92));
  box-shadow: 0 16px 34px rgba(28, 28, 26, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.login-brand-mark span {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: 8px;
  box-shadow: inset 0 0 0 5px rgba(255, 255, 255, 0.16);
}

.login-eyebrow {
  display: inline-flex;
  margin-bottom: 10px;
  color: rgba(250, 232, 223, 0.68);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.login-brand-panel h1 {
  color: #fff;
  font-size: clamp(36px, 4.2vw, 52px);
  line-height: 1.06;
  text-wrap: balance;
}

.login-brand-panel .login-hint {
  margin-top: 16px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 15px;
}

.login-visual {
  position: relative;
  min-height: 150px;
  display: grid;
  align-items: end;
}

.login-dial {
  display: none;
}

.login-meter {
  width: min(100%, 330px);
  display: grid;
  gap: 9px;
}

.login-meter i {
  display: block;
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(250, 232, 223, 0.18), rgba(250, 232, 223, 0.52));
  opacity: 0.72;
}

.login-meter i:nth-child(1) { width: 92%; }
.login-meter i:nth-child(2) { width: 76%; }
.login-meter i:nth-child(3) { width: 58%; }
.login-meter i:nth-child(4) { width: 84%; }

.login-panel {
  width: 100%;
  display: grid;
  align-content: center;
  gap: 20px;
  padding: 34px;
}

.login-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(204, 120, 92, 0.22), rgba(255, 255, 255, 0.42));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.login-panel-head {
  display: grid;
  gap: 4px;
}

.login-panel-head .login-eyebrow {
  color: var(--coral-700);
  margin: 0;
}

.login-panel-head strong {
  color: var(--text-strong);
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 600;
  line-height: 1.12;
}

.login-panel h1 {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.login-hint {
  margin: -6px 0 2px;
  color: var(--muted);
  font-size: 13px;
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-form label {
  position: relative;
}

.login-form input {
  min-height: 46px;
  border-radius: 10px;
  border: 1px solid rgba(184, 179, 164, 0.58);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease), background var(--t) var(--ease);
}

.login-form input:focus {
  background: #ffffff;
  border-color: rgba(181, 101, 73, 0.72);
  box-shadow: 0 0 0 3px rgba(204, 120, 92, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.login-form .primary-button {
  min-height: 48px;
  margin-top: 4px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--coral-600), var(--coral-700));
  box-shadow: 0 12px 24px rgba(181, 101, 73, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.24);
  overflow: hidden;
  position: relative;
}

.login-form .primary-button::after {
  content: none;
}

.login-form .primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(181, 101, 73, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

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

@media (max-width: 860px) {
  .login-stage {
    grid-template-columns: 1fr;
  }

  .login-brand-panel {
    min-height: 320px;
  }

  .login-visual {
    min-height: 110px;
  }

  .login-dial {
    width: 120px;
    height: 120px;
  }
}

.login-form label,
.user-form label,
.product-form label,
.product-form .file-picker-field,
.procurement-dialog label,
.image-form label,
.image-form .file-picker-field,
.delete-toolbar label,
.delete-confirm-panel label {
  display: grid;
  gap: 6px;
  color: var(--muted-strong);
  font-size: 12.5px;
  font-weight: 600;
}

/* ========== Shell / page header ========== */

.shell {
  width: min(100%, 1440px);
  margin: 0 auto;
  padding: 0 64px 32px;
}

/* App nav 钉在最顶部，背景实色，纸质卡片感 */
.app-nav {
  position: sticky;
  top: 0;
  z-index: 11;
  margin: 0;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 14px 14px;
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  box-shadow: 0 1px 0 rgba(60, 50, 35, 0.04);
}

.page-header {
  position: static;
  z-index: 8;
  display: grid;
  gap: 14px;
  margin: 18px 0 16px 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: none;
  padding: 20px 22px;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.topbar > div:first-child {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.topbar h1 {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-right: 8px;
}

.user-line {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 12.5px;
}

.user-line span,
.role-switcher > span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  background: var(--surface-muted);
  color: var(--muted-strong);
  font-weight: 550;
}

.user-line span:empty { display: none; }

/* 当前级别徽章高亮 */
#current-level:not(:empty) {
  background: var(--brand-50);
  color: var(--brand-700);
}

.role-switcher {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12.5px;
}

.role-switcher > span {
  background: transparent;
  padding: 0;
  color: var(--muted);
  font-weight: 600;
}

#role-switch-buttons {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0;
  padding: 3px;
  border-radius: var(--radius-pill);
  background: var(--surface-muted);
  border: 1px solid var(--line);
}

#role-switch-buttons button {
  min-height: 26px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--muted-strong);
  padding: 3px 12px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
}

#role-switch-buttons button:hover {
  color: var(--text-strong);
}

#role-switch-buttons button.active {
  background: var(--surface);
  color: var(--brand-700);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

/* ========== Summary band (index 顶部) ========== */

.summary {
  display: grid;
  grid-template-columns: minmax(180px, 224px) minmax(240px, 342px) auto minmax(220px, auto);
  gap: 14px;
  align-items: center;
  justify-content: center;
}

body[data-role="CLERK"] .summary {
  grid-template-columns: minmax(240px, 342px) auto auto;
}

body[data-role="ADMIN"] .summary {
  grid-template-columns: minmax(180px, 224px) minmax(240px, 342px) auto minmax(220px, auto);
}

.summary > div:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--coral-50), #ffffff 80%);
  padding: 4px 12px 4px 8px;
  color: var(--muted-strong);
  font-size: 12.5px;
  font-weight: 550;
}

.summary > div:first-child::before {
  content: "";
  width: 22px;
  height: 22px;
  border-radius: 6px;
  flex: 0 0 auto;
  background:
    var(--brand-100)
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b56549' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='4' width='18' height='16' rx='2'/><path d='M7 9h10M7 13h10M7 17h6'/></svg>")
    center / 14px no-repeat;
}

.summary strong {
  margin-left: auto;
  color: var(--brand-700);
  font-size: 19px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
}

.search-box {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--cream-50);
  padding: 3px 10px;
  transition: border-color var(--t) var(--ease), background var(--t) var(--ease), box-shadow var(--t) var(--ease);
}

.search-control {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 36px 36px;
  gap: 5px;
  align-items: center;
  min-width: 0;
  width: 100%;
  max-width: 342px;
}

.search-control .search-box {
  min-width: 0;
}

.search-box > span[aria-hidden="true"] {
  position: relative;
  width: 16px;
  height: 16px;
  display: block;
}

.search-box > span[aria-hidden="true"]::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 8px;
  height: 8px;
  border: 1.8px solid var(--muted);
  border-radius: 999px;
}

.search-box > span[aria-hidden="true"]::after {
  content: "";
  position: absolute;
  left: 10px;
  top: 10px;
  width: 6px;
  height: 1.8px;
  border-radius: 999px;
  background: var(--muted);
  transform: rotate(45deg);
  transform-origin: left center;
}

.search-action {
  width: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  white-space: nowrap;
}

.search-action.icon-only {
  position: relative;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  color: var(--muted-strong);
  font-size: 0;
  line-height: 1;
}

.search-action.icon-only::before,
.search-action.icon-only::after {
  content: "";
  display: block;
  position: absolute;
  left: 50%;
  top: 50%;
  transform-origin: center;
}

.search-action.icon-only.confirm-icon::before {
  width: 13px;
  height: 7px;
  border-left: 2.2px solid currentColor;
  border-bottom: 2.2px solid currentColor;
  border-radius: 1px;
  transform: translate(-50%, -60%) rotate(-45deg);
}

.search-action.icon-only.clear-icon::before,
.search-action.icon-only.clear-icon::after {
  width: 15px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.search-action.icon-only.clear-icon::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.search-action.icon-only.clear-icon::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.search-action.icon-only:disabled {
  color: var(--muted-strong);
  opacity: 1;
  background: var(--surface);
  border-color: var(--line);
}

.filter-segment {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 40px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--cream-50);
  white-space: nowrap;
}

.filter-segment button {
  min-height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  color: var(--muted-strong);
  font-size: 12.5px;
  font-weight: 650;
}

.filter-segment button:hover {
  background: var(--surface);
  color: var(--text-strong);
}

.filter-segment button.active {
  background: var(--surface);
  color: var(--coral-700);
  box-shadow: var(--shadow-sm);
}

.search-box:focus-within {
  border-color: var(--coral-400);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--primary-ring);
}

.search-box span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}

.search-box span::before {
  content: "";
  width: 16px;
  height: 16px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b8676' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='7'/><path d='m21 21-4.3-4.3'/></svg>") center / contain no-repeat;
}

.search-box input {
  border: 0;
  min-height: 30px;
  padding: 0;
  background: transparent;
  font-size: 13.5px;
}

.search-box input:focus {
  border: 0;
  box-shadow: none;
  outline: none;
}

.summary-actions,
.admin-page-links,
.user-actions,
.gift-card-actions,
.product-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.product-card-actions {
  margin-top: 2px;
}

.summary-actions {
  justify-content: flex-end;
}

.admin-page-links,
.gift-card-actions,
.product-card-actions {
  justify-content: flex-end;
}

.form-mode-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--surface-muted);
  color: var(--muted-strong);
  font-size: 12.5px;
  font-weight: 700;
}

#gift-admin-panel.editing-mode {
  border-color: var(--coral-300);
  box-shadow: 0 0 0 1px rgba(204, 120, 92, 0.14), var(--shadow-sm);
}

#gift-admin-panel.editing-mode .form-mode-badge {
  border-color: var(--brand-200);
  background: var(--brand-50);
  color: var(--brand-700);
}

/* ========== Floating jump nav (上 / 中 / 下) ========== */

.page-jump-nav {
  position: fixed;
  right: 14px;
  top: 50%;
  z-index: 30;
  display: grid;
  gap: 4px;
  transform: translateY(-50%);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-lg);
  padding: 5px;
  backdrop-filter: blur(10px);
}

.page-jump-nav button {
  width: 36px;
  height: 32px;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--muted-strong);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
}

.page-jump-nav button:hover {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.jump-icon {
  display: inline-block;
  color: currentColor;
}

.jump-icon-up,
.jump-icon-down {
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
}

.jump-icon-up {
  border-bottom: 8px solid currentColor;
}

.jump-icon-down {
  border-top: 8px solid currentColor;
}

.jump-icon-mid {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
}

/* ========== Panels（通用面板/卡片容器） ========== */

.table-panel,
.form-panel,
.admin-panel,
.pending-shipping-panel,
.pending-procurement-panel,
.recent-task-panel,
.operation-panel,
.image-side-panel,
.delete-confirm-panel,
.shipping-status {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.table-panel,
.product-panel,
.shipping-panel,
.gift-panel,
.log-panel,
.delete-panel {
  overflow: visible;
}

.product-panel,
.gift-panel,
.log-panel,
.delete-panel {
  background: transparent;
  border: 0;
  box-shadow: none;
}

.shipping-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

/* —— pending 系列：左侧色条 + 浅底色 —— */

.pending-shipping-panel,
.pending-procurement-panel,
.recent-task-panel {
  margin-bottom: 10px;
  padding: 12px 14px;
  position: relative;
  overflow: hidden;
}

.pending-shipping-panel::before,
.pending-procurement-panel::before,
.recent-task-panel::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}

.pending-shipping-panel {
  background: linear-gradient(180deg, var(--sky-50), var(--surface) 70%);
  border-color: var(--sky-100);
}
.pending-shipping-panel::before { background: var(--sky-500); }

.pending-procurement-panel {
  background: linear-gradient(180deg, var(--amber-50), var(--surface) 70%);
  border-color: var(--amber-100);
}
.pending-procurement-panel::before { background: var(--amber-500); }

.recent-task-panel {
  margin-top: 14px;
  background: linear-gradient(180deg, var(--surface), var(--surface-subtle));
  border-color: var(--line);
}

.recent-task-panel::before { background: var(--coral-500); }

.recent-task-panel details {
  display: grid;
  gap: 10px;
}

.recent-task-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
  color: var(--text-strong);
  font-weight: 750;
}

.recent-task-panel summary::-webkit-details-marker {
  display: none;
}

.recent-task-panel summary::after {
  content: "展开";
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--muted-strong);
  background: var(--surface);
  font-size: 12px;
  font-weight: 650;
}

.recent-task-panel details[open] summary::after {
  content: "收起";
}

.recent-task-panel summary strong {
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.recent-task-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.recent-task-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 10px 12px;
  box-shadow: var(--shadow-xs);
}

.recent-task-card.is-archived {
  border-color: var(--line);
  background: var(--cream-150);
  box-shadow: none;
  color: var(--muted);
  filter: grayscale(0.35);
  opacity: 0.72;
}

.recent-task-card.is-archived .recent-task-kind,
.recent-task-card.is-archived .recent-task-main strong,
.recent-task-card.is-archived p,
.recent-task-card.is-archived dt,
.recent-task-card.is-archived dd {
  color: var(--muted);
}

.recent-task-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.recent-task-main > div {
  display: grid;
  gap: 3px;
}

.recent-task-kind {
  color: var(--muted);
  font-size: 12px;
}

.recent-task-main strong {
  color: var(--text-strong);
  font-size: 14px;
  font-weight: 700;
}

.recent-task-card p {
  margin: 0;
  color: var(--muted-strong);
  font-size: 13px;
  line-height: 1.55;
}

.recent-task-state {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 0 9px;
  background: var(--surface-subtle);
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.recent-task-state.is-done {
  border-color: var(--green-100);
  background: var(--green-50);
  color: var(--green-700);
}

.recent-task-state.is-waiting,
.recent-task-state.is-processing {
  border-color: var(--amber-100);
  background: var(--amber-50);
  color: var(--amber-700);
}

.recent-task-state.is-cancelled {
  border-color: var(--line);
  background: var(--surface-subtle);
  color: var(--muted);
}

.recent-task-card.is-archived .recent-task-state,
.recent-task-card.is-archived .recent-task-state.is-done,
.recent-task-card.is-archived .recent-task-state.is-cancelled {
  border-color: var(--line);
  background: var(--cream-100);
  color: var(--muted);
}

.recent-task-times {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.recent-task-times div {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  padding: 6px 8px;
}

.recent-task-times dt {
  color: var(--muted);
  font-size: 12px;
}

.recent-task-times dd {
  margin: 2px 0 0;
  color: var(--text-strong);
  font-size: 13px;
  font-weight: 650;
}

.my-push-status-panel {
  position: relative;
  margin-top: 18px;
  padding: 16px 18px 18px;
  border: 1px solid rgba(204, 120, 92, 0.22);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 251, 246, 0.9));
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

.my-push-status-panel::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--coral-500);
}

.my-push-status-panel h2 {
  margin: 0;
  color: var(--text-strong);
  font-size: 18px;
  line-height: 1.2;
  font-weight: 700;
}

.my-push-status-panel .panel-title-row p,
.push-status-total {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}

.push-status-total {
  margin-top: 0;
  white-space: nowrap;
}

.push-status-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.push-status-empty {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.push-status-archive {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.push-status-archive summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 750;
  list-style: none;
}

.push-status-archive summary::-webkit-details-marker {
  display: none;
}

.push-status-archive summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.push-status-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px 14px;
  box-shadow: var(--shadow-xs);
}

.push-status-card.is-waiting {
  border-color: rgba(204, 120, 92, 0.34);
}

.push-status-card.is-processing {
  border-color: rgba(204, 120, 92, 0.32);
}

.push-status-card.is-done {
  border-color: rgba(86, 114, 72, 0.22);
  background: #fbfcf8;
}

.push-status-archive .push-status-card,
.push-status-card.is-archived {
  border-color: var(--line);
  background: var(--cream-150);
  box-shadow: none;
  color: var(--muted);
  filter: grayscale(0.35);
  opacity: 0.72;
}

.push-status-card.is-cancelled {
  background: #f5f2ed;
  color: var(--muted);
}

.push-status-main {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.push-status-main > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.push-status-kind {
  color: var(--coral-700);
  font-size: 12px;
  font-weight: 700;
}

.push-status-main strong {
  color: var(--text-strong);
  font-size: 14.5px;
  line-height: 1.3;
}

.push-status-state {
  flex: 0 0 auto;
  border: 1px solid rgba(204, 120, 92, 0.24);
  border-radius: 999px;
  background: var(--coral-50);
  color: var(--coral-700);
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.push-status-state.is-processing {
  border-color: var(--sky-100);
  background: var(--sky-50);
  color: var(--sky-600);
}

.push-status-state.is-done {
  border-color: rgba(86, 114, 72, 0.24);
  background: #f1f5ec;
  color: #4a633a;
}

.push-status-archive .push-status-state,
.push-status-card.is-archived .push-status-state,
.push-status-card.is-archived .push-status-state.is-done,
.push-status-card.is-archived .push-status-state.is-cancelled {
  border-color: var(--line);
  background: var(--cream-100);
  color: var(--muted);
}

.push-status-state.is-cancelled {
  border-color: var(--line);
  background: var(--cream-100);
  color: var(--muted);
}

.push-status-archive .push-status-kind,
.push-status-archive .push-status-main strong,
.push-status-archive .push-status-card p,
.push-status-archive dt,
.push-status-archive dd,
.push-status-card.is-archived .push-status-kind,
.push-status-card.is-archived .push-status-main strong,
.push-status-card.is-archived p,
.push-status-card.is-archived dt,
.push-status-card.is-archived dd {
  color: var(--muted);
}

.push-status-card p {
  margin: 0;
  color: var(--muted-strong);
  font-size: 13px;
  line-height: 1.45;
}

.push-status-times {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin: 0;
}

.push-status-times div {
  display: grid;
  gap: 2px;
}

.push-status-times dt,
.push-status-times dd {
  margin: 0;
  font-size: 12px;
}

.push-status-times dt {
  color: var(--muted);
}

.push-status-times dd {
  color: var(--muted-strong);
  font-weight: 650;
}

.push-status-actions {
  display: flex;
  justify-content: flex-end;
}

/* 管理员推送 / 模具变更 用蓝色 */
#admin-notification-panel,
#super-admin-alert-panel,
#admin-notice-section {
  background: linear-gradient(180deg, var(--coral-50), var(--surface) 70%);
  border-color: var(--brand-100);
}
#admin-notification-panel::before,
#super-admin-alert-panel::before,
#admin-notice-section::before {
  background: var(--brand-500);
}

.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.panel-title-row h2 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.panel-title-row p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.pending-shipping-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.pending-shipment {
  display: grid;
  grid-template-columns: minmax(180px, 0.85fr) minmax(260px, 1.7fr) auto;
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 10px 12px;
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease);
}

.pending-shipment:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.pending-shipment > div,
.pending-shipment li {
  display: grid;
  gap: 4px;
}

.pending-shipment ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted-strong);
}

.pending-shipment ul li::marker {
  color: var(--brand-400);
}

.pending-shipment span,
.pending-shipment p {
  color: var(--muted);
  font-size: 12.5px;
}

.pending-shipment > div strong {
  color: var(--text-strong);
  font-size: 14px;
  font-weight: 650;
}

.pending-shipment-status {
  justify-self: end;
  align-self: center;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--brand-100);
  border-radius: 999px;
  background: var(--coral-50);
  color: var(--coral-700);
  font-size: 12.5px;
  font-weight: 650;
  white-space: nowrap;
}

.procurement-handle-note {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.procurement-handle-note label {
  display: grid;
  gap: 6px;
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 650;
}

.procurement-handle-note input,
.procurement-handle-note textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  color: var(--text);
  padding: 9px 10px;
  font: inherit;
  line-height: 1.45;
}

.procurement-handle-note textarea {
  min-height: 74px;
  resize: vertical;
}

.procurement-handle-note input:focus,
.procurement-handle-note textarea:focus {
  border-color: rgba(204, 120, 92, 0.52);
  box-shadow: 0 0 0 3px rgba(204, 120, 92, 0.12);
  outline: 0;
}

.procurement-handle-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.procurement-order-editor {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  align-items: end;
  gap: 8px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  padding: 8px;
}

.procurement-order-editor label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.procurement-order-editor input {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  background: var(--surface);
  color: var(--text);
  padding: 7px 9px;
  font: inherit;
}

.mold-request-status-item {
  grid-template-columns: minmax(190px, 0.9fr) minmax(260px, 1.5fr) minmax(170px, auto);
}

.mold-request-status-side {
  justify-self: end;
  align-self: center;
  display: grid;
  justify-items: end;
  gap: 4px;
  text-align: right;
}

.mold-request-state {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 0 10px;
  background: var(--surface-subtle);
  color: var(--muted-strong);
  font-size: 12.5px;
  font-weight: 750;
  white-space: nowrap;
}

.mold-request-state.is-waiting {
  border-color: rgba(204, 120, 92, 0.32);
  background: var(--coral-50);
  color: var(--coral-800);
}

.mold-request-state.is-processing {
  border-color: var(--sky-100);
  background: var(--sky-50);
  color: var(--sky-600);
}

.mold-request-state.is-done {
  border-color: rgba(86, 114, 72, 0.24);
  background: #f1f5ec;
  color: #4a633a;
}

.mold-request-state.is-cancelled {
  border-color: var(--line);
  background: var(--cream-100);
  color: var(--muted);
}

.mold-request-inline strong,
.mold-request-inline b {
  color: var(--text-strong);
  font-weight: 800;
}

/* ========== Admin panel & forms ========== */

.admin-panel,
.form-panel {
  margin-bottom: 12px;
  padding: 14px 16px;
}

.page-header + .form-panel {
  margin: -4px 0 14px;
  border-color: var(--coral-300);
  box-shadow: 0 0 0 1px rgba(204, 120, 92, 0.10), var(--shadow-sm);
}

.user-form,
.product-form {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.user-form {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: end;
}

.product-form {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: start;
}

.add-form-row,
.add-image-field,
.add-spec-section,
.add-gift-selector {
  grid-column: 1 / -1;
}

.add-form-row {
  display: grid;
  grid-template-columns: 92px minmax(260px, 1fr) minmax(180px, 240px) minmax(120px, 150px);
  gap: 10px;
  align-items: end;
}

.add-form-row .add-product-id input {
  text-align: center;
  font-feature-settings: "tnum";
}

.add-form-row .add-product-name {
  min-width: 0;
}

.add-image-field {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 8px 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-subtle);
  padding: 10px 12px;
}

.add-image-field > span {
  color: var(--muted-strong);
  font-size: 12.5px;
  font-weight: 650;
}

.add-image-main,
.add-image-sources,
.add-image-link-panel {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.add-image-sources,
.add-image-link-panel,
.add-image-link-display {
  grid-column: 2 / -1;
}

.add-image-link-panel input {
  flex: 1 1 260px;
}

.add-image-link-display {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.add-image-link-display span {
  color: var(--muted-strong);
}

.add-spec-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-subtle);
  padding: 12px 14px 14px;
}

.add-spec-section legend,
.add-gift-selector legend {
  color: var(--muted-strong);
  font-size: 12.5px;
  font-weight: 650;
  padding: 0 6px;
}

.add-spec-grid {
  --add-spec-divider: #ded6c8;
  display: grid;
  grid-template-columns: repeat(10, minmax(92px, 1fr));
  gap: 8px;
}

.add-spec-field {
  position: relative;
  display: grid;
  gap: 5px;
  min-width: 0;
}

.add-spec-field.divide-after {
  padding-right: 12px;
  margin-right: 2px;
}

.add-spec-field.divide-after::after {
  content: "";
  position: absolute;
  top: 3px;
  right: 0;
  bottom: 3px;
  width: 1px;
  background: var(--add-spec-divider);
}

.add-spec-field span {
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 650;
}

.add-gift-grid.gift-option-grid {
  display: flex;
  max-height: 118px;
  overflow: auto;
  padding: 0;
  background: transparent;
}

.add-gift-grid .gift-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.product-form > button[type="submit"] {
  min-width: 220px;
  justify-self: center;
}

.file-picker-control {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  min-width: 0;
}

.file-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  padding: 5px 12px;
  font-size: 12.5px;
  font-weight: 650;
  cursor: pointer;
  user-select: none;
}

.file-trigger:hover {
  border-color: var(--brand-300);
  background: var(--brand-50);
  color: var(--brand-700);
}

.file-trigger input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.file-name {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.checkbox-label {
  grid-template-columns: auto 1fr;
  align-items: center;
  min-height: 38px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-subtle);
}

.checkbox-label input,
.gift-option input,
.operation-check input {
  width: auto;
  min-height: auto;
}

/* ========== Tables ========== */

.users-table-wrap,
.history-table-wrap {
  overflow: auto;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
}

th,
td {
  border-bottom: 1px solid var(--line-soft);
  padding: 11px 14px;
  vertical-align: middle;
  overflow-wrap: anywhere;
  text-align: left;
}

th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: var(--surface-soft);
  color: var(--muted-strong);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

th span {
  color: var(--muted);
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}

tbody tr {
  transition: background var(--t-fast) var(--ease);
}

tbody tr:hover td {
  background: var(--surface-soft);
}

tbody tr:last-child td {
  border-bottom: 0;
}

.users-table,
.history-table {
  min-width: 720px;
}

.empty-row {
  min-height: 140px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
  padding: 24px;
}

#table-scroll {
  overflow: visible;
}

/* ========== Images ========== */

.image-link {
  display: inline-flex;
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease);
}

.image-link:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.product-image,
.no-image {
  width: 128px;
  height: 128px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.product-image {
  object-fit: contain;
}

.no-image {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  border-style: dashed;
  background: var(--surface-subtle);
  font-size: 12px;
}

/* ========== Product grid / cards ========== */

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(560px, 1fr));
  grid-auto-flow: dense;
  gap: 12px;
  align-items: start;
}

.product-empty {
  grid-column: 1 / -1;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 28px;
}

/* 展开 / 编辑态：卡片保持在原列位，详情作为独立全宽行渲染（见 .product-grid > .product-detail） */
/* ============================================================
 *  Product card v2 — 按 PS 稿（banner / body / stats 三段式）
 * ============================================================ */
.product-card {
  display: grid;
  grid-template-rows: auto auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 1px 0 rgba(60, 50, 35, 0.04);
  overflow: hidden;
  padding: 0;
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}

.product-card.has-quantity-editor {
  overflow: visible;
  z-index: 9;
}

.product-card:has(.mold-status[open]) {
  overflow: visible;
  z-index: 10;
}

.product-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 1px 2px rgba(60, 50, 35, 0.06), 0 2px 8px -2px rgba(60, 50, 35, 0.06);
  transform: none;
}

/* ——— Banner ——— */
.product-card-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  min-height: 52px;
  background: var(--cream-50);
}

.product-card-number {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  background: transparent;
  border: 0;
  padding: 0;
  border-radius: 0;
  width: auto;
  max-width: none;
  color: inherit;
  font-weight: normal;
}

.product-card-number .k {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.product-card-number .v {
  font-family: var(--font-serif);
  color: var(--coral-600);
  font-size: 24px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.02em;
  font-feature-settings: "tnum";
}

/* Banner actions */
.product-card-actions {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  margin: 0;
  min-width: 0;
}

.product-card-actions .btn-ghost,
.product-card-actions .btn-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 26px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease), color var(--t) var(--ease);
  white-space: nowrap;
}

.product-card-actions .btn-ghost {
  border: 1px solid var(--line-strong);
  background: #ffffff;
  color: var(--muted-strong);
}

.product-card-actions .btn-ghost:hover {
  background: var(--cream-100);
  border-color: var(--cream-400);
  color: var(--text-strong);
}

.product-card-actions .btn-ghost .icon.chev {
  width: 12px;
  height: 12px;
  display: inline-block;
}

.product-card-actions .btn-edit {
  border: 1px solid var(--muted);
  background: var(--cream-150);
  color: var(--text-strong);
}

.product-card-actions .btn-edit:hover {
  background: var(--line);
  border-color: var(--muted-strong);
}

/* ——— Body ——— */
.product-card-body {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
}

.product-card-image {
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-subtle);
}

.product-card-image .product-image,
.product-card-image .no-image,
.product-card-image .image-link,
.product-card-image .image-link img {
  width: 96px;
  height: 96px;
  border-radius: 10px;
  border: 0;
}

.product-card-image .no-image {
  background: var(--cream-100);
  color: var(--muted);
  border: 1px dashed var(--line-strong);
}

.product-card-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  min-height: 96px;
}

.product-card-titleline {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  flex-wrap: wrap;
}

.product-card-number-inline {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  font-feature-settings: "tnum";
}

.product-card-name {
  flex: 0 1 auto;
  min-width: 0;
  margin: 0;
  font-family: var(--font-serif);
  font-size: 18.5px;
  font-weight: 500;
  line-height: 1.25;
  color: var(--text-strong);
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}

.product-card-fields {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.product-card-field {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  min-height: 18px;
  font-size: 13px;
  min-width: 0;
}

.product-card-field .k {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  padding-top: 1px;
  letter-spacing: 0;
  text-transform: none;
}

.product-card-field .v {
  flex: 1 1 0;
  min-width: 0;
  color: var(--text-strong);
  font-size: 13px;
  font-weight: 400;
  overflow-wrap: anywhere;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.product-card-field .v.muted {
  color: var(--cream-400);
}

.product-card-field .gift-tags {
  gap: 4px;
}

.product-card-field .gift-tags span {
  background: var(--coral-50);
  color: var(--muted-strong);
  border: 0;
  border-radius: 999px;
  height: 22px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 500;
  line-height: 22px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}

.product-card-field .pdf-link,
.product-card-field .barcode-stack span,
.product-card-field .muted-text,
.product-card-meta-line .pdf-link,
.product-card-meta-line .barcode-stack span,
.product-card-meta-line .muted-text {
  font-size: 13px;
}

.product-card-field .pdf-link,
.product-card-meta-line .pdf-link {
  color: var(--coral-600);
}

.product-card-meta-line {
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 16px;
  color: var(--text-strong);
  font-size: 13px;
  line-height: 1.5;
}

.product-card-meta-pair {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.product-card-meta-pair .k {
  flex: 0 0 auto;
  color: var(--muted);
  font-weight: 400;
}

.product-card-meta-pair .v {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  overflow-wrap: anywhere;
}

.code-pdf-inline {
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.code-pdf-inline .code-value,
.code-pdf-inline .pdf-value {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.code-pdf-inline .code-value {
  color: var(--text-strong);
  font-weight: 500;
}

.code-pdf-inline .inline-separator {
  color: var(--line-strong);
}

.code-pdf-inline .pdf-link,
.code-pdf-inline .muted-text {
  white-space: nowrap;
}

/* ——— Stats footer ——— */
.product-card-stats {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(150px, 0.72fr);
  background: var(--surface-subtle);
  border-top: 1px solid var(--line);
}

.product-card-stats--single {
  grid-template-columns: 1fr;
}

.product-card-stats--clerk {
  grid-template-columns: minmax(0, 1fr) minmax(150px, 0.72fr);
}

.product-card-stat {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 7px 12px;
  min-width: 0;
}

.product-card-stat + .product-card-stat {
  border-left: 1px solid var(--line);
}

.product-card-stats > .product-card-actions {
  min-width: 0;
  min-height: 44px;
  padding: 7px 12px;
  border-left: 1px solid var(--line);
  flex-wrap: nowrap;
  justify-content: space-between;
}

.product-card-stats > .product-card-actions.product-card-actions--toggle-only {
  justify-content: flex-end;
}

.product-card-stat .k {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
}

.product-card-stat .stat-value {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 auto;
  min-width: 0;
  justify-content: flex-start;
}

.product-card-stat .quantity-display {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  width: auto;
  margin: 0;
  padding: 0;
}

.product-card-stat .quantity-edit-host {
  display: flex;
  width: 100%;
  min-width: 0;
}

.product-card-stat .quantity-editor {
  position: absolute;
  left: 10px;
  bottom: calc(100% + 8px);
  z-index: 8;
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  justify-items: stretch;
  gap: 8px;
  width: max-content;
  min-width: 202px;
  max-width: min(240px, calc(100vw - 32px));
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 10px 22px rgba(60, 50, 35, 0.12), 0 0 0 1px rgba(204, 120, 92, 0.08);
}

.product-card-stat .quantity-step-row {
  display: grid;
  grid-template-columns: 30px 30px minmax(58px, auto) minmax(58px, auto);
  align-items: center;
  justify-items: center;
  gap: 8px;
}

.product-card-stat.molds .quantity-editor {
  right: 10px;
  left: auto;
}

.product-card-stat .quantity-editor::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 28px;
  width: 10px;
  height: 10px;
  border-right: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  background: #ffffff;
  transform: rotate(45deg);
}

.product-card-stat.molds .quantity-editor::after {
  right: 28px;
  left: auto;
}

.product-card-stat .quantity-display strong.v {
  color: var(--text-strong);
  font-size: 20px;
  font-weight: 600;
  line-height: 20px;
  letter-spacing: -0.01em;
  font-feature-settings: "tnum";
}

.product-card-stat .quantity-display strong.v.zero {
  color: var(--danger);
}

.product-card-stat .quantity-display .quantity-max {
  color: var(--muted-strong);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
}

.product-card-stat .quantity-display .unit-sub {
  display: inline;
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}

.product-card-stat .quantity-display .quantity-unit {
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 600;
  margin-left: -2px;
}

.product-card-stat .quantity-display .quantity-inline-delta {
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 700;
  font-feature-settings: "tnum";
  white-space: nowrap;
}

.product-card-stat .quantity-display .quantity-inline-delta.is-up {
  color: var(--success);
}

.product-card-stat .quantity-display .quantity-inline-delta.is-down {
  color: var(--danger);
}

.product-card-stat.stock .quantity-display {
  gap: 8px;
}

.product-card-stat.stock .quantity-display strong.v {
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
  line-height: 20px;
}

.product-card-stat.stock .quantity-display strong.v.zero {
  color: var(--text);
}

.product-card-stat.stock .quantity-display .unit-sub {
  color: var(--muted-strong);
  font-size: 12.5px;
}

.delete-blocker {
  color: var(--danger);
  font-size: 12px;
  font-weight: 650;
}

.product-card-stat .btn-ghost.btn-xs {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  min-width: 0;
  padding: 0 7px;
  border-radius: 5px;
  border: 1px solid var(--line-strong);
  background: #ffffff;
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  margin-left: 2px;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease), color var(--t) var(--ease);
}

.product-card-stat .btn-ghost.btn-xs:hover {
  background: var(--cream-100);
  border-color: var(--cream-400);
  color: var(--text-strong);
}

.product-card-stat .mold-status {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  align-self: center;
  height: 22px;
  margin-left: -4px;
}

.product-card-stat .mold-status summary {
  list-style: none;
  width: 22px;
  height: 22px;
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 1px solid rgba(204, 120, 92, 0.45);
  border-radius: 999px;
  background: var(--coral-50);
  color: var(--coral-700);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.product-card-stat .mold-status summary::-webkit-details-marker {
  display: none;
}

.product-card-stat .mold-status summary span:not(.mold-status-dot) {
  display: none;
}

.mold-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--coral-600);
  box-shadow: 0 0 0 3px rgba(204, 120, 92, 0.14);
}

.mold-status-card {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 12;
  width: min(280px, calc(100vw - 40px));
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  border: 1px solid rgba(204, 120, 92, 0.34);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(60, 50, 35, 0.14);
}

.mold-status-card::after {
  content: "";
  position: absolute;
  right: 8px;
  bottom: -6px;
  width: 10px;
  height: 10px;
  border-right: 1px solid rgba(204, 120, 92, 0.34);
  border-bottom: 1px solid rgba(204, 120, 92, 0.34);
  background: #fff;
  transform: rotate(45deg);
}

.mold-status-card strong {
  color: var(--text-strong);
  font-size: 12.5px;
}

.mold-status-card span,
.mold-status-card p {
  margin: 0;
  color: var(--muted-strong);
  font-size: 12px;
  line-height: 1.5;
}

.mold-status-action {
  justify-self: start;
  height: 26px;
  border: 1px solid rgba(204, 120, 92, 0.42);
  border-radius: 7px;
  background: var(--coral-50);
  color: var(--coral-800);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.mold-status-action:hover {
  background: var(--coral-100);
}

/* 编辑模式的小型 +/- 步进 */
.product-card-stat .quantity-step {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: #ffffff;
  color: var(--muted-strong);
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.product-card-stat .quantity-step:hover {
  background: var(--cream-100);
  border-color: var(--coral-600);
  color: var(--coral-600);
}

.product-card-stat .quantity-editor .confirm-button,
.product-card-stat .quantity-editor .cancel-button {
  grid-column: auto;
  width: 100%;
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: 6px;
  margin-left: 0;
  white-space: nowrap;
}

.product-card-stat .quantity-editor .confirm-button {
  background: var(--coral-600);
  color: #fff;
  border: 0;
}

.product-card-stat .quantity-editor .cancel-button {
  background: #fff;
  color: var(--muted-strong);
  border: 1px solid var(--line-strong);
}

/* ——— editing / expanded 状态 ——— */
.product-card.expanded,
.product-card.editing {
  border-color: var(--coral-500);
  box-shadow: 0 0 0 2px rgba(204, 120, 92, 0.16), var(--shadow-sm);
}

.product-card.editing .product-card-stats,
.product-card.expanded .product-card-stats {
  background: linear-gradient(180deg, var(--coral-50), #ffffff 70%);
}

/* 旧的 .product-card 悬浮 / 状态样式已被上方新版规则取代 */

/* 旧的 .product-card-* 卡片样式块已移除 —— 新结构定义在文件上方
   只保留产品卡之外其他面板字段的标签字号 */
.detail-field > span,
.shipping-field > span,
.gift-detail-card > span,
.image-meta-grid span,
.delete-toolbar > label > span,
.delete-confirm-panel > label > span,
.console-draft-card span,
.operation-item-main > span,
.history-shipment-head span,
.delete-card > div > span,
.gift-card-main > span,
.gift-card-main > p,
.log-entry > div > span {
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: 0.02em;
  font-weight: 550;
}

.detail-field strong,
.shipping-field strong {
  min-width: 0;
  font-weight: 650;
  color: var(--text-strong);
  overflow-wrap: anywhere;
}

/* 独立的全宽详情行：紧贴在被展开卡片所在行的下方 */
.product-grid > .product-detail {
  grid-column: 1 / -1;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(204, 120, 92, 0.10), var(--shadow-sm);
  padding: 0;
  margin: -4px 0 0;
  position: relative;
  overflow: visible;
}

.product-grid > .product-detail::before {
  content: "";
  position: absolute;
  top: -8px;
  width: 2px;
  height: 8px;
  border-radius: 999px;
  background: var(--coral-500);
  box-shadow: 0 0 0 2px rgba(204, 120, 92, 0.12);
}

.product-grid > .product-detail.detail-side-left::before {
  left: 42px;
}

.product-grid > .product-detail.detail-side-right::before {
  left: calc(50% + 42px);
}

.product-card > .product-detail {
  border-top: 1px solid var(--line);
  background: #ffffff;
}

.product-card > .product-detail .ep-panel {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.product-card > .product-detail .ep-panel-header {
  background: var(--surface-subtle);
}

.product-grid > .product-detail .ep-panel {
  border: 0;
  border-radius: 14px;
  border-top: 3px solid var(--coral-500);
  box-shadow: none;
  overflow: hidden;
}

.product-grid > .product-detail .ep-panel-header {
  border-top: 3px solid var(--coral-500);
}

.product-detail .ep {
  --ep-border: var(--line);
  --ep-border-strong: var(--line-strong);
  --ep-ink: var(--text-strong);
  --ep-ink-2: var(--muted-strong);
  --ep-ink-3: var(--muted);
  --ep-ink-4: var(--cream-400);
  --ep-indigo: var(--coral-600);
  --ep-surface: #ffffff;
  --ep-surface-2: var(--surface-subtle);
  color: var(--ep-ink);
  font-feature-settings: "tnum";
}

.ep-panel {
  border: 1px solid var(--ep-border);
  border-radius: var(--radius);
  background: var(--ep-surface);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

.ep-panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 14px;
  border-bottom: 1px solid var(--ep-border);
  background: var(--ep-surface-2);
  color: var(--ep-ink-3);
  font-size: 11px;
  line-height: 1.2;
}

.ep-panel-header .crumb {
  color: var(--ep-indigo);
  font-size: 12px;
  font-weight: 700;
}

.ep-panel-header .crumb-name {
  min-width: 0;
  color: var(--ep-ink);
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ep-panel-header .detail-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-left: auto;
  min-width: max-content;
}

.ep-panel-header .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--ep-ink-2);
  padding: 0 8px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease), color var(--t) var(--ease);
}

.ep-panel-header .btn:hover {
  border-color: var(--ep-border-strong);
  background: #ffffff;
  color: var(--ep-ink);
}

.ep-row {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  padding: 12px 4px;
}

.ep-stat {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 14px;
}

.ep-stat.divide-before {
  padding-left: 18px;
}

.ep-stat.divide-before::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  bottom: 3px;
  width: 1px;
  background: var(--ep-border);
}

.ep-stat.divide-after {
  padding-right: 18px;
}

.ep-stat.divide-after::after {
  content: "";
  position: absolute;
  right: 0;
  top: 3px;
  bottom: 3px;
  width: 1px;
  background: var(--ep-border);
}

.ep-stat .k {
  color: var(--ep-ink-3);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 15px;
}

.ep-stat .v {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 3px;
  color: var(--ep-ink);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.ep-stat .v small {
  color: var(--ep-ink-3);
  font-size: 12px;
  font-weight: 600;
}

.ep-stat .sub {
  min-height: 16px;
  color: var(--ep-ink-4);
  font-size: 12.5px;
  line-height: 16px;
  font-weight: 550;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 6px;
}

.detail-field {
  display: grid;
  gap: 2px;
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 6px 9px 7px;
  font-size: 12.5px;
}

.detail-input {
  align-content: start;
  background: var(--surface-subtle);
  gap: 4px;
  padding: 7px 10px 8px;
}

.detail-block {
  grid-column: span 3;
}

.product-card.expanded .detail-block,
.product-card.editing .detail-block {
  grid-column: span 4;
}

.edit-detail-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

/* ========== Gifts ========== */

.gift-tags,
.gift-option-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.gift-picker {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
}

.gift-picker > summary {
  min-height: 34px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  cursor: pointer;
  list-style: none;
}

.gift-picker > summary::-webkit-details-marker {
  display: none;
}

.gift-picker > summary::after {
  content: "展开";
  justify-self: end;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--muted-strong);
  background: var(--surface-subtle);
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 650;
}

.gift-picker[open] > summary::after {
  content: "收起";
}

.gift-picker.has-selection > summary {
  background: var(--brand-50);
}

.gift-picker.has-selection > summary strong {
  color: var(--brand-700);
}

.gift-picker > summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.gift-picker > summary strong {
  min-width: 0;
  color: var(--text-strong);
  font-size: 12.5px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gift-picker .gift-option-grid {
  max-height: 150px;
  overflow: auto;
  padding: 8px;
  border-top: 1px solid var(--line-soft);
  background: var(--surface-subtle);
}

.gift-tags {
  gap: 4px;
}

.gift-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  border: 1px solid var(--brand-200);
  border-radius: var(--radius-pill);
  background: var(--brand-50);
  color: var(--brand-700);
  padding: 1px 8px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.gift-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--muted-strong);
  padding: 5px 12px;
  font-size: 12.5px;
  cursor: pointer;
  transition: border-color var(--t) var(--ease), background var(--t) var(--ease), color var(--t) var(--ease);
}

.gift-option:hover {
  border-color: var(--brand-300);
  background: var(--brand-50);
  color: var(--brand-700);
}

.gift-option:has(input:checked) {
  border-color: var(--brand-500);
  background: var(--brand-100);
  color: var(--brand-800);
  font-weight: 650;
}

.gift-selector-field {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-subtle);
  padding: 14px;
}

.gift-selector-field legend {
  color: var(--muted-strong);
  font-size: 12.5px;
  font-weight: 650;
  padding: 0 6px;
}

.gift-detail-list {
  display: grid;
  gap: 8px;
}

.gift-detail-card {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-subtle);
  padding: 10px 12px;
}

.gift-param-list {
  display: grid;
  gap: 4px;
  margin: 0;
}

.gift-param-list div {
  display: grid;
  grid-template-columns: minmax(70px, 0.6fr) 1fr;
  gap: 8px;
}

.gift-param-list dt,
.gift-param-list dd {
  margin: 0;
  font-size: 12px;
}

.gift-param-list dt {
  color: var(--muted);
}

.gift-param-list dd {
  color: var(--text-strong);
  font-weight: 550;
}

/* ========== Barcodes / PDF ========== */

.barcode-stack {
  display: grid;
  gap: 3px;
  text-align: left;
}

.pdf-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--brand-600);
  font-weight: 600;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.pdf-link::before {
  content: "";
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b56549' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/><path d='M14 2v6h6'/></svg>") center / contain no-repeat;
}

.pdf-link:hover {
  color: var(--brand-700);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.barcode-pdf-input {
  gap: 8px;
}

.value-cell {
  text-align: center;
}

.unit-sub {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
  margin-top: 2px;
  font-weight: 500;
}

/* ========== Mold / stock / quantity controls ========== */

.mold-control,
.quantity-display {
  display: grid;
  gap: 3px;
  justify-items: center;
}

.stock-control {
  display: grid;
  grid-template-columns: 26px minmax(40px, 1fr) 26px;
  gap: 4px;
  align-items: center;
  justify-items: center;
}

.quantity-editor {
  display: grid;
  grid-template-columns: 26px minmax(38px, 1fr) 26px;
  gap: 4px;
  align-items: center;
  justify-items: center;
}

/* 旧的卡内 quantity 嵌入样式已废弃（数量编辑器现在在卡片底部 stats 区） */

.quantity-display strong,
.quantity-editor strong {
  font-size: 17px;
  line-height: 1.1;
  color: var(--text-strong);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.quantity-editor .confirm-button,
.quantity-editor .cancel-button,
.quantity-editor .unit-sub,
.stock-save-button {
  grid-column: 1 / -1;
  width: 100%;
}

.stock-input {
  min-width: 48px;
  text-align: center;
}

.stock-step,
.quantity-step {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--brand-600);
  border: 1px solid var(--line);
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease), color var(--t) var(--ease), transform var(--t-fast) var(--ease);
}

.stock-step:hover,
.quantity-step:hover {
  background: var(--brand-50);
  border-color: var(--brand-300);
  color: var(--brand-700);
}

.stock-step:active,
.quantity-step:active {
  transform: scale(0.94);
}

.compact-button {
  min-height: 26px;
  padding: 2px 10px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

/* ========== Role visibility helpers ========== */

.clerk-view [data-sensitive="molds"] {
  display: none;
}

.code-hidden [data-code-info] {
  display: none;
}

/* ========== Inputs ========== */

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-strong);
  padding: 8px 11px;
  outline: none;
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}

input::placeholder,
textarea::placeholder {
  color: var(--zinc-400);
}

input:hover:not(:disabled):not(:focus),
select:hover:not(:disabled):not(:focus) {
  border-color: var(--line-strong);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand-400);
  box-shadow: 0 0 0 4px var(--primary-ring);
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  min-height: auto;
  accent-color: var(--brand-500);
  cursor: pointer;
}

input[type="file"] {
  padding: 6px 8px;
  font-size: 12.5px;
}

input[type="file"]::-webkit-file-upload-button,
input[type="file"]::file-selector-button {
  margin-right: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  color: var(--muted-strong);
  font-weight: 600;
  padding: 4px 10px;
  cursor: pointer;
  transition: background var(--t) var(--ease);
}

input[type="file"]::-webkit-file-upload-button:hover,
input[type="file"]::file-selector-button:hover {
  background: var(--brand-50);
  color: var(--brand-700);
}

.mold-input {
  max-width: 72px;
  text-align: center;
}

.row-input {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 13.5px;
}

.actions {
  display: grid;
  gap: 7px;
  justify-items: stretch;
}

/* ========== Buttons ========== */

.primary-button,
.secondary-button,
.row-button,
.action-link {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 13.5px;
  letter-spacing: 0;
  white-space: nowrap;
  transition:
    background-color var(--t) var(--ease),
    border-color var(--t) var(--ease),
    color var(--t) var(--ease),
    box-shadow var(--t) var(--ease);
}

.primary-button,
.row-button {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 1px 0 rgba(143, 75, 50, 0.16) inset, 0 1px 1px rgba(60, 50, 35, 0.06);
}

.primary-button:hover,
.row-button:hover {
  background: var(--primary-strong);
  box-shadow: 0 1px 0 rgba(143, 75, 50, 0.20) inset, 0 2px 6px -1px rgba(143, 75, 50, 0.20);
}

.primary-button:active,
.row-button:active {
  box-shadow: 0 1px 1px rgba(60, 50, 35, 0.06) inset;
}

.secondary-button,
.action-link.secondary-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  box-shadow: none;
}

.secondary-button:hover,
.action-link.secondary-button:hover {
  border-color: var(--line-strong);
  background: var(--cream-50);
  color: var(--text-strong);
}

.adjust-button {
  min-height: 30px;
  border-radius: 8px;
  background: var(--amber-50);
  color: var(--amber-700);
  border: 1px solid var(--amber-100);
  padding: 4px 12px;
  font-size: 12.5px;
  font-weight: 600;
}

.adjust-button:hover {
  background: var(--amber-100);
  border-color: var(--amber-500);
}

.save-button {
  background: var(--success);
  box-shadow: 0 1px 0 rgba(63, 84, 53, 0.20) inset, 0 1px 1px rgba(60, 50, 35, 0.06);
}

.save-button:hover {
  background: var(--success-strong);
  box-shadow: 0 1px 0 rgba(63, 84, 53, 0.25) inset, 0 2px 6px -1px rgba(63, 84, 53, 0.20);
}

.cancel-button {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: none;
}

.cancel-button:hover {
  background: var(--cream-100);
  border-color: var(--line-strong);
  color: var(--text-strong);
}

.danger-button {
  background: var(--danger);
  box-shadow: 0 1px 0 rgba(116, 52, 48, 0.20) inset, 0 1px 1px rgba(60, 50, 35, 0.06);
}

.danger-button:hover {
  background: var(--danger-strong);
  box-shadow: 0 1px 0 rgba(116, 52, 48, 0.25) inset, 0 2px 6px -1px rgba(116, 52, 48, 0.20);
}

.product-form .primary-button {
  width: min(100%, 220px);
  align-self: end;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none !important;
  box-shadow: none !important;
}

/* ========== Shipping ========== */

.shipping-status {
  margin-bottom: 14px;
  color: var(--muted-strong);
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--sky-50), var(--surface) 70%);
  border-color: var(--sky-100);
  font-size: 13.5px;
}

.shipping-status::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sky-500);
  margin-right: 10px;
  vertical-align: middle;
  animation: pulse 2.4s ease-in-out infinite;
}

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

.shipping-list {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.shipping-item {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  padding: 10px;
  transition: box-shadow var(--t) var(--ease), border-color var(--t) var(--ease);
}

.shipping-item:hover {
  border-color: var(--brand-200);
  box-shadow: var(--shadow-md);
}

.shipping-item .product-image,
.shipping-item .no-image,
.shipping-item .image-link {
  width: 92px;
  height: 92px;
}

.shipping-item-main {
  min-width: 0;
}

.shipping-item-main h2 {
  margin-bottom: 8px;
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.015em;
}

.shipping-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.shipping-field {
  display: grid;
  gap: 2px;
  flex: 1 1 110px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  padding: 5px 9px 6px;
  font-size: 12.5px;
}

.operation-panel {
  display: grid;
  gap: 16px;
  margin-top: 16px;
  padding: 20px;
}

.operation-items {
  display: grid;
  gap: 10px;
}

.console-draft-card,
.operation-item,
.history-shipment-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  padding: 14px;
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}

.console-draft-card:hover,
.history-shipment-card:hover {
  border-color: var(--brand-200);
  box-shadow: var(--shadow-md);
}

.console-draft-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.console-draft-card div,
.operation-item-main,
.history-shipment-card,
.history-shipment-head > div {
  display: grid;
  gap: 5px;
}

.operation-item {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) 128px 128px auto;
  gap: 14px;
  align-items: center;
}

.operation-check,
.operation-number-input {
  display: grid;
  gap: 6px;
}

.operation-check {
  justify-items: center;
  color: var(--muted-strong);
  font-size: 12.5px;
  font-weight: 650;
}

.operation-check input {
  width: 22px;
  min-height: 22px;
}

.operation-number-input {
  align-content: start;
  color: var(--muted-strong);
  font-size: 12.5px;
  font-weight: 650;
}

.operation-number-input input {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text-strong);
  font-size: 16px;
  font-weight: 700;
}

.operation-number-input small {
  color: var(--muted);
  font-size: 12px;
}

.operation-mold-summary {
  line-height: 1.35;
}

.operation-mold-summary.changed {
  color: var(--coral-800);
  font-weight: 700;
}

.operation-mold-summary.invalid {
  color: var(--danger);
}

.operation-asin {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.operation-return-hint {
  color: var(--coral-800);
  font-size: 12.5px;
  font-weight: 650;
}

.operation-item img {
  width: 78px;
  height: 78px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-subtle);
}

.history-shipment-card {
  gap: 12px;
}

.history-shipment-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.history-record-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-left: auto;
  text-align: right;
}

.history-record-section {
  display: grid;
  gap: 10px;
}

.history-record-section + .history-record-section {
  margin-top: 14px;
}

.history-record-section > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 10px 12px;
  color: var(--text-strong);
  cursor: pointer;
  list-style: none;
  font-weight: 750;
}

.history-record-section > summary::-webkit-details-marker {
  display: none;
}

.history-record-section > summary::after {
  content: "展开";
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--muted-strong);
  background: var(--surface);
  font-size: 12px;
  font-weight: 650;
}

.history-record-section[open] > summary::after {
  content: "收起";
}

.history-record-section.is-active > summary {
  border-color: var(--brand-100);
  background: var(--coral-50);
}

.history-record-section.is-archived > summary {
  border-color: var(--line);
  background: var(--surface-subtle);
  color: var(--muted-strong);
}

.history-record-section > summary strong {
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
}

.history-section-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.history-status-tag {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 24px;
  border: 1px solid var(--brand-100);
  border-radius: 999px;
  background: var(--coral-50);
  color: var(--coral-700);
  padding: 0 9px;
  font-size: 12px;
  font-weight: 700;
}

.history-shipment-card.is-archived {
  position: relative;
  border-color: var(--line);
  background: var(--cream-150);
  box-shadow: none;
  filter: grayscale(0.4);
  opacity: 0.68;
}

.history-shipment-card.is-archived:hover {
  border-color: var(--line);
  box-shadow: none;
}

.history-shipment-card.is-archived strong,
.history-shipment-card.is-archived span,
.history-shipment-card.is-archived th,
.history-shipment-card.is-archived td {
  color: var(--muted);
}

.history-shipment-card.is-archived .history-table-wrap,
.history-shipment-card.is-archived .history-table th,
.history-shipment-card.is-archived .history-table td {
  background: transparent;
}

.history-shipment-card.is-archived::after {
  content: "已归档";
  position: absolute;
  right: 14px;
  bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--muted);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 750;
  pointer-events: none;
}

.history-shipment-head > div h2 {
  font-size: 15.5px;
}

.history-table-wrap {
  overflow-x: auto;
}

.history-table {
  min-width: 0;
  table-layout: fixed;
}

.history-table th,
.history-table td {
  padding: 9px 10px;
  font-size: 12.5px;
  line-height: 1.45;
}

.history-table th:nth-child(1),
.history-table td:nth-child(1) {
  width: 74px;
}

.history-table th:nth-child(2),
.history-table td:nth-child(2) {
  width: 26%;
}

.history-table th:nth-child(3),
.history-table th:nth-child(4),
.history-table th:nth-child(5),
.history-table td:nth-child(3),
.history-table td:nth-child(4),
.history-table td:nth-child(5) {
  width: 88px;
}

.admin-account-table th:nth-child(6),
.admin-account-table th:nth-child(7),
.admin-account-table th:nth-child(9),
.admin-account-table td:nth-child(6),
.admin-account-table td:nth-child(7),
.admin-account-table td:nth-child(9) {
  width: 86px;
}

.admin-account-table th:nth-child(8),
.admin-account-table td:nth-child(8) {
  width: 14%;
}

/* ========== Product image page ========== */

.image-workspace {
  display: grid;
  grid-template-columns: minmax(320px, 620px) minmax(280px, 1fr);
  gap: 20px;
  align-items: start;
}

.pdf-workspace {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(260px, 300px);
  gap: 20px;
  align-items: start;
}

.image-stage {
  display: grid;
  aspect-ratio: 1 / 1;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    repeating-conic-gradient(var(--zinc-50) 0% 25%, #fff 0% 50%) 0 0/24px 24px,
    var(--surface);
  box-shadow: var(--shadow-md);
  padding: 20px;
}

.image-stage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.image-print-caption {
  display: none;
}

.pdf-stage {
  min-height: 74vh;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.pdf-stage iframe {
  display: block;
  width: 100%;
  height: 74vh;
  border: 0;
  background: var(--surface);
}

.image-side-panel,
.delete-confirm-panel {
  padding: 20px;
}

.image-side-panel h2 {
  font-size: 18px;
  margin-bottom: 4px;
}

.image-meta-grid {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.image-meta-grid > div {
  display: grid;
  gap: 4px;
  border-bottom: 1px dashed var(--line);
  padding-bottom: 10px;
}

.image-meta-grid strong {
  color: var(--text-strong);
  font-weight: 650;
  font-size: 14px;
}

.image-form {
  display: grid;
  gap: 12px;
}

/* ========== Delete page ========== */

.delete-toolbar {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  padding: 16px;
}

.delete-product-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.delete-card {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  padding: 12px 14px;
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}

.delete-card:hover {
  border-color: var(--rose-100);
  box-shadow: var(--shadow-md);
}

.delete-card img {
  width: 78px;
  height: 78px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-subtle);
}

.delete-card > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.delete-card > div strong {
  color: var(--text-strong);
  font-size: 14.5px;
  font-weight: 650;
}

.delete-confirm-panel {
  position: sticky;
  bottom: 16px;
  z-index: 5;
  margin-top: 16px;
  border-color: var(--rose-100);
  background: linear-gradient(180deg, var(--rose-50), var(--surface) 60%);
  box-shadow: var(--shadow-pop);
}

.delete-confirm-panel h2 {
  color: var(--danger-strong);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.delete-confirm-panel h2::before {
  content: "";
  width: 18px;
  height: 18px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2399453f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z'/><line x1='12' y1='9' x2='12' y2='13'/><line x1='12' y1='17' x2='12.01' y2='17'/></svg>") center / contain no-repeat;
}

.delete-confirm-panel p {
  margin-bottom: 14px;
  color: var(--muted-strong);
}

/* ========== Gifts page ========== */

.gift-card-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 16px;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
}

.section-title-row h2 {
  margin: 0;
  color: var(--text-strong);
  font-size: 18px;
  line-height: 1.2;
  font-weight: 650;
}

.section-title-row span {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 650;
}

.material-panel {
  margin-top: 18px;
}

.material-card {
  border-color: var(--amber-100);
}

.material-card:hover {
  border-color: var(--amber-300);
}

.log-list {
  display: grid;
  gap: 12px;
}

.gift-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 16px;
  align-content: start;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  min-height: 92px;
  padding: 15px 16px;
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}

.gift-card:hover {
  border-color: var(--brand-200);
  box-shadow: var(--shadow-md);
}

.gift-card.is-editing {
  grid-column: 1 / -1;
  border-color: var(--coral-300);
  box-shadow: 0 12px 26px rgba(204, 120, 92, 0.12);
}

.gift-card-main {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.gift-card-main h2 {
  margin: 0;
  font-family: var(--font-serif);
  color: var(--text-strong);
  font-size: 18px;
  line-height: 1.3;
  font-weight: 500;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}

.gift-card-main > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  line-height: 1.25;
  color: var(--muted);
}

.gift-card-main > p {
  font-size: 12px;
  line-height: 1.3;
  color: var(--muted-strong);
  margin: 0;
}

.gift-weight-line {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  color: var(--muted-strong);
  font-size: 13.5px;
  line-height: 1.2;
}

.gift-weight-line span {
  color: var(--muted);
}

.gift-weight-line strong {
  color: var(--text-strong);
  font-size: 17px;
  font-weight: 750;
  font-feature-settings: "tnum";
}

.gift-weight-line em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.gift-status-text {
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-subtle);
  padding: 2px 8px;
}

.gift-card-actions {
  justify-content: flex-end;
  align-self: center;
  gap: 7px;
  flex-wrap: wrap;
}

.gift-card-actions .row-button,
.gift-card-actions .gift-image-link {
  min-height: 32px;
  padding: 5px 12px;
  font-size: 13px;
  text-decoration: none;
}

.gift-card .gift-param-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px 10px;
}

.gift-card .gift-param-list div {
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px;
  min-width: 0;
}

.gift-card .gift-param-list dt,
.gift-card .gift-param-list dd {
  font-size: 11.5px;
  line-height: 1.25;
}

.gift-card .gift-param-list dt::after {
  content: "：";
}

.procurement-actions {
  align-self: end;
  display: flex;
  justify-content: flex-end;
}

.procurement-actions .primary-button {
  min-height: 30px;
  padding: 5px 14px;
  font-size: 12.5px;
  white-space: nowrap;
}

.procurement-pushed-button {
  border-color: rgba(86, 114, 72, 0.28) !important;
  background: #eef4ea !important;
  color: #4a633a !important;
}

.procurement-pushed-button:hover {
  background: #e5efdf !important;
  color: #3f5730 !important;
}

.gift-edit-form {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  margin-top: 8px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.gift-edit-head,
.gift-edit-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.gift-edit-head strong {
  color: var(--text-strong);
  font-size: 15px;
}

.gift-edit-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1.1fr) minmax(120px, 0.55fr) minmax(240px, 1.4fr) minmax(100px, 0.45fr);
  gap: 12px;
  align-items: end;
}

.gift-edit-grid label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.gift-image-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.gift-image-input-row input {
  min-width: 0;
  flex: 1 1 auto;
}

.gift-image-input-row .action-link,
.gift-image-input-row .muted-text {
  flex: 0 0 auto;
  white-space: nowrap;
}

.parameter-editor {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-subtle);
  padding: 14px;
}

.parameter-editor .panel-title-row strong {
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 650;
}

.parameter-rows {
  display: grid;
  gap: 8px;
}

.parameter-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(140px, 1fr) minmax(90px, 0.6fr) auto;
  gap: 8px;
  align-items: center;
}

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

.procurement-backdrop {
  position: fixed;
  inset: 0;
  border: 0;
  background: rgba(28, 24, 18, 0.28);
  cursor: default;
}

.procurement-dialog {
  position: relative;
  z-index: 1;
  width: min(460px, calc(100vw - 32px));
  display: grid;
  gap: 14px;
  border: 1px solid var(--coral-200);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(60, 45, 34, 0.2);
  padding: 18px;
}

.procurement-dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 14px;
}

.procurement-dialog-head div {
  display: grid;
  gap: 4px;
}

.procurement-dialog-head span {
  color: var(--coral-700);
  font-size: 12px;
  font-weight: 700;
}

.procurement-dialog-head strong {
  color: var(--text-strong);
  font-size: 17px;
  line-height: 1.25;
}

.procurement-dialog textarea {
  min-height: 96px;
  resize: vertical;
  font-size: 13.5px;
  line-height: 1.5;
}

.procurement-submit-row {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.procurement-submit-row .primary-button,
.procurement-submit-row .secondary-button {
  min-height: 32px;
  padding: 4px 12px;
  font-size: 12.5px;
}

/* ========== Mold list page ========== */

.mold-list-shell {
  max-width: 1360px;
}

.mold-list-header {
  display: grid;
  gap: 14px;
}

.mold-list-toolbar {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(300px, 420px);
  gap: 14px;
  align-items: center;
}

.mold-total-card {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-subtle);
  padding: 9px 12px;
}

.mold-total-card span {
  color: var(--muted-strong);
  font-size: 12.5px;
  font-weight: 650;
}

.mold-total-card strong {
  font-family: var(--font-serif);
  color: var(--coral-700);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1;
  font-feature-settings: "tnum";
}

.mold-list-search {
  width: min(100%, 420px);
  max-width: none;
}

.mold-list-panel {
  display: grid;
  gap: 10px;
}

.mold-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 18px;
  align-items: start;
}

.mold-list-row {
  position: relative;
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) auto;
  gap: 12px 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  padding: 12px;
  overflow: visible;
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}

.mold-list-row:hover,
.mold-list-row.is-editing {
  border-color: var(--coral-200);
  box-shadow: var(--shadow-md);
}

.mold-list-row.is-editing {
  z-index: 6;
}

.mold-list-image {
  grid-row: 1 / span 2;
  width: 62px;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.mold-list-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.mold-list-image span {
  color: var(--muted);
  font-size: 12px;
}

.mold-list-main {
  min-width: 0;
}

.mold-list-main h2 {
  margin: 0;
  font-family: var(--font-serif);
  color: var(--text-strong);
  font-size: 18px;
  line-height: 1.3;
  font-weight: 500;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}

.mold-list-main h2 span {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.mold-total-display {
  grid-column: 2;
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 8px;
  min-width: 108px;
}

.mold-total-display span {
  color: var(--muted);
  font-size: 12px;
}

.mold-total-display strong {
  font-family: var(--font-serif);
  color: var(--text-strong);
  font-size: 22px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.015em;
  line-height: 1;
}

.mold-list-editor {
  position: absolute;
  right: 12px;
  top: calc(100% - 4px);
  z-index: 12;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  width: min(280px, calc(100vw - 40px));
  border: 1px solid var(--coral-200);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-lg);
  padding: 12px;
}

.mold-list-editor::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 38px;
  width: 10px;
  height: 10px;
  border-left: 1px solid var(--coral-200);
  border-top: 1px solid var(--coral-200);
  background: #fff;
  transform: rotate(45deg);
}

.mold-editor-values {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mold-editor-values span {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-subtle);
  padding: 8px 10px;
}

.mold-editor-values em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.mold-editor-values b {
  color: var(--text-strong);
  font-size: 19px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.mold-editor-step-row,
.mold-editor-actions {
  display: grid;
  grid-template-columns: 34px minmax(58px, 1fr) 34px;
  gap: 7px;
  align-items: center;
}

.mold-editor-actions {
  grid-template-columns: 1fr 1fr;
}

.mold-list-editor input {
  width: 100%;
  height: 34px;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.mold-editor-hint {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.mold-list-row > .row-button {
  justify-self: end;
  grid-column: 3;
  grid-row: 1 / span 2;
}

.price-display strong {
  font-size: 20px;
}

.price-display strong.is-empty {
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 650;
}

.price-input-row {
  display: grid;
  gap: 6px;
}

.price-input-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.price-list-editor input {
  text-align: left;
  padding-inline: 10px;
}

.price-editor-actions {
  grid-template-columns: 1fr 1fr 1fr;
}

/* ========== Logs ========== */

.log-entry {
  display: grid;
  grid-template-columns: minmax(190px, 0.55fr) minmax(0, 1.45fr);
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  padding: 14px 16px;
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}

.log-entry:hover {
  border-color: var(--brand-200);
  box-shadow: var(--shadow-sm);
}

.log-entry > div {
  display: grid;
  gap: 5px;
}

.log-entry p {
  line-height: 1.6;
  color: var(--text);
}

.log-entry strong {
  color: var(--text-strong);
}

/* ========== Toast ========== */

#toast {
  position: fixed;
  left: 50%;
  top: 24px;
  z-index: 40;
  transform: translate(-50%, -160%);
  min-width: 240px;
  max-width: min(520px, calc(100vw - 32px));
  border-radius: var(--radius);
  color: #fff;
  background: var(--success);
  box-shadow: var(--shadow-pop);
  opacity: 0;
  padding: 12px 18px;
  text-align: center;
  font-weight: 600;
  transition: transform var(--t-slow) var(--ease), opacity var(--t-slow) var(--ease);
}

#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

#toast.error {
  background: var(--danger);
}

#toast.ok {
  background: var(--success);
}

/* ========== Mold request checklist ========== */

.mold-request-shell {
  max-width: 1160px;
}

.mold-request-page {
  display: grid;
  gap: 12px;
}

.mold-request-header {
  position: static;
}

.nav-user {
  color: var(--muted-strong);
  font-size: 12.5px;
  font-weight: 600;
}

.mold-process-steps {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.mold-process-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.mold-process-row > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mold-process-row button {
  min-height: 34px;
  padding: 0 16px;
}

.mold-process-row p {
  margin: 0;
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
}

.mold-request-list {
  display: grid;
  gap: 10px;
}

.mold-request-empty {
  min-height: 72px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted-strong);
  padding: 18px;
}

.mold-request-empty strong {
  font-size: 18px;
  font-weight: 650;
}

.mold-request-card {
  display: grid;
  grid-template-columns: auto 86px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
  break-inside: avoid;
}

.mold-request-card.is-waiting {
  background: linear-gradient(180deg, #fff, var(--surface-subtle));
}

.mold-request-check,
.mold-footer-check,
.mold-request-bottom-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted-strong);
  font-size: 12.5px;
  font-weight: 650;
  white-space: nowrap;
}

.mold-request-check input,
.mold-footer-check input,
.mold-request-bottom-check input {
  width: 16px;
  height: 16px;
  min-height: 16px;
}

.mold-request-image-wrap {
  width: 86px;
  height: 86px;
}

.mold-request-image {
  width: 86px;
  height: 86px;
  border-radius: 10px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line-soft);
}

.mold-request-image-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
  background: var(--surface-subtle);
}

.mold-request-main {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.mold-request-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.mold-request-title strong {
  color: var(--text-strong);
  font-size: 16px;
  font-weight: 700;
}

.mold-request-title span,
.mold-request-number {
  color: var(--muted);
  font-size: 12.5px;
}

.mold-request-desc {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

.mold-request-values {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.mold-request-values span {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-subtle);
  padding: 7px 10px;
}

.mold-request-values em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.mold-request-values b {
  color: var(--text-strong);
  font-size: 20px;
  line-height: 1;
  font-feature-settings: "tnum";
}

.mold-request-values .target {
  border-color: rgba(204, 120, 92, 0.28);
  background: var(--coral-50);
}

.mold-request-values .target b {
  color: var(--coral-700);
}

.mold-request-values.mold-request-values-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mold-request-total,
.mold-request-footer {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  padding: 12px 14px;
}

.mold-request-total {
  color: var(--text-strong);
  font-size: 15px;
  font-weight: 700;
}

.mold-request-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-color: rgba(204, 120, 92, 0.28);
  background: var(--coral-50);
}

.mold-request-footer p {
  margin: 0;
  color: var(--coral-800);
  font-size: 15px;
  font-weight: 700;
}

/* ========== Print ========== */

@media print {
  @page {
    size: A4;
    margin: 10mm;
  }

  body {
    background: #fff;
  }

  .page-header,
  .table-panel,
  .product-card,
  .shipping-item,
  .history-shipment-card,
  .image-stage {
    box-shadow: none;
    border-color: var(--line);
  }

  .summary-actions,
  .app-nav,
  .shipping-status,
  .image-side-panel,
  .delete-confirm-panel,
  #image-page .my-push-status-panel,
  .procurement-modal,
  .procurement-backdrop,
  .page-jump-nav,
  .role-switcher,
  #role-switch-buttons {
    display: none !important;
  }

  #image-page .image-workspace {
    display: grid !important;
    grid-template-columns: 1fr;
    place-items: center;
    gap: 5mm;
  }

  #image-page .page-header {
    display: none;
  }

  #image-page.shell {
    padding: 0;
  }

  #image-page .image-stage {
    width: 100%;
    max-width: 190mm;
    aspect-ratio: auto;
    border: 0;
    border-radius: 0;
    background: #fff;
    box-shadow: none;
    padding: 0;
  }

  #image-page .image-stage img {
    width: auto;
    height: auto;
    max-width: 190mm;
    max-height: 210mm;
    object-fit: contain;
  }

  #image-page .image-print-caption {
    display: grid !important;
    gap: 2mm;
    width: 100%;
    text-align: center;
    color: #000;
  }

  #image-page .image-print-caption time {
    font-size: 10pt;
    line-height: 1.25;
    font-weight: 400;
  }

  #image-page .image-print-caption strong {
    font-size: 24pt;
    line-height: 1.18;
    font-weight: 800;
  }

  table {
    min-width: 0;
    table-layout: auto;
  }

  .shipping-item,
  .detail-field,
  .shipping-field {
    break-inside: avoid;
  }

  .no-print,
  #toast {
    display: none !important;
  }

  #mold-requests-page .shell {
    width: auto;
    max-width: none;
    padding: 0;
  }

  #mold-requests-page .mold-request-header {
    display: block;
    margin: 0 0 8px;
    padding: 0 0 8px;
    border: 0;
    background: #fff;
    box-shadow: none;
  }

  #mold-requests-page .mold-request-header h1 {
    color: #000;
    font-size: 20px;
  }

  #mold-requests-page .mold-request-card {
    grid-template-columns: 60px minmax(0, 1fr) 62px;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid #333;
    border-radius: 0;
    box-shadow: none;
  }

  #mold-requests-page .mold-request-image-wrap,
  #mold-requests-page .mold-request-image {
    width: 58px;
    height: 58px;
    border-color: #999;
  }

  #mold-requests-page .mold-request-image-wrap {
    grid-column: 1;
  }

  #mold-requests-page .mold-request-main {
    grid-column: 2;
    gap: 5px;
  }

  #mold-requests-page .mold-request-check {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    align-self: center;
  }

  #mold-requests-page .mold-request-check { color: #000; font-size: 11px; }

  #mold-requests-page .mold-request-title strong {
    color: #000;
    font-size: 14px;
  }

  #mold-requests-page .mold-request-number,
  #mold-requests-page .mold-request-desc {
    color: #000;
    font-size: 12px;
  }

  #mold-requests-page .mold-request-values {
    gap: 5px;
  }

  #mold-requests-page .mold-request-values span {
    padding: 5px 7px;
    border: 1px solid #777;
    background: #fff;
  }

  #mold-requests-page .mold-request-values em {
    color: #333;
    font-size: 10.5px;
  }

  #mold-requests-page .mold-request-values b {
    color: #000;
    font-size: 16px;
  }

  #mold-requests-page .mold-request-total,
  #mold-requests-page .mold-request-footer {
    border: 1px solid #333;
    border-radius: 0;
    background: #fff;
    box-shadow: none;
  }

  #mold-requests-page .mold-request-footer {
    display: grid;
    gap: 6px;
  }

  #mold-requests-page .mold-request-footer p {
    color: #000;
    font-size: 13px;
  }
}

/* ========== Responsive ========== */

@media (max-width: 1200px) {
  .summary,
  body[data-role="ADMIN"] .summary,
  body[data-role="CLERK"] .summary {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .filter-segment {
    justify-self: start;
  }

  .add-form-row {
    grid-template-columns: 92px minmax(220px, 1fr);
  }

  .add-spec-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .summary-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .ep-row {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    row-gap: 14px;
  }

  .ep-stat.divide-before::before,
  .ep-stat.divide-after::after {
    display: none;
  }

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

@media (max-width: 900px) {
  .shell {
    padding: 16px 56px 32px;
  }

  .product-grid,
  .mold-list,
  .delete-product-list {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .gift-edit-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .shell {
    padding: 12px 52px 24px;
  }

  .page-header {
    position: static;
    padding: 14px;
  }

  .search-control {
    grid-template-columns: minmax(0, 1fr) 36px 36px;
  }

  .search-action {
    width: 36px;
  }

  .add-form-row,
  .add-image-field,
  .add-spec-grid {
    grid-template-columns: 1fr;
  }

  .add-image-sources,
  .add-image-link-panel,
  .add-image-link-display {
    grid-column: 1 / -1;
  }

  .add-spec-field.divide-after {
    padding-right: 0;
    margin-right: 0;
  }

  .add-spec-field.divide-after::after {
    display: none;
  }

  .filter-segment {
    display: grid;
    grid-template-columns: 1fr;
    border-radius: var(--radius);
  }

  .panel-title-row,
  .history-shipment-head {
    align-items: stretch;
    flex-direction: column;
  }

  .product-card-fields,
  .pending-shipment,
  .shipping-item,
  .console-draft-card,
  .mold-list-toolbar,
  .push-status-list,
  .gift-card-list,
  .gift-card,
  .gift-edit-grid,
  .log-entry,
  .image-workspace,
  .pdf-workspace,
  .delete-card,
  .parameter-row {
    grid-template-columns: 1fr;
  }

  .mold-list-row {
    grid-template-columns: 62px minmax(0, 1fr) auto;
  }

  .mold-list-editor {
    left: 8px;
    right: 8px;
    width: auto;
  }

  .product-card-header {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .product-card-stats,
  .product-card-stats--clerk {
    grid-template-columns: 1fr;
  }

  .product-card-stat + .product-card-stat,
  .product-card-stats > .product-card-actions {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .product-card-stats > .product-card-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .product-card-stat .quantity-editor {
    left: 8px;
    right: auto;
    max-width: calc(100vw - 80px);
  }

  .product-card-stat.molds .quantity-editor {
    left: 8px;
    right: auto;
  }

  .product-card-stat.molds .quantity-editor::after {
    left: 28px;
    right: auto;
  }

  .operation-item {
    grid-template-columns: 72px minmax(0, 1fr) auto;
    align-items: start;
  }

  .operation-item img {
    width: 72px;
    height: 72px;
  }

  .operation-item-main {
    grid-column: 2;
  }

  .operation-actual-input,
  .operation-mold-input {
    grid-column: 1 / -1;
  }

  .operation-check {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    align-self: center;
  }

  .product-card-image .product-image,
  .product-card-image .no-image {
    width: 88px;
    height: 88px;
  }

  .detail-block {
    grid-column: auto;
  }

  .ep-panel-header {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .ep-panel-header .detail-actions {
    width: 100%;
    justify-content: flex-start;
    margin-left: 0;
  }

  .ep-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 14px;
  }

  .ep-stat {
    padding: 0 10px;
  }

  .product-grid > .product-detail.detail-side-right::before {
    left: 42px;
  }

  .delete-card img {
    width: 96px;
    height: 96px;
  }

  .page-jump-nav {
    right: 8px;
  }

  .summary-actions {
    width: 100%;
  }

  .summary-actions > .primary-button,
  .summary-actions > .secondary-button,
  .summary-actions > .action-link {
    flex: 1 1 calc(50% - 4px);
  }
}

/* 入场动画已移除：每次卡片局部重渲染都会触发动画，造成闪烁 */

/* ========== Action group cluster（index summary 行内将按钮分组） ========== */

.action-cluster {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 4px 10px 4px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.action-cluster > .cluster-label {
  font-size: 11.5px;
  font-weight: 650;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-right: 4px;
  padding-right: 6px;
  border-right: 1px solid var(--line);
}

.action-cluster > .secondary-button,
.action-cluster > .primary-button,
.action-cluster > .action-link {
  min-height: 30px;
  padding: 4px 12px;
  font-size: 12.5px;
  border-radius: var(--radius-pill);
  box-shadow: none;
}

/* —— 簇内按钮 hover 不再叠加阴影动效 —— */
.action-cluster > .secondary-button:hover,
.action-cluster > .primary-button:hover {
  transform: none;
  box-shadow: none;
}

.action-cluster > .primary-button {
  background: var(--primary);
  color: #fff;
}
.action-cluster > .primary-button:hover {
  background: var(--primary-strong);
}

/* ========== 共享顶栏 App Nav ========== */

.app-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
}

.app-nav .brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-serif);
  font-weight: 500;
  color: var(--text-strong);
  font-size: 16px;
  letter-spacing: -0.01em;
  padding-right: 14px;
  border-right: 1px solid var(--line);
  margin-right: 6px;
}

.app-nav .brand::before {
  content: "";
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background:
    radial-gradient(circle at 35% 30%, #f3cdb9 0%, var(--coral-500) 55%, var(--coral-700) 100%);
  display: inline-block;
  position: relative;
  box-shadow: 0 1px 2px rgba(143, 75, 50, 0.18);
}

.app-nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--muted-strong);
  font-weight: 500;
  font-size: 13.5px;
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
}

.app-nav a:hover {
  background: var(--cream-100);
  color: var(--text-strong);
}

.app-nav a.current {
  background: var(--coral-50);
  color: var(--coral-700);
  font-weight: 600;
}

.app-nav .nav-spacer { flex: 1; }

/* ========== 小细节：sticky 头脱离顶部时阴影更明显 ========== */
@supports (animation-timeline: scroll()) {
  /* progressive enhancement, no-op fallback */
}

/* —— hover 与渲染时让产品卡片中的子元素稳定 —— */
.product-card,
.gift-card,
.delete-card,
.log-entry,
.history-shipment-card,
.console-draft-card,
.pending-shipment {
  will-change: transform;
}

/* ========== focus-visible（无障碍） ========== */

:focus-visible {
  outline: 2px solid var(--brand-400);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--brand-400);
  outline-offset: 2px;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
}
