
:root {
  --bg: #FAF7F2;
  --bg-warm: #EEF4F9;
  --paper: #FFFFFF;
  --ink: #1F2937;
  --ink-soft: #5A6B7C;
  --ink-muted: #9AAAB8;
  --line: #D8E5EE;
  --line-soft: #E8F0F6;
  --accent: #7CB9E8;
  --accent-soft: #E4F1FB;
  --accent-deep: #4A90C2;
  --blue: #7CB9E8;
  --blue-soft: #E4F1FB;
  --yellow: #F4D785;
  --shadow: 0 1px 2px rgba(31, 41, 55, 0.04), 0 4px 16px rgba(31, 41, 55, 0.06);
  --shadow-hover: 0 4px 8px rgba(31, 41, 55, 0.08), 0 12px 32px rgba(74, 144, 194, 0.15);
  --header-h: 56px;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
html.modal-open,
body.modal-open {
  overflow: hidden;
  overscroll-behavior: contain;
}
body {
  font-family: 'Quicksand', 'Helvetica Neue', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Yu Gothic', 'Meiryo', 'Noto Sans JP', 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* LOGO 样式 */
.brand-logo-large {
  max-width: 240px;
  width: 80%;
  height: auto;
  margin-bottom: 12px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}
.brand-logo-mini {
  height: 36px;
  width: auto;
  display: block;
  cursor: pointer;
}
@media (max-width: 500px) {
  .brand-logo-mini { height: 30px; }
}

#loginScreen {
  position: fixed; inset: 0; z-index: 1000;
  background: linear-gradient(135deg, var(--bg-warm) 0%, var(--accent-soft) 100%);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
#loginScreen.hidden { display: none; }
.login-card {
  background: var(--paper); border-radius: 24px; padding: 40px 32px;
  box-shadow: var(--shadow-hover); max-width: 380px; width: 100%; text-align: center;
}
.login-card .brand {
  font-family: 'Caveat', cursive; font-size: 42px;
  color: var(--accent-deep); margin-bottom: 8px; font-weight: 700;
}
.login-card .tagline { color: var(--ink-soft); font-size: 13px; margin-bottom: 28px; }
.login-card input {
  width: 100%; padding: 14px 18px; border: 2px solid var(--line);
  border-radius: 14px; font-size: 16px; font-family: inherit;
  background: var(--bg); transition: all 0.2s; text-align: center; letter-spacing: 0.1em;
}
.login-card input:focus { outline: none; border-color: var(--accent); background: var(--paper); }
.login-card button {
  width: 100%; padding: 14px; margin-top: 16px; background: var(--ink); color: white;
  border: none; border-radius: 14px; font-size: 15px; font-family: inherit; cursor: pointer;
  font-weight: 600; letter-spacing: 0.05em; transition: all 0.2s;
}
.login-card button:hover { background: var(--accent-deep); transform: translateY(-1px); }
.login-card .err { color: var(--accent-deep); font-size: 13px; margin-top: 12px; min-height: 18px; }

/* 顶部 */
.topbar { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 100; }
.topbar-row1 {
  position: relative;
  height: var(--header-h); padding: 0 16px;
  display: flex; align-items: center; gap: 12px;
  max-width: 900px; margin: 0 auto;
}
.preview-hub-wrap {
  padding: 0 12px 8px;
  background: var(--paper);
}
.preview-hub-link {
  width: min(876px, 100%);
  min-height: 54px;
  margin: 0 auto;
  padding: 9px 14px;
  border: 1px solid #b9d9ee;
  border-radius: 15px;
  background: linear-gradient(135deg, #eef8ff 0%, #f8fcff 54%, #fff7df 100%);
  color: var(--ink);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 11px;
  box-shadow: 0 4px 14px rgba(74, 144, 194, 0.10);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}
.preview-hub-link:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  box-shadow: 0 7px 18px rgba(74, 144, 194, 0.16);
}
.preview-hub-link:focus-visible {
  outline: 3px solid rgba(74, 144, 194, 0.28);
  outline-offset: 2px;
}
.preview-hub-icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--accent-deep);
  color: #fff;
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  font-size: 16px;
  font-weight: 800;
}
.preview-hub-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.preview-hub-title {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.01em;
}
.preview-hub-sub {
  margin-top: 4px;
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.preview-hub-arrow {
  margin-left: auto;
  color: var(--accent-deep);
  font-size: 22px;
  line-height: 1;
  flex: 0 0 auto;
}
@media (max-width: 500px) {
  .preview-hub-wrap { padding: 0 10px 7px; }
  .preview-hub-link { min-height: 50px; padding: 7px 11px; border-radius: 13px; gap: 9px; }
  .preview-hub-icon { width: 32px; height: 32px; flex-basis: 32px; border-radius: 10px; font-size: 15px; }
  .preview-hub-title { font-size: 13px; }
  .preview-hub-sub { font-size: 10px; }
}
.brand-mini {
  font-family: 'Caveat', cursive; font-size: 26px; font-weight: 700;
  color: var(--accent-deep); white-space: nowrap; cursor: pointer;
}
.search-wrap { flex: 1; position: relative; min-width: 0; }
.search-input {
  width: 100%; padding: 9px 14px 9px 36px; border: 1px solid var(--line);
  border-radius: 24px; background: var(--bg); font-size: 14px; font-family: inherit;
  transition: all 0.2s; -webkit-appearance: none;
}
.search-input:focus { outline: none; border-color: var(--accent); background: var(--paper); }
.search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--ink-muted); font-size: 15px; pointer-events: none;
}

/* 搜索热词遮罩 + 弹窗 */
.search-suggest-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(42, 37, 32, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  animation: fade-in 0.18s ease-out;
}
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.search-suggest-overlay.open { display: block; }

.search-suggest {
  position: absolute;
  left: 12px;
  right: 12px;
  /* Anchored to the search row: focus/keyboard scrolling cannot separate them. */
  top: 100%;
  background: var(--paper);
  z-index: 95;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  padding: 18px 16px;
  display: none;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(42, 37, 32, 0.25), 0 4px 16px rgba(42, 37, 32, 0.1);
  animation: slide-down 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
@media (min-width: 720px) {
  .search-suggest {
    left: 50%;
    right: auto;
    width: min(680px, calc(100vw - 32px));
    transform: translateX(-50%);
  }
  @keyframes slide-down {
    from { transform: translate(-50%, -12px); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
  }
}
.search-suggest.open { display: block; }
.search-suggest-inner { max-width: 100%; margin: 0; }
.search-suggest-group { margin-bottom: 18px; }
.search-suggest-group:last-child { margin-bottom: 0; }
.search-suggest-group h4 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink-muted);
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.search-suggest-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.search-suggest-tag {
  padding: 7px 13px;
  border-radius: 16px;
  background: var(--bg);
  border: 1px solid var(--line);
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  color: var(--ink);
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.search-suggest-tag:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-deep);
}
.search-suggest-tag .count {
  font-size: 10px;
  color: var(--ink-muted);
  font-weight: 600;
}
.search-suggest-tag.hot {
  background: linear-gradient(135deg, #F5EFE4 0%, var(--accent-soft) 100%);
  border-color: var(--accent);
}
.search-suggest-tag .fire { font-size: 11px; }
.recent-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
}
.recent-row:hover { background: var(--bg-warm); }
.recent-row-text { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); }
.recent-row-text .icon { color: var(--ink-muted); font-size: 14px; }
.recent-row-clear {
  background: none; border: none; color: var(--ink-muted);
  cursor: pointer; font-size: 12px; padding: 4px 8px;
}
.recent-row-clear:hover { color: var(--accent-deep); }
.empty-hint {
  font-size: 12px;
  color: var(--ink-muted);
  text-align: center;
  padding: 8px;
}

/* 搜索面板打开时,顶部搜索框得有"焦点感",其他模块被遮罩 */
.topbar.search-active {
  z-index: 90;  /* 高于 overlay,让 topbar 露出来 */
  position: sticky;
}
.search-input.focused-style {
  background: var(--paper);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.wishlist-btn {
  position: relative; background: var(--ink); color: white; border: none;
  padding: 9px 14px; border-radius: 24px; font-size: 13px; font-family: inherit;
  cursor: pointer; font-weight: 600; transition: all 0.2s;
  display: flex; align-items: center; gap: 6px; white-space: nowrap; flex-shrink: 0;
}
.wishlist-btn:hover { background: var(--accent-deep); }
.wishlist-btn .heart { font-size: 16px; line-height: 1; }
.wishlist-count {
  background: var(--yellow); color: var(--ink); border-radius: 12px;
  padding: 1px 7px; font-size: 11px; font-weight: 700;
  min-width: 18px; display: inline-block;
}

/* 语言切换按钮 */
.lang-btn {
  position: relative;
  background: transparent;
  border: 1px solid var(--line);
  padding: 7px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  color: var(--ink-soft);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s;
}
.lang-btn:hover { border-color: var(--accent); color: var(--accent-deep); }
.lang-btn .lang-name {
  font-size: 12px;
}
@media (max-width: 500px) {
  .lang-btn .lang-name { display: none; }
}
.lang-btn .arrow { font-size: 9px; opacity: 0.6; }
.lang-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  background: var(--paper);
  border-radius: 12px;
  box-shadow: var(--shadow-hover);
  border: 1px solid var(--line);
  display: none;
  z-index: 110;
  min-width: 140px;
  overflow: hidden;
}
.lang-menu.open { display: block; }
.lang-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink);
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  font-family: inherit;
  font-weight: 500;
}
.lang-option:hover { background: var(--bg-warm); }
.lang-option.active { background: var(--accent-soft); color: var(--accent-deep); font-weight: 700; }
.announce {
  background: var(--accent-deep); color: var(--paper); overflow: hidden;
  padding: 7px 0; font-size: 12px; letter-spacing: 0.08em;
}
.announce-track {
  display: flex; gap: 32px; animation: scroll-left 28s linear infinite;
  white-space: nowrap; width: max-content;
}
@keyframes scroll-left { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.filter-row {
  background: var(--paper); border-bottom: 1px solid var(--line);
  padding: 10px 12px; overflow-x: auto; scrollbar-width: none;
}
.filter-row::-webkit-scrollbar { display: none; }
.filter-row-inner {
  max-width: 900px; margin: 0 auto; display: flex; gap: 8px; flex-wrap: nowrap;
}

/* 大类导航(产品大类 + 系列字母) */
.cat-row {
  background: var(--paper); border-bottom: 1px solid var(--line);
  padding: 10px 12px; overflow-x: auto; scrollbar-width: none;
}
.cat-row::-webkit-scrollbar { display: none; }
.cat-row.series-row-wrap {
  background: var(--bg-warm);
  padding-top: 8px; padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.cat-row-inner {
  max-width: 900px; margin: 0 auto;
  display: flex; gap: 8px; flex-wrap: nowrap;
  align-items: center;
}
.cat-chip {
  padding: 8px 16px; border-radius: 22px;
  background: transparent; border: 1.5px solid var(--line);
  font-size: 13px; font-weight: 700;
  font-family: inherit; cursor: pointer; white-space: nowrap;
  transition: all 0.15s; color: var(--ink-soft);
  display: inline-flex; align-items: center; gap: 6px;
}
.cat-chip:hover { border-color: var(--accent); color: var(--accent-deep); }
.cat-chip.active {
  background: var(--accent-deep); color: white; border-color: var(--accent-deep);
}
.cat-chip .cat-count {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink-muted);
  font-weight: 600;
}
.cat-chip.active .cat-count {
  background: rgba(255,255,255,0.25); color: white;
}
.cat-row.series-row-wrap .cat-chip {
  border: 1px solid transparent;
  padding: 5px 12px;
  font-size: 12px;
  background: var(--paper);
  border-radius: 16px;
}
.cat-row.series-row-wrap .cat-chip:hover { border-color: var(--accent); }
.cat-row.series-row-wrap .cat-chip.active {
  background: var(--accent); color: white;
}
.cat-row.series-row-wrap .series-label {
  font-size: 12px; color: var(--ink-muted); font-weight: 600;
  margin-right: 4px;
}

.filter-chip {
  position: relative; padding: 7px 14px; border-radius: 20px;
  background: var(--bg); border: 1px solid var(--line); font-size: 13px;
  font-family: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: all 0.15s; color: var(--ink-soft);
  display: flex; align-items: center; gap: 4px;
}
.filter-chip:hover { border-color: var(--accent); color: var(--accent-deep); }
.filter-chip.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.filter-chip .arrow { font-size: 9px; opacity: 0.6; margin-left: 2px; }
.filter-chip.has-value { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-deep); padding-right: 6px; }
.filter-chip .chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-deep);
  color: white;
  font-size: 11px;
  font-weight: 700;
  margin-left: 4px;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
  font-family: inherit;
  line-height: 1;
}
.filter-chip .chip-remove:hover { transform: scale(1.1); background: var(--ink); }
.filter-clear {
  padding: 7px 12px; border-radius: 20px; background: transparent;
  border: 1px dashed var(--line); font-size: 12px; font-family: inherit;
  cursor: pointer; color: var(--ink-muted); white-space: nowrap;
}
.filter-clear:hover { color: var(--accent-deep); }

/* 搜索框清空按钮 */
.search-wrap { flex: 1; position: relative; min-width: 0; }
.search-clear-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ink-muted);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-family: inherit;
  line-height: 1;
}
.search-clear-btn:hover { background: var(--accent-deep); }
.search-clear-btn.show { display: flex; }
.search-input.has-value { padding-right: 36px; }
.search-submit-btn, .search-suggest-toolbar { display: none; }
/* Keep the input in the page. Suggestions drop down directly below its row. */
@media (max-width: 719px), (max-height: 500px) and (pointer: coarse) {
  .topbar-row1 {
    display: grid; grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas: "brand language wishlist" "search search submit";
    height: auto; padding: 8px max(10px, env(safe-area-inset-right)) 8px max(10px, env(safe-area-inset-left)); gap: 8px;
  }
  .topbar-row1 > .brand-logo-mini { grid-area: brand; }
  .topbar-row1 > .header-language { grid-area: language; }
  .topbar-row1 > .wishlist-btn { grid-area: wishlist; min-height: 44px; }
  .topbar-row1 > .search-wrap { grid-area: search; }
  .topbar-row1 > .search-submit-btn { grid-area: submit; }
  .topbar-row1 .lang-btn { min-height: 44px; }
  .search-input { min-height: 44px; font-size: 16px; transition: border-color .15s, background-color .15s; }
  .search-input::placeholder { color: #506578; opacity: 1; }
  .search-input.has-value { padding-right: 44px; }
  .search-clear-btn { width: 44px; height: 44px; right: 0; background: transparent; color: #315570; font-size: 17px; }
  .search-clear-btn:hover { background: transparent; color: var(--ink); }
  .search-submit-btn, .search-done-btn {
    display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px;
    flex-shrink: 0; padding: 8px 10px; border-radius: 12px; font: inherit; font-size: 14px; font-weight: 700;
    cursor: pointer; white-space: nowrap;
  }
  .search-submit-btn { background: #1E6FA8; border: 1px solid #1E6FA8; color: #fff; }
  .search-done-btn { background: transparent; border: 1px solid var(--line); color: #315570; }
  .search-submit-btn:active, .search-done-btn:active { opacity: .8; }
  .search-submit-btn:focus-visible, .search-done-btn:focus-visible, .search-clear-btn:focus-visible { outline: 2px solid #1E6FA8; outline-offset: 2px; }
  .search-suggest { left: 10px; right: 10px; width: auto; transform: none; padding: 0 12px 12px; border: 1px solid var(--line); border-radius: 0 0 16px 16px; overflow: hidden; animation: none; }
  .search-suggest.open { display: flex; flex-direction: column; }
  .search-suggest-toolbar { display: flex; align-items: center; justify-content: space-between; flex: 0 0 auto; min-height: 48px; gap: 8px; color: #506578; font-size: 13px; }
  .search-suggest-inner { overflow-y: auto; min-height: 0; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .search-suggest-overlay.open { display: none; }
  .search-suggest-group { margin-bottom: 12px; }
  .search-suggest-tag { min-height: 44px; max-width: 100%; overflow-wrap: anywhere; }
  .recent-row { min-height: 44px; }
  .recent-row-text { font-size: 14px; overflow-wrap: anywhere; min-width: 0; }
  .recent-row-clear { min-height: 44px; min-width: 44px; }
  body.mobile-search-editing .chat-launch, body.mobile-search-editing #updateNoticePill, body.mobile-search-editing #updateNotice { visibility: hidden; pointer-events: none; }
}
.recent-row { width: 100%; border: 0; background: transparent; font: inherit; text-align: left; }
.dropdown-overlay {
  position: fixed; inset: 0; background: rgba(42, 37, 32, 0.4);
  z-index: 90; display: none;
}
.dropdown-overlay.open { display: block; }
.dropdown-panel {
  position: fixed; left: 0; right: 0;
  /* top 由 JS 动态设置为 .topbar 实际高度 */
  top: 0;
  background: var(--paper); z-index: 95; max-height: 70vh; overflow-y: auto;
  padding: 16px; display: none; border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-hover); border-radius: 0 0 20px 20px;
  animation: slide-down 0.18s ease-out;
}
@keyframes slide-down {
  from { transform: translateY(-12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.dropdown-panel.open { display: block; }
.dropdown-panel-inner { max-width: 900px; margin: 0 auto; }
.dropdown-panel h4 {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.15em;
  color: var(--ink-muted); font-weight: 700; margin-bottom: 12px;
}
.dropdown-options { display: flex; flex-wrap: wrap; gap: 8px; }
.dropdown-option {
  padding: 8px 14px; border-radius: 16px; background: var(--bg);
  border: 1px solid var(--line); font-size: 13px; font-family: inherit;
  cursor: pointer; color: var(--ink); transition: all 0.15s;
  display: inline-flex; align-items: center; gap: 6px;
}
.dropdown-option:hover { background: var(--bg-warm); }
.dropdown-option.selected {
  background: var(--accent-deep); color: var(--paper); border-color: var(--accent-deep);
}
.dropdown-option .count { font-size: 11px; opacity: 0.7; }
.main { max-width: 900px; margin: 0 auto; padding: 16px 12px 100px; }
.wishlist-strip {
  background: linear-gradient(135deg, #F5EFE4 0%, var(--accent-soft) 100%);
  border-radius: 16px; padding: 14px; margin-bottom: 20px; display: none;
}
.wishlist-strip.show { display: block; }
.wishlist-strip-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.wishlist-strip-title {
  font-family: 'Caveat', cursive; font-size: 24px; font-weight: 700;
  color: var(--accent-deep); line-height: 1;
}
.wishlist-strip-sub { font-size: 11px; color: var(--ink-soft); margin-top: 2px; }
.wishlist-strip-thumbs {
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  margin-bottom: 12px; padding-bottom: 2px;
}
.wishlist-strip-thumbs::-webkit-scrollbar { display: none; }
.wishlist-strip-thumb {
  width: 56px; height: 56px; border-radius: 10px; background: var(--paper);
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-family: 'Caveat', cursive; font-size: 13px; font-weight: 700;
  color: var(--ink-soft); cursor: pointer; position: relative; overflow: hidden;
}
.wishlist-strip-thumb .qty-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--accent-deep); color: white; font-size: 10px;
  font-weight: 700; padding: 1px 5px; border-radius: 8px;
  min-width: 18px; text-align: center; font-family: 'Quicksand', sans-serif;
}
.wishlist-strip-actions { display: flex; gap: 8px; }
.btn-copy {
  flex: 1; background: var(--ink); color: white; border: none;
  padding: 10px; border-radius: 14px; font-size: 14px; font-family: inherit;
  font-weight: 700; cursor: pointer; transition: all 0.2s;
}
.btn-copy:hover { background: var(--accent-deep); }

/* 许愿更新角色 */
.cr-box { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.cr-entry {
  width: 100%; padding: 10px; border-radius: 10px; cursor: pointer;
  background: var(--bg-warm); border: 1px dashed var(--line);
  color: var(--ink-soft); font-size: 14px; font-weight: 600;
}
.cr-entry:hover { background: var(--paper); border-color: var(--accent); color: var(--accent-deep); }
/* 许愿弹窗:z-index 650,盖在心愿单(600)之上 */
.cr-modal {
  position: fixed; inset: 0; z-index: 650;
  background: rgba(42, 37, 32, 0.6);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.cr-modal.open { display: flex; }
.cr-modal-card {
  position: relative; background: var(--paper); border-radius: 16px;
  padding: 24px; width: 100%; max-width: 380px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.25);
}
.cr-modal-card h2 { font-size: 18px; margin-bottom: 6px; }
.cr-modal-card .cr-sub { font-size: 13px; color: var(--ink-soft); margin-bottom: 14px; }
.cr-modal-card input {
  width: 100%; padding: 11px; margin-bottom: 10px;
  border: 1px solid var(--line); border-radius: 8px; font-size: 14px;
  background: var(--paper); color: var(--ink);
}
.cr-modal-card input:focus { border-color: var(--accent); outline: none; }
.cr-submit {
  width: 100%; padding: 11px; border: none; border-radius: 8px; cursor: pointer;
  background: var(--accent); color: var(--paper); font-size: 14px; font-weight: 600;
}
.cr-submit:hover { background: var(--accent-deep); }
.cr-submit:disabled { opacity: 0.6; cursor: default; }
.cr-msg { font-size: 13px; margin-top: 10px; text-align: center; min-height: 18px; }
.btn-clear {
  background: transparent; color: var(--ink-soft); border: 1px solid var(--line);
  padding: 10px 14px; border-radius: 14px; font-size: 13px;
  font-family: inherit; cursor: pointer;
}
.section-title {
  display: flex; align-items: baseline; gap: 10px;
  margin-bottom: 12px; padding: 4px 4px 10px;
  border-bottom: 1.5px solid var(--line);
}
.section-title h2 {
  font-family: 'Caveat', cursive; font-size: 26px; font-weight: 700;
  color: var(--ink); line-height: 1;
}
.section-title .badge {
  white-space: nowrap;
  font-size: 12px; color: var(--ink-muted); background: var(--bg-warm);
  padding: 2px 10px; border-radius: 12px; font-weight: 600;
}
.grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
  margin-bottom: 28px;
}
@media (min-width: 600px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 12px; } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(4, 1fr); gap: 14px; } }

/* 主网格分页 UI */
.main-pager {
  margin-top: 28px; padding: 20px 12px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  border-top: 1px solid var(--line-soft);
}
.main-pager:empty { display: none; padding: 0; border: none; margin: 0; }
.main-pager-info {
  font-size: 13px; color: var(--ink-muted);
}
.main-pager-controls {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; flex-wrap: wrap;
}
.main-pager-controls button {
  padding: 8px 14px; border: 1px solid var(--line);
  background: var(--paper); border-radius: 8px; cursor: pointer;
  font-size: 14px; color: var(--ink);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.main-pager-controls button:hover:not([disabled]) {
  background: var(--bg-warm); border-color: var(--accent); color: var(--accent-deep);
}
.main-pager-controls button[disabled] {
  opacity: 0.35; cursor: not-allowed;
}
.main-pager-pageinfo {
  font-size: 14px; color: var(--ink); padding: 0 8px;
}
.main-pager-pageinfo b { color: var(--accent-deep); font-weight: 700; }
.main-pager-jump {
  font-size: 13px; color: var(--ink-muted);
  display: inline-flex; align-items: center; gap: 5px;
  margin-left: 4px;
}
.main-pager-jump input {
  width: 60px; padding: 6px 8px;
  border: 1px solid var(--line); border-radius: 6px;
  font-size: 14px; text-align: center;
  background: var(--paper); color: var(--ink);
}
.main-pager-jump input:focus { border-color: var(--accent); outline: none; }

.card {
  background: var(--paper); border-radius: 14px; overflow: hidden;
  box-shadow: var(--shadow); cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); position: relative;
  /* 视口外的卡片完全跳过渲染,极大提升滚动性能 */
  content-visibility: auto;
  contain-intrinsic-size: 0 280px;  /* 预估卡片高度,防止滚动条跳 */
}
.card:active { transform: scale(0.98); }
@media (hover: hover) { .card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); } }
.card-img-wrap { width: 100%; background: var(--bg-warm); position: relative; overflow: hidden; }
.card-img {
  width: 100%;
  height: 100%;
  object-fit: contain;   /* 完整显示图案,不裁切 */
  display: block;
  /* 图片加载完淡入,消除"闪一下" */
  opacity: 0;
  transition: opacity 0.25s ease;
}
.card-img.loaded { opacity: 1; }
.card-placeholder {
  width: 100%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--bg-warm) 0%, var(--accent-soft) 100%);
  color: var(--ink-muted); font-family: 'Caveat', cursive;
  font-weight: 700; font-size: 24px; letter-spacing: 0.05em;
  position: relative;
  overflow: hidden;
}
/* 占位 shimmer 动画 — 让用户知道"图在加载",不是"卡死" */
.card-placeholder::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255,255,255,0.4) 50%,
    transparent 100%);
  animation: cardShimmer 1.8s ease-in-out infinite;
}
@keyframes cardShimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.card-info { padding: 8px 10px 10px; }
.card-code {
  font-size: 11px; font-weight: 700; color: var(--accent-deep);
  letter-spacing: 0.04em; margin-bottom: 3px;
}
.card-tags { display: flex; flex-wrap: wrap; gap: 3px; min-height: 18px; }
.card-tag {
  font-size: 10px; color: var(--ink-soft); background: var(--bg-warm);
  padding: 2px 7px; border-radius: 8px; white-space: nowrap; font-weight: 500;
}
.card-actions {
  position: absolute; top: 6px; right: 6px; display: flex; gap: 5px;
}
.card-action-btn {
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: none; cursor: pointer; display: flex;
  align-items: center; justify-content: center; font-size: 14px;
  transition: all 0.15s; box-shadow: 0 2px 6px rgba(0,0,0,0.1); color: var(--ink);
}
.card-action-btn:active { transform: scale(0.9); }
.card-action-btn.heart.active { background: var(--accent-deep); color: white; }
.card-action-btn.hide {
  background: rgba(255,255,255,0.9);
  font-size: 16px; font-weight: 700; color: var(--ink-muted);
}
.card-action-btn.hide:hover { color: var(--ink); }
.card.hidden { display: none; }
.empty {
  grid-column: 1 / -1; padding: 60px 20px;
  text-align: center; color: var(--ink-muted);
}
.empty h3 {
  font-family: 'Caveat', cursive; font-size: 28px;
  margin-bottom: 8px; color: var(--ink-soft);
}

/* 单图弹窗 */
.modal {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(42, 37, 32, 0.88); display: none;
  align-items: flex-end; justify-content: center;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
@media (min-width: 700px) { .modal { align-items: center; padding: 20px; } }
.modal.open { display: flex; }
.modal-card {
  background: var(--paper); border-radius: 20px 20px 0 0;
  width: 100%; max-width: 600px; max-height: 92vh; overflow-y: auto;
  position: relative; animation: slide-up 0.25s ease-out;
}
@keyframes slide-up {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@media (min-width: 700px) { .modal-card { border-radius: 20px; } }
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.98);
  border: none;
  cursor: pointer;
  font-size: 22px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  color: var(--ink);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  font-weight: 700;
  -webkit-tap-highlight-color: transparent;
}
.modal-close:hover { background: white; transform: scale(1.05); }
.modal-close:active { transform: scale(0.92); }

/* 左右翻页箭头 */
.modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.95);
  border: none;
  cursor: pointer;
  font-size: 32px;
  line-height: 1;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  color: var(--ink);
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  font-weight: 400;
  padding-bottom: 4px;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, transform 0.1s;
}
.modal-nav:hover:not(:disabled) { background: white; transform: translateY(-50%) scale(1.08); }
.modal-nav:active:not(:disabled) { transform: translateY(-50%) scale(0.94); }
.modal-nav:disabled { opacity: 0.3; cursor: default; }
.modal-nav-prev { left: 12px; padding-right: 6px; }
.modal-nav-next { right: 12px; padding-left: 6px; }

/* 计数 (1/100) */
.lightbox-counter {
  font-size: 12px;
  color: var(--ink-muted);
  font-weight: normal;
  margin-left: 8px;
  vertical-align: middle;
}

@media (max-width: 699px) {
  .modal-nav {
    width: 40px; height: 40px;
    font-size: 26px;
  }
  .modal-nav-prev { left: 6px; }
  .modal-nav-next { right: 6px; }
}

/* 小屏:弹窗从底部滑上来,贴 viewport 顶,close 用 fixed 避开浏览器顶栏/安全区 */
@media (max-width: 699px) {
  .modal-close {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0) + 14px);
    right: calc(env(safe-area-inset-right, 0) + 14px);
    z-index: 10001;
  }
}
.modal-img {
  background: var(--bg-warm); display: flex; align-items: center;
  justify-content: center; min-height: 280px; padding: 20px;
}
.modal-img .card-placeholder {
  width: 240px; height: 240px; border-radius: 16px; font-size: 36px;
}
.modal-info { padding: 20px 18px calc(env(safe-area-inset-bottom, 0) + 24px); }
.modal-info-compact { padding: 14px 18px calc(env(safe-area-inset-bottom, 0) + 16px); }
.modal-info h2 {
  font-family: 'Caveat', cursive; font-size: 32px;
  color: var(--accent-deep); line-height: 1;
}
.modal-info-compact h2 { font-size: 26px; }

/* 产品类别 badge - 显眼,防止客户选错 */
.product-badge {
  display: inline-block;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 9px;
  border-radius: 6px;
  border: 1.5px solid;
  margin-right: 8px;
  vertical-align: middle;
  line-height: 1.4;
  white-space: nowrap;
}
.modal-info .product {
  color: var(--ink-soft); font-size: 12px; margin-top: 4px; margin-bottom: 18px;
  font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
}

/* 详情折叠区 */
.modal-details { margin-top: 12px; }
.modal-details-toggle {
  display: inline-flex; align-items: center; gap: 4px;
  background: transparent; border: 0;
  color: var(--ink-muted); font-family: inherit;
  font-size: 11px; padding: 4px 0; cursor: pointer;
  text-transform: uppercase; letter-spacing: 0.1em;
  font-weight: 600;
}
.modal-details-toggle:hover { color: var(--ink); }
.modal-details-arrow { font-size: 10px; }
.modal-details-body {
  display: none;
  margin-top: 10px;
}
.modal-details.open .modal-details-body { display: block; }
.modal-field { margin-bottom: 12px; }
.modal-field h4 {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.15em;
  color: var(--ink-muted); font-weight: 700; margin-bottom: 6px;
}
.modal-field .tags { display: flex; flex-wrap: wrap; gap: 5px; }
.modal-field .tags span {
  font-size: 12px; background: var(--bg-warm); padding: 4px 10px;
  border-radius: 10px; color: var(--ink);
}
.modal-actions { display: flex; gap: 8px; margin-top: 18px; }
.modal-actions-top { margin-top: 0; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line-soft); }
.modal-btn {
  flex: 1; padding: 12px; border: 1px solid var(--line); background: var(--paper);
  border-radius: 14px; font-size: 13px; font-family: inherit; font-weight: 600;
  cursor: pointer; transition: all 0.2s; color: var(--ink);
}
.modal-btn:active { transform: scale(0.97); }
.modal-btn.primary { background: var(--ink); color: white; border-color: var(--ink); }
.modal-btn.primary.active { background: var(--accent-deep); border-color: var(--accent-deep); }
.modal-btn.mockup-btn { background: #0071E3; color: #fff; border-color: #0071E3; }
.modal-btn.mockup-btn:hover { background: #0077ED; }


/* 联系客服入口 */
.contact-entry { width:100%; border:0; padding:9px 16px; cursor:pointer; font-family:inherit; color:#17324D; background:linear-gradient(90deg,#FFE59A 0%,#FFF3C9 45%,#FFD77A 100%); box-shadow:inset 0 -1px 0 rgba(173,115,0,.18); display:flex; align-items:center; justify-content:center; gap:9px; font-size:13px; font-weight:800; letter-spacing:.02em; position:relative; overflow:hidden; }
.contact-entry::after { content:''; position:absolute; top:0; bottom:0; width:60px; background:linear-gradient(90deg,transparent,rgba(255,255,255,.75),transparent); animation:contactShine 3.2s ease-in-out infinite; }
.contact-entry-icon { width:23px; height:23px; border-radius:50%; background:#1E6FA8; color:#fff; display:inline-flex; align-items:center; justify-content:center; font-size:13px; box-shadow:0 0 0 4px rgba(30,111,168,.12); }
.contact-entry-arrow { transition:transform .2s; }
.contact-entry:hover .contact-entry-arrow { transform:translateX(4px); }
@keyframes contactShine { 0%,55% { left:-80px; } 100% { left:calc(100% + 80px); } }
.contact-modal { position:fixed; inset:0; z-index:670; background:rgba(31,41,55,.58); backdrop-filter:blur(8px); -webkit-backdrop-filter:blur(8px); display:none; align-items:flex-end; justify-content:center; }
.contact-modal.open { display:flex; }
.contact-modal-card { width:100%; max-width:760px; max-height:90vh; overflow-y:auto; background:var(--paper); border-radius:22px 22px 0 0; padding:26px 20px calc(env(safe-area-inset-bottom,0px) + 26px); position:relative; box-shadow:var(--shadow-hover); }
.contact-modal-card h2 { text-align:center; font-size:22px; margin:0 38px 5px; }
.contact-modal-sub { text-align:center; color:var(--ink-soft); font-size:13px; margin-bottom:20px; }
.contact-loading { min-height:220px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:12px; color:var(--ink-soft); font-size:13px; }
.contact-loading-spinner { width:34px; height:34px; border:3px solid var(--accent-soft); border-top-color:var(--accent-deep); border-radius:50%; animation:initSpin .8s linear infinite; }
.contact-options-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.contact-option { border:1px solid var(--line); border-radius:16px; background:#fff; padding:12px; text-align:center; box-shadow:0 4px 16px rgba(36,61,79,.07); }
.contact-option-image { width:100%; aspect-ratio:1; border-radius:12px; object-fit:contain; background:var(--bg); border:1px solid var(--line-soft); display:block; }
.contact-option-placeholder { width:100%; aspect-ratio:1; border-radius:12px; background:linear-gradient(145deg,var(--accent-soft),var(--bg-warm)); border:1px solid var(--line-soft); display:flex; align-items:center; justify-content:center; font-size:58px; }
.contact-option-name { min-height:42px; display:flex; align-items:center; justify-content:center; font-size:14px; font-weight:800; line-height:1.25; padding:8px 2px 6px; }
.contact-option-button { width:100%; border:0; border-radius:11px; padding:10px 8px; background:#1E6FA8; color:#fff; font-family:inherit; font-size:13px; font-weight:800; cursor:pointer; transition:transform .15s,background .15s; }
.contact-option-button:hover { background:#155A89; transform:translateY(-1px); }
.contact-option-button:disabled { background:#BCC8D0; cursor:default; transform:none; }
@media (min-width:700px) { .contact-modal { align-items:center; padding:20px; } .contact-modal-card { border-radius:22px; padding:30px; } }
@media (max-width:560px) { .contact-options-grid { grid-template-columns:1fr; } .contact-option { display:grid; grid-template-columns:104px 1fr; gap:0 12px; text-align:left; align-items:center; } .contact-option-image,.contact-option-placeholder { grid-row:1 / 3; font-size:42px; } .contact-option-name { justify-content:flex-start; min-height:auto; padding:3px 0 8px; } }

/* 心愿单弹窗 */
.wishlist-modal {
  position: fixed; inset: 0; z-index: 600;
  background: rgba(42, 37, 32, 0.88); display: none;
  align-items: flex-end; justify-content: center;
}
@media (min-width: 700px) { .wishlist-modal { align-items: center; padding: 20px; } }
.wishlist-modal.open { display: flex; }
.wishlist-modal-card {
  background: var(--paper); border-radius: 20px 20px 0 0;
  width: 100%; max-width: 540px; max-height: 92vh; overflow-y: auto;
  padding: calc(env(safe-area-inset-top, 0) + 24px) 20px 24px;
  animation: slide-up 0.25s ease-out; position: relative;
}
@media (min-width: 700px) {
  .wishlist-modal-card { border-radius: 20px; padding: 32px; }
}
.wishlist-modal-card h2 {
  font-family: 'Caveat', cursive; font-size: 32px;
  color: var(--accent-deep); margin-bottom: 4px;
}
.wishlist-modal-card .sub { color: var(--ink-soft); font-size: 12px; margin-bottom: 20px; }

/* 心愿单分组标题:贴纸 / 亚克力 */
.wl-group-title {
  font-size: 12px; font-weight: 700; color: var(--ink-soft);
  text-transform: uppercase; letter-spacing: 0.1em;
  margin: 4px 4px 10px 4px;
  display: flex; align-items: center; gap: 8px;
}
.wl-group-title:not(:first-child) { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); }
.wl-group-title.wl-group-acrylic { color: #5B21B6; }   /* 紫色,和亚克力主题色一致 */
.wl-group-count {
  font-size: 11px; padding: 2px 7px; border-radius: 10px;
  background: var(--bg-warm); color: var(--ink-muted);
  font-weight: 600; letter-spacing: 0;
}
.wl-group-title.wl-group-acrylic .wl-group-count { background: #EDE9FE; color: #5B21B6; }

.wl-row {
  display: flex; align-items: center; gap: 10px; padding: 10px;
  border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px;
  background: var(--paper); transition: all 0.15s;
}
.wl-row:hover { border-color: var(--accent); }
.wl-row-thumb {
  width: 44px; height: 44px; border-radius: 8px;
  background: linear-gradient(135deg, var(--bg-warm) 0%, var(--accent-soft) 100%);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Caveat', cursive; font-weight: 700; font-size: 14px;
  color: var(--ink-soft); flex-shrink: 0; cursor: pointer;
}
.wl-row-info { flex: 1; min-width: 0; cursor: pointer; }
.wl-row-code { font-weight: 700; font-size: 14px; color: var(--ink); }
.wl-row-tag {
  font-size: 11px; color: var(--ink-muted); margin-top: 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wl-qty {
  display: flex; align-items: center; background: var(--bg);
  border-radius: 10px; border: 1px solid var(--line); overflow: hidden;
}
.wl-qty button {
  width: 30px; height: 30px; border: none; background: transparent;
  font-size: 16px; cursor: pointer; color: var(--ink); font-family: inherit;
}
.wl-qty button:active { background: var(--bg-warm); }
.wl-qty input {
  width: 38px; height: 30px; border: none; background: transparent;
  text-align: center; font-size: 14px; font-weight: 700;
  font-family: inherit; color: var(--ink);
  -webkit-appearance: none; -moz-appearance: textfield;
}
.wl-qty input::-webkit-outer-spin-button,
.wl-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.wl-row-remove {
  background: transparent; border: none; color: var(--ink-muted);
  font-size: 18px; cursor: pointer; padding: 4px 8px; border-radius: 8px;
}
.wl-row-remove:hover { color: var(--accent-deep); }

.copy-preview {
  background: var(--bg); border: 1.5px dashed var(--line); padding: 14px;
  border-radius: 12px; font-family: 'Courier New', monospace; font-size: 13px;
  white-space: pre; max-height: 200px; overflow-y: auto;
  margin: 16px 0 12px; color: var(--ink); line-height: 1.7;
}
.copy-preview-label {
  font-size: 11px; color: var(--ink-muted); font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 4px;
}

/* 纯图查看弹窗:盖在心愿单(z-index 600)之上 */
.photo-viewer {
  position: fixed; inset: 0; z-index: 650;
  background: rgba(20, 18, 16, 0.92);
  display: none; align-items: center; justify-content: center;
  padding: 24px;
}
.photo-viewer.open { display: flex; }
.photo-viewer-img {
  max-width: 96vw; max-height: 90vh;
  object-fit: contain; border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}
.photo-viewer-close {
  position: absolute; top: 16px; right: 16px;
  width: 44px; height: 44px; border-radius: 50%;
  border: none; cursor: pointer;
  background: rgba(255,255,255,0.92); color: #2A2520;
  font-size: 20px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.photo-viewer-close:hover { background: #fff; transform: scale(1.05); }
.photo-viewer-close:active { transform: scale(0.92); }

/* 昵称输入弹窗 */
.nickname-modal {
  position: fixed; inset: 0; z-index: 700;
  background: rgba(42, 37, 32, 0.85);
  display: none; align-items: center; justify-content: center;
  padding: 20px;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.nickname-modal.open { display: flex; }
.nickname-modal-card {
  background: var(--paper);
  border-radius: 18px;
  width: 100%; max-width: 380px;
  padding: 28px 24px;
  animation: nicknamePop 0.25s ease-out;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
@keyframes nicknamePop {
  from { transform: scale(0.92) translateY(20px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}
.nickname-modal-card h2 {
  font-family: 'Caveat', cursive; font-size: 32px;
  color: var(--accent-deep); margin-bottom: 4px; line-height: 1.1;
}
.nickname-modal-card .sub {
  color: var(--ink-soft); font-size: 13px;
  margin-bottom: 18px; line-height: 1.5;
}
.nickname-modal-card input {
  width: 100%; padding: 14px 16px;
  border: 2px solid var(--line); border-radius: 12px;
  font-size: 15px; font-family: inherit; outline: none;
  margin-bottom: 14px; box-sizing: border-box;
  transition: border-color 0.2s;
}
.nickname-modal-card input:focus { border-color: var(--accent); }
.nickname-modal-card .btn-copy {
  width: 100%; padding: 14px;
  background: var(--accent-deep); color: white;
  border: none; border-radius: 12px;
  font-size: 15px; font-weight: 700; font-family: inherit;
  cursor: pointer; transition: all 0.15s;
}
.nickname-modal-card .btn-copy:hover { background: #1D4ED8; }
.nickname-modal-card .btn-copy:active { transform: scale(0.98); }

/* 长按弹出菜单 */
.longpress-menu {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(31, 41, 55, 0.5);
  display: none; align-items: flex-end; justify-content: center;
  animation: fadeInOverlay 0.2s ease;
}
.longpress-menu.open { display: flex; }
@keyframes fadeInOverlay { from { opacity: 0; } to { opacity: 1; } }
.longpress-menu-card {
  background: var(--paper);
  border-radius: 18px 18px 0 0;
  width: 100%; max-width: 480px;
  padding: 14px 14px max(20px, env(safe-area-inset-bottom));
  animation: slideUpMenu 0.22s ease;
}
@keyframes slideUpMenu { from { transform: translateY(100%); } to { transform: translateY(0); } }
.longpress-preview {
  display: flex; gap: 12px; align-items: center;
  padding: 8px; margin-bottom: 12px;
  border-radius: 10px; background: var(--bg-warm);
}
.longpress-preview-thumb {
  width: 56px; height: 56px; border-radius: 8px; overflow: hidden;
  background: var(--accent-soft); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: var(--accent-deep); font-size: 12px;
}
.longpress-preview-thumb img { width: 100%; height: 100%; object-fit: contain; }
.longpress-preview-info { flex: 1; min-width: 0; }
.longpress-preview-code { font-weight: 700; color: var(--ink); font-size: 15px; }
.longpress-preview-tag { font-size: 12px; color: var(--ink-muted); margin-top: 2px; }
.longpress-action {
  width: 100%; padding: 14px; border-radius: 12px;
  font-size: 15px; font-weight: 600; font-family: inherit;
  border: none; cursor: pointer; margin-bottom: 8px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: all 0.15s;
}
.longpress-action.save {
  background: var(--accent-soft); color: var(--accent-deep);
}
.longpress-action.save.active {
  background: var(--accent-deep); color: white;
}
.longpress-action.hide {
  background: var(--bg-warm); color: var(--ink-soft);
}
.longpress-action.cancel {
  background: transparent; color: var(--ink-muted);
  margin-top: 4px; margin-bottom: 0;
}
.longpress-action:active { transform: scale(0.97); }

.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--ink); color: var(--paper);
  padding: 12px 22px; border-radius: 24px; font-size: 14px;
  font-weight: 600; z-index: 9999; transition: transform 0.3s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* 新增角色提示:不阻断浏览,仅在有本次更新时由脚本显示 */
.update-notice {
  position: fixed; right: 20px; bottom: 20px; z-index: 480;
  width: min(360px, calc(100vw - 32px)); background: var(--paper);
  border: 1px solid var(--line); border-radius: 8px; padding: 16px;
  box-shadow: 0 14px 36px rgba(31,41,55,.18); display: none;
}
.update-notice.show { display: block; animation: updateNoticeIn .24s ease-out; }
@keyframes updateNoticeIn { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }
.update-notice-close { position:absolute; right:8px; top:8px; width:28px; height:28px; border:0; background:transparent; color:var(--ink-muted); font-size:18px; cursor:pointer; }
.update-notice-title { display:flex; align-items:center; gap:7px; padding-right:28px; font-size:15px; font-weight:700; color:var(--ink); }
.update-notice-sub { margin:4px 0 12px; font-size:12px; color:var(--ink-soft); }
.update-notice-thumbs { display:grid; grid-template-columns:repeat(6, 1fr); gap:6px; margin-bottom:13px; }
.update-notice-thumb { aspect-ratio:1; padding:0; overflow:hidden; border:1px solid var(--line-soft); border-radius:6px; background:var(--bg); cursor:pointer; }
.update-notice-thumb img { width:100%; height:100%; object-fit:cover; display:block; }
.update-notice-action { width:100%; border:0; border-radius:6px; padding:10px 12px; background:var(--accent-deep); color:#fff; font:inherit; font-size:13px; font-weight:700; cursor:pointer; }
.update-notice-pill { position:fixed; right:20px; bottom:20px; z-index:479; display:none; align-items:center; gap:7px; border:1px solid var(--line); border-radius:20px; padding:9px 13px; background:var(--paper); color:var(--ink); font:inherit; font-size:12px; font-weight:700; box-shadow:0 6px 18px rgba(31,41,55,.14); cursor:pointer; }
.update-notice-pill.show { display:flex; }

/* 站内留言:入口位于新品按钮上方,会话保存在当前设备 */
.chat-launch { position:fixed; right:20px; bottom:68px; z-index:481; min-height:42px; display:flex; align-items:center; gap:8px; border:1px solid #B9D6EC; border-radius:22px; padding:9px 14px; background:#1E6FA8; color:#fff; font:inherit; font-size:13px; font-weight:700; box-shadow:0 8px 22px rgba(30,111,168,.23); cursor:pointer; transition:transform .18s ease-out,background .18s ease-out; }
.chat-launch:hover { background:#185D8D; transform:translateY(-1px); }
.chat-launch:focus-visible,.chat-close:focus-visible,.chat-send:focus-visible,.chat-retry:focus-visible,.chat-account-action:focus-visible,.chat-quick-button:focus-visible { outline:3px solid rgba(74,144,194,.35); outline-offset:3px; }
.chat-launch-badge { display:none; min-width:20px; height:20px; padding:0 6px; align-items:center; justify-content:center; border-radius:10px; background:#fff; color:#155A89; font-size:11px; font-variant-numeric:tabular-nums; }
.chat-launch-badge.show { display:inline-flex; }
.chat-panel { position:fixed; right:20px; bottom:118px; z-index:690; width:min(410px,calc(100vw - 32px)); height:min(670px,calc(100dvh - 140px)); display:none; grid-template-rows:auto minmax(0,1fr) auto; background:var(--paper); border:1px solid var(--line); border-radius:16px; box-shadow:0 18px 54px rgba(31,41,55,.24); overflow:hidden; }
.chat-panel.open { display:grid; animation:updateNoticeIn .2s ease-out; }
.chat-header,.chat-messages,.chat-form { min-width:0; }
.chat-header { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; padding:16px 16px 13px; border-bottom:1px solid var(--line-soft); }
.chat-header-copy { min-width:0; }
.chat-title { margin:0; color:var(--ink); font-size:16px; font-weight:800; line-height:1.3; }
.chat-subtitle { margin:4px 0 0; color:var(--ink-soft); font-size:12px; line-height:1.45; overflow-wrap:anywhere; }
.chat-close { flex:0 0 34px; width:34px; height:34px; border:0; border-radius:10px; background:var(--bg); color:var(--ink-soft); font:inherit; font-size:20px; line-height:1; cursor:pointer; }
.sr-only { position:absolute!important; width:1px!important; height:1px!important; padding:0!important; margin:-1px!important; overflow:hidden!important; clip:rect(0,0,0,0)!important; white-space:nowrap!important; border:0!important; }
.chat-account-action { flex:0 0 auto; border:0; padding:6px 0; background:transparent; color:var(--accent-deep); font:inherit; font-size:11px; font-weight:800; cursor:pointer; }
.chat-messages { min-height:0; overflow-y:auto; overscroll-behavior:contain; padding:16px; background:#F7FAFC; scrollbar-color:#B7CBD9 transparent; }
.chat-loading,.chat-empty,.chat-error { min-height:100%; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:10px; padding:24px; text-align:center; color:var(--ink-soft); font-size:13px; line-height:1.6; }
.chat-error { color:#8B3A3A; }
.chat-retry { border:1px solid var(--line); border-radius:10px; padding:8px 12px; background:var(--paper); color:var(--accent-deep); font:inherit; font-weight:700; cursor:pointer; }
.chat-message { display:flex; flex-direction:column; align-items:flex-start; gap:4px; margin-bottom:13px; }
.chat-message.customer { align-items:flex-end; }
.chat-bubble { max-width:86%; padding:10px 12px; border-radius:14px 14px 14px 4px; background:#fff; color:var(--ink); box-shadow:0 3px 12px rgba(36,61,79,.08); font-size:14px; line-height:1.5; white-space:pre-wrap; overflow-wrap:anywhere; }
.chat-message.customer .chat-bubble { border-radius:14px 14px 4px 14px; background:#1E6FA8; color:#fff; }
.chat-bubble .chat-message-link { color:inherit; text-decoration:underline; text-underline-offset:3px; overflow-wrap:anywhere; }
.chat-bubble .chat-message-link:focus-visible { outline:2px solid currentColor; outline-offset:3px; border-radius:2px; }
.chat-message-meta { color:var(--ink-muted); font-size:10px; font-variant-numeric:tabular-nums; }
.chat-message-meta.failed { color:#A33D3D; }
.chat-context { margin:0 0 14px; padding:10px 11px; border:1px solid #C9DEED; border-radius:12px; background:#EEF7FD; color:var(--ink-soft); font-size:11px; line-height:1.45; overflow-wrap:anywhere; }
.chat-context strong { display:block; margin-bottom:2px; color:var(--ink); font-size:12px; }
.chat-form { padding:12px 14px max(14px,env(safe-area-inset-bottom)); border-top:1px solid var(--line-soft); background:var(--paper); }
.chat-quick { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); min-width:0; width:100%; gap:6px; padding:1px 1px 9px; }
.chat-quick-button { min-width:0; min-height:48px; border:1px solid #C9DEED; border-radius:10px; padding:6px 4px; background:#F2F8FC; color:#155A89; font:inherit; font-size:10px; line-height:1.25; font-weight:700; text-align:center; overflow-wrap:anywhere; cursor:pointer; }
.chat-field-label { display:block; margin-bottom:6px; color:var(--ink-soft); font-size:12px; font-weight:700; }
.chat-compose-row { display:flex; align-items:flex-end; gap:8px; }
.chat-input { flex:1; min-width:0; min-height:44px; max-height:116px; resize:none; border:1px solid var(--line); border-radius:12px; padding:11px 12px; background:#fff; color:var(--ink); font:inherit; font-size:16px; line-height:1.35; outline:none; }
.chat-input:focus { border-color:var(--accent); box-shadow:0 0 0 3px rgba(74,144,194,.14); }
.chat-send { flex:0 0 auto; min-height:44px; border:0; border-radius:12px; padding:10px 15px; background:#1E6FA8; color:#fff; font:inherit; font-size:13px; font-weight:800; cursor:pointer; }
.chat-send:disabled { background:#9FB4C3; cursor:wait; }
.chat-form-note { margin:7px 2px 0; color:var(--ink-muted); font-size:10px; line-height:1.4; }
.chat-form-status { min-height:17px; margin:5px 2px 0; color:#8B3A3A; font-size:11px; line-height:1.4; }
@media (max-width:560px) {
  .update-notice { right:16px; bottom:16px; }
  .update-notice-pill { right:16px; bottom:16px; }
  .chat-launch { right:16px; bottom:66px; }
  .chat-panel { left:12px; right:12px; bottom:12px; width:auto; height:calc(100dvh - 24px); border-radius:14px; }
}
@media (prefers-reduced-motion:reduce) { .chat-panel.open { animation:none; } .chat-launch { transition:none; } }
