:root {
  --blue: #3f70ea;
  --blue-hover: #2f5fd7;
  --blue-soft: #edf3ff;
  --canvas: #f4f7fb;
  --panel: #ffffff;
  --ink: #17213a;
  --muted: #778296;
  --line: #e4e9f1;
  --danger: #df4f5c;
  --shadow: 0 16px 42px rgba(38, 61, 104, .055);
  --panel-radius: 30px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 8% 0%, rgba(63, 112, 234, .035), transparent 25%),
    var(--canvas);
  color: var(--ink);
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body.modal-open { overflow: hidden; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 16px; top: -60px; z-index: 3000; padding: 10px 16px; border-radius: 12px; background: var(--ink); color: #fff; text-decoration: none; transition: top .2s ease; }
.skip-link:focus { top: 16px; }

/* 后台导航仅在 /?manage=1 显示，普通展示页保持纯净。 */
.site-header { display: none; }
.manage-mode .site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px max(28px, calc((100vw - 1760px) / 2));
  border-bottom: 1px solid rgba(220, 227, 238, .9);
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 8px 30px rgba(30, 54, 94, .05);
  backdrop-filter: blur(18px);
}
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  grid-template-columns: repeat(3, 4px);
  align-items: end;
  justify-content: center;
  gap: 4px;
  padding-bottom: 10px;
  border-radius: 12px;
  background: var(--blue);
  box-shadow: 0 8px 18px rgba(63,112,234,.22);
}
.brand-mark span { width: 4px; border-radius: 4px; background: #fff; }
.brand-mark span:nth-child(1) { height: 10px; }
.brand-mark span:nth-child(2) { height: 17px; }
.brand-mark span:nth-child(3) { height: 13px; }
.brand-copy { display: flex; flex-direction: column; gap: 1px; }
.brand-copy strong { font-size: 16px; letter-spacing: -.02em; }
.brand-copy small { color: #8b95a7; font-size: 8px; letter-spacing: .16em; }
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.front-view-link { margin-right: 3px; color: #657187; font-size: 13px; text-decoration: none; }
.front-view-link:hover { color: var(--blue); }
.admin-state { display: inline-flex; align-items: center; gap: 7px; color: #4e5d75; font-size: 12px; }
.admin-state > span { width: 7px; height: 7px; border-radius: 50%; background: #35b574; box-shadow: 0 0 0 5px rgba(53,181,116,.1); }

.primary-button,
.ghost-button,
.icon-text-button,
.white-button,
.cta-link,
.danger-text-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 13px;
  padding: 0 16px;
  cursor: pointer;
  text-decoration: none;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, color .18s ease, box-shadow .18s ease;
}
.primary-button { background: var(--blue); color: #fff; box-shadow: 0 8px 20px rgba(63,112,234,.18); }
.primary-button:hover { background: var(--blue-hover); transform: translateY(-1px); box-shadow: 0 10px 22px rgba(63,112,234,.24); }
.primary-button.compact { min-height: 40px; padding-inline: 14px; font-size: 13px; }
.primary-button.wide { width: 100%; }
.ghost-button { border: 1px solid var(--line); background: #fff; color: #526078; }
.ghost-button:hover { border-color: #cbd8f8; background: #f8faff; color: var(--blue); }
.icon-text-button { min-height: 40px; background: transparent; color: #58657a; padding-inline: 12px; }
.icon-text-button:hover { background: var(--blue-soft); color: var(--blue); }
.white-button { min-height: 44px; background: #fff; color: var(--blue); font-weight: 700; box-shadow: 0 8px 22px rgba(23,45,90,.12); }
.danger-text-button { background: transparent; color: var(--danger); padding-inline: 0; }
.primary-button:disabled,
.ghost-button:disabled { cursor: wait; opacity: .6; transform: none; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid rgba(63,112,234,.22); outline-offset: 2px; }

main {
  width: 100%;
  padding: 28px 36px 58px;
}

/* 展示页不显示宣传 Hero；后台中保留一个紧凑的站点信息预览。 */
.hero { display: none; }
.manage-mode .hero {
  position: relative;
  display: flex;
  max-width: 1760px;
  min-height: 180px;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  margin: 0 auto 24px;
  padding: 32px 38px;
  overflow: hidden;
  border-radius: 26px;
  background:
    radial-gradient(circle at 88% 0%, rgba(255,255,255,.22), transparent 35%),
    linear-gradient(125deg, #204fae, #4a7df0);
  color: #fff;
  box-shadow: 0 18px 44px rgba(37,80,170,.15);
}
.hero-inner { max-width: 760px; }
.eyebrow { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; font-size: 11px; font-weight: 700; letter-spacing: .16em; opacity: .8; }
.eyebrow > span { width: 20px; height: 2px; border-radius: 2px; background: currentColor; }
.hero h1 { margin: 0; font-size: clamp(28px, 3vw, 42px); letter-spacing: -.045em; }
.hero-inner > p { max-width: 680px; margin: 12px 0 0; color: rgba(255,255,255,.76); font-size: 14px; line-height: 1.8; }
.hero-actions { display: flex; align-items: center; gap: 22px; flex-shrink: 0; }
.hero-count { display: inline-flex; align-items: center; gap: 8px; }
.hero-count strong { font-size: 28px; }
.hero-count span { color: rgba(255,255,255,.72); font-size: 12px; }

.announcement { display: none !important; }

.personal-zone,
.catalog {
  position: relative;
  width: 100%;
  max-width: 1760px;
  margin-inline: auto;
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}
.catalog { margin-top: 54px; }
.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 32px;
}
.heading-copy { min-width: 0; }
.section-index { display: none; }
.section-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(25px, 2vw, 30px);
  font-weight: 600;
  letter-spacing: -.045em;
}
.heading-copy > p { display: none; }
.section-heading-actions { display: flex; min-height: 44px; align-items: center; justify-content: flex-end; gap: 12px; }
.privacy-chip,
.sort-hint {
  display: none;
  align-items: center;
  gap: 7px;
  color: var(--blue);
  font-size: 13px;
  white-space: nowrap;
}
.privacy-chip svg,
.sort-hint svg { width: 18px; height: 18px; }
.manage-mode .privacy-chip,
.manage-mode .sort-hint:not([hidden]) { display: inline-flex; }
.manage-mode .personal-zone.is-editing { border-color: #cfdbfa; box-shadow: 0 16px 42px rgba(63,112,234,.09); }

.catalog-heading { align-items: center; }
.catalog-tools { margin: -3px 0 24px; }
.category-tabs {
  display: flex;
  gap: 11px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 3px 1px;
}
.category-tabs::-webkit-scrollbar { display: none; }
.category-tab {
  min-height: 52px;
  flex: 0 0 auto;
  border: 1px solid #e0e6ef;
  border-radius: 999px;
  background: #fff;
  color: #536078;
  padding: 0 22px;
  cursor: pointer;
  font-size: 14px;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}
.category-tab:hover { border-color: #c9d6f6; color: var(--blue); transform: translateY(-1px); }
.category-tab.active { border-color: var(--blue); background: var(--blue); color: #fff; box-shadow: 0 8px 18px rgba(63,112,234,.16); }
.search-box {
  display: flex;
  width: min(420px, 36vw);
  min-height: 64px;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
  border: 1px solid #e1e7ef;
  border-radius: 18px;
  background: #fff;
  padding: 0 17px;
  color: #8995a6;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.search-box:focus-within { border-color: #adc1f4; box-shadow: 0 0 0 4px rgba(63,112,234,.08); }
.search-box > svg { width: 23px; height: 23px; flex: 0 0 auto; }
.search-box input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 16px; }
.search-box input::placeholder { color: #b3bbc8; }
.search-box kbd { border: 0; background: transparent; color: #b1bac8; font-family: inherit; font-size: 11px; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 28px;
}
.personal-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.product-card {
  position: relative;
  min-width: 0;
  background: transparent;
  animation: card-in .48s cubic-bezier(.2,.75,.28,1) both;
}
@keyframes card-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.product-image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  background: #fff;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.product-card.is-clickable:hover .product-image-wrap { transform: translateY(-3px); border-color: #b9caf4; box-shadow: 0 14px 28px rgba(34,64,120,.09); }
.product-image { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .35s ease; }
.product-card.is-clickable:hover .product-image { transform: scale(1.025); }
.product-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(255,255,255,.9), rgba(255,255,255,.14)),
    linear-gradient(135deg, var(--tile-start), var(--tile-end));
}
.product-placeholder::before,
.product-placeholder::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(63,112,234,.12);
  border-radius: 50%;
}
.product-placeholder::before { width: 76%; aspect-ratio: 1; left: -32%; bottom: -43%; }
.product-placeholder::after { width: 54%; aspect-ratio: 1; right: -23%; top: -24%; }
.product-placeholder > span {
  position: relative;
  z-index: 1;
  display: grid;
  width: 68px;
  height: 68px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 20px;
  background: rgba(255,255,255,.88);
  color: var(--blue);
  box-shadow: 0 14px 28px rgba(63,112,234,.1);
  backdrop-filter: blur(12px);
}
.product-placeholder svg { width: 29px; height: 29px; }
.product-body { min-height: 54px; padding: 15px 4px 0; text-align: center; }
.product-body h3 { margin: 0; color: #18223a; font-size: clamp(16px, 1.3vw, 22px); font-weight: 700; line-height: 1.35; letter-spacing: -.025em; }
.card-hit-area { position: absolute; inset: 0; z-index: 2; border-radius: 20px; }
.add-to-personal-button {
  position: absolute;
  top: 11px;
  left: 11px;
  z-index: 6;
  display: inline-flex;
  min-height: 36px;
  max-width: calc(100% - 22px);
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(208,220,250,.96);
  border-radius: 11px;
  background: rgba(255,255,255,.95);
  color: var(--blue);
  box-shadow: 0 8px 18px rgba(24,42,77,.1);
  padding: 0 11px;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease;
}
.add-to-personal-button:hover {
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 10px 22px rgba(63,112,234,.18);
  transform: translateY(-1px);
}
.add-to-personal-button:disabled,
.add-to-personal-button:disabled:hover {
  border-color: rgba(215,224,240,.94);
  background: rgba(247,249,252,.95);
  color: #7e899b;
  box-shadow: 0 6px 14px rgba(24,42,77,.07);
  transform: none;
  cursor: default;
}
.add-to-personal-button:focus-visible { outline: 3px solid rgba(63,112,234,.25); outline-offset: 2px; }
.add-to-personal-button svg { width: 15px; height: 15px; flex: 0 0 auto; }
.add-to-personal-button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-card-actions {
  position: absolute;
  top: 11px;
  right: 11px;
  z-index: 5;
  display: flex;
  gap: 6px;
}
.admin-card-actions button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(222,229,239,.9);
  border-radius: 11px;
  background: rgba(255,255,255,.94);
  color: #53627a;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(24,42,77,.1);
  backdrop-filter: blur(10px);
}
.admin-card-actions button:hover { border-color: #c5d4f7; color: var(--blue); }
.admin-card-actions button.delete:hover { border-color: #f0c6cc; color: var(--danger); }
.admin-card-actions svg { width: 17px; height: 17px; }
.admin-card-actions .drag-handle { color: var(--blue); cursor: grab; touch-action: none; }
.admin-card-actions .drag-handle:active { cursor: grabbing; }
@media (hover:hover) and (pointer:fine) {
  .admin-card-actions { opacity: .28; transition: opacity .18s ease; }
  .product-card:hover .admin-card-actions,
  .admin-card-actions:focus-within { opacity: 1; }
}
.product-card.is-dragging { opacity: .24; }
.drag-ghost {
  position: fixed !important;
  z-index: 2500 !important;
  pointer-events: none !important;
  opacity: .88;
  transform: rotate(1.5deg) scale(.98);
  filter: drop-shadow(0 22px 26px rgba(24,44,82,.2));
}
body.is-sorting { user-select: none; cursor: grabbing; }

.personal-empty,
.empty-state {
  display: flex;
  min-height: 150px;
  align-items: center;
  justify-content: center;
  gap: 16px;
  border: 1px dashed #dce3ed;
  border-radius: 20px;
  background: #fafbfd;
  padding: 28px;
  text-align: left;
}
.personal-empty > span,
.empty-state > span { display: grid; width: 48px; height: 48px; flex: 0 0 auto; place-items: center; border-radius: 15px; background: var(--blue-soft); color: var(--blue); }
.personal-empty h3,
.empty-state h3 { margin: 0; font-size: 17px; }
.personal-empty p,
.empty-state p { margin: 5px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.personal-empty button { display: none; margin-left: 8px; }
.manage-mode .personal-empty button { display: inline-flex; }
.empty-state { flex-direction: column; text-align: center; }
.loading-state { display: flex; min-height: 170px; align-items: center; justify-content: center; gap: 12px; color: var(--muted); }
.loading-state > span { width: 21px; height: 21px; border: 2px solid #dbe3f1; border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.shared-sort-guide {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -7px 0 22px;
  border-radius: 13px;
  background: var(--blue-soft);
  color: #47649d;
  padding: 10px 13px;
  font-size: 12px;
}
.shared-sort-guide svg { width: 17px; height: 17px; flex: 0 0 auto; }

.cta-band { display: none; }
.site-footer {
  display: flex;
  max-width: 1760px;
  align-items: center;
  gap: 18px;
  margin: -26px auto 0;
  padding: 0 36px 34px;
  color: #929cad;
  font-size: 12px;
}
.site-footer .footer-brand,
.site-footer > p { display: none; }
.backend-link { margin-left: auto; color: #a0a9b7; text-decoration: none; }
.backend-link:hover { color: var(--blue); }

/* 后台弹窗与表单 */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  overflow-y: auto;
  padding: 24px;
  background: rgba(19,29,49,.48);
  backdrop-filter: blur(12px);
}
.modal {
  width: min(520px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 25px;
  background: #fff;
  box-shadow: 0 28px 90px rgba(15,31,61,.25);
  animation: modal-in .24s ease both;
}
.modal.modal-wide { width: min(920px, 100%); }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 24px 26px 18px; border-bottom: 1px solid #edf0f5; }
.modal-header span { color: var(--blue); font-size: 10px; font-weight: 700; letter-spacing: .15em; }
.modal-header h2 { margin: 5px 0 0; font-size: 24px; letter-spacing: -.04em; }
.close-button { display: grid; width: 39px; height: 39px; place-items: center; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: #69768a; cursor: pointer; }
.close-button:hover { background: #f6f8fb; color: var(--ink); }
.modal-form { padding: 24px 26px 27px; }
.login-form { text-align: center; }
.login-symbol { display: grid; width: 64px; height: 64px; place-items: center; margin: 0 auto 17px; border-radius: 20px; background: var(--blue-soft); color: var(--blue); }
.login-symbol svg { width: 27px; height: 27px; }
.form-intro { margin: 0 0 22px; color: var(--muted); font-size: 13px; line-height: 1.75; }
.form-intro.align-left { text-align: left; }
.product-form { display: grid; grid-template-columns: 270px minmax(0,1fr); gap: 0 24px; }
.image-field { grid-row: 1 / span 3; grid-column: 1; }
.form-scope-note,
.product-form .form-grid { grid-column: 2; }
.product-form > .form-message,
.product-form > .form-footer { grid-column: 1 / -1; }
.field-label { display: block; margin-bottom: 9px; color: #4b5870; font-size: 13px; font-weight: 700; }
.image-drop {
  position: relative;
  display: grid;
  width: 100%;
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  border: 1px dashed #cbd5e4;
  border-radius: 19px;
  background: #f9fbfe;
  color: #6e7b91;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}
.image-drop:hover,
.image-drop.drag-over { border-color: var(--blue); background: #f5f8ff; }
.image-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; padding: 20px; text-align: center; }
.image-placeholder > span { display: grid; width: 49px; height: 49px; place-items: center; border-radius: 15px; background: var(--blue-soft); color: var(--blue); }
.image-placeholder strong { color: #344158; font-size: 14px; }
.image-placeholder small { color: #929cad; font-size: 11px; line-height: 1.65; }
.image-drop > img { width: 100%; height: 100%; object-fit: cover; }
.image-remove { position: absolute; right: 10px; bottom: 10px; z-index: 2; border: 0; border-radius: 10px; background: rgba(23,33,58,.82); color: #fff; padding: 8px 11px; cursor: pointer; font-size: 11px; }
.form-scope-note { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 16px; border-radius: 13px; background: #f4f7fd; color: #566985; padding: 11px 13px; font-size: 12px; line-height: 1.55; }
.form-scope-note svg { width: 17px; height: 17px; flex: 0 0 auto; color: var(--blue); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 15px; }
.field { position: relative; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.field-span { grid-column: span 2; }
.field > span { color: #46546b; font-size: 12px; font-weight: 700; }
.field i { color: var(--danger); font-style: normal; }
.optional-mark { margin-left: 5px; color: #97a2b3; font-size: 10px; font-weight: 500; }
.field input,
.field textarea {
  width: 100%;
  border: 1px solid #dfe5ee;
  border-radius: 13px;
  outline: 0;
  background: #fff;
  color: var(--ink);
  padding: 12px 13px;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.field input { min-height: 46px; }
.field textarea { resize: vertical; line-height: 1.6; }
.field input:focus,
.field textarea:focus { border-color: #a9bff3; box-shadow: 0 0 0 4px rgba(63,112,234,.075); }
.input-with-icon { position: relative; }
.input-with-icon > svg { position: absolute; left: 13px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: #9aa4b4; pointer-events: none; }
.input-with-icon input { padding-left: 40px; }
.char-count { position: absolute; right: 10px; bottom: 8px; color: #a1aab9; font-size: 10px; }
.check-field { display: flex; align-items: center; gap: 11px; border: 1px solid #e3e8f0; border-radius: 14px; padding: 12px; cursor: pointer; }
.check-field > input { position: absolute; opacity: 0; }
.check-field > span { display: block; width: 20px; height: 20px; flex: 0 0 auto; border: 1px solid #cad3e0; border-radius: 7px; }
.check-field > input:checked + span { border-color: var(--blue); background: var(--blue); box-shadow: inset 0 0 0 4px #fff; }
.check-field div { display: flex; flex-direction: column; gap: 2px; }
.check-field strong { font-size: 12px; }
.check-field small { color: var(--muted); font-size: 10px; }
.form-message { margin: 16px 0 0; border-radius: 12px; background: #edf8f3; color: #247351; padding: 10px 12px; font-size: 12px; text-align: left; }
.form-message.error { background: #fff0f2; color: #b73e4b; }
.form-footer { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 22px; padding-top: 18px; border-top: 1px solid #edf0f5; }
.form-footer.split { justify-content: space-between; }
.form-footer.split > div { display: flex; gap: 10px; }
.settings-form .field + .field { margin-top: 16px; }

.toast-region { position: fixed; right: 22px; bottom: 22px; z-index: 2000; display: flex; width: min(380px, calc(100vw - 32px)); flex-direction: column; gap: 9px; pointer-events: none; }
.toast { border: 1px solid #dbe4f7; border-radius: 14px; background: #fff; color: #30415c; box-shadow: 0 16px 34px rgba(22,42,80,.14); padding: 13px 15px; font-size: 13px; animation: toast-in .24s ease both; }
.toast.error { border-color: #f0ced2; color: #a43b46; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (max-width: 1180px) {
  main { padding-inline: 24px; }
  .personal-zone, .catalog { padding: 30px; }
  .product-grid, .personal-grid { gap: 20px; }
  .search-box { width: min(360px, 38vw); }
  .product-body h3 { font-size: 17px; }
}

@media (max-width: 920px) {
  .product-grid, .personal-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .catalog-heading { align-items: flex-start; }
  .search-box { width: 320px; min-height: 56px; }
  .manage-mode .site-header { align-items: flex-start; padding-inline: 20px; }
  .header-actions { flex-wrap: wrap; }
  .manage-mode .hero { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 700px) {
  main { padding: 14px 14px 42px; }
  .manage-mode main { padding-top: 18px; }
  .personal-zone,
  .catalog { padding: 21px; border-radius: 23px; }
  .catalog { margin-top: 24px; }
  .section-heading { align-items: stretch; flex-direction: column; gap: 16px; margin-bottom: 22px; }
  .section-heading h2 { font-size: 24px; }
  .section-heading-actions { min-height: 0; justify-content: flex-start; flex-wrap: wrap; }
  .privacy-chip { display: none !important; }
  .catalog-heading .search-box { width: 100%; min-height: 52px; }
  .search-box input { font-size: 14px; }
  .search-box kbd { display: none; }
  .catalog-tools { margin: -2px -1px 18px; }
  .category-tab { min-height: 44px; padding: 0 17px; font-size: 13px; }
  .product-grid, .personal-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
  .product-image-wrap { border-radius: 15px; }
  .product-body { min-height: 44px; padding: 11px 2px 0; }
  .product-body h3 { font-size: 15px; }
  .product-placeholder > span { width: 52px; height: 52px; border-radius: 16px; }
  .product-placeholder svg { width: 23px; height: 23px; }
  .admin-card-actions { top: 7px; right: 7px; gap: 4px; }
  .admin-card-actions button { width: 32px; height: 32px; border-radius: 10px; }
  .add-to-personal-button { top: 7px; left: 7px; min-height: 32px; max-width: calc(100% - 14px); border-radius: 10px; padding: 0 9px; font-size: 11px; }
  .add-to-personal-button svg { width: 14px; height: 14px; }
  .manage-mode .add-to-personal-button { width: 32px; padding: 0; justify-content: center; }
  .manage-mode .add-to-personal-button span { display: none; }
  .personal-empty, .empty-state { min-height: 130px; flex-direction: column; padding: 22px; text-align: center; }
  .personal-empty button { margin: 2px 0 0; }
  .site-footer { margin-top: -18px; padding: 0 20px 25px; }
  .manage-mode .site-header { position: relative; flex-direction: column; gap: 10px; }
  .header-actions { width: 100%; justify-content: flex-start; }
  .header-actions .primary-button span,
  .header-actions .ghost-button span { display: none; }
  .manage-mode .hero { min-height: 0; padding: 25px; border-radius: 22px; }
  .hero-actions { width: 100%; flex-wrap: wrap; gap: 14px; }
  .modal-backdrop { align-items: end; padding: 0; }
  .modal, .modal.modal-wide { width: 100%; max-height: 92vh; border-radius: 24px 24px 0 0; }
  .product-form { display: block; }
  .image-field { margin-bottom: 18px; }
  .image-drop { max-height: 280px; aspect-ratio: 16 / 10; }
  .form-scope-note { margin-top: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .field-span { grid-column: auto; }
  .form-footer.split { align-items: stretch; flex-direction: column-reverse; }
  .form-footer.split > div { width: 100%; }
  .form-footer.split > div > button { flex: 1; }
}

@media (max-width: 350px) {
  main { padding-inline: 10px; }
  .personal-zone, .catalog { padding: 17px; }
  .product-grid, .personal-grid { gap: 9px; }
  .product-body h3 { font-size: 14px; }
}

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