/* Global Reset and Variables */
:root {
  /* Liquid Glass Theme - Light */
  --bg-color: #F0F9FF;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: rgba(255, 255, 255, 0.95);
  --text-main: #0F172A;
  --text-muted: #64748B;
  --text-inverse: #FFFFFF;
  --accent-color: #0EA5E9;
  --accent-hover: #0284C7;
  --border-color: rgba(14, 165, 233, 0.15);
  --error-color: #EF4444;
  --success-color: #10B981;

  --shadow-sm: 0 4px 6px -1px rgba(14, 165, 233, 0.05), 0 2px 4px -1px rgba(14, 165, 233, 0.03);
  --shadow-md: 0 10px 15px -3px rgba(14, 165, 233, 0.08), 0 4px 6px -2px rgba(14, 165, 233, 0.04);
  --shadow-lg: 0 20px 25px -5px rgba(14, 165, 233, 0.1), 0 10px 10px -5px rgba(14, 165, 233, 0.04);
  --radius-md: 16px;
  --radius-lg: 24px;

  --font-heading: 'Rubik', sans-serif;
  --font-body: 'Nunito Sans', sans-serif;
  --navbar-h: 52px;
  --catalog-toolbar-h: 0px;
  --catalog-toolbar-top-gap: 4px;
  --catalog-top-gap: 8px;
  --catalog-bottom-gap: clamp(14px, 2.4dvh, 28px);
  --catalog-content-bottom-pad: clamp(10px, 1.8dvh, 20px);
  --catalog-viewport-h: 100dvh;
  --catalog-mobile-drawer-bottom-gap: max(12px, env(safe-area-inset-bottom));
  --catalog-toolbar-top: calc(var(--navbar-h, 52px) + var(--catalog-toolbar-top-gap, 4px));
  --catalog-sidebar-top: calc(var(--catalog-toolbar-top) + var(--catalog-toolbar-h, 0px) + var(--catalog-top-gap, 8px));
}

[data-theme="dark"] {
  --bg-color: #0F172A;
  --bg-card: rgba(30, 41, 59, 0.7);
  --bg-card-hover: rgba(30, 41, 59, 0.9);
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --text-inverse: #FFFFFF;
  --accent-color: #38BDF8;
  --accent-hover: #7DD3FC;
  --border-color: rgba(148, 163, 184, 0.1);

  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.5;
  transition: background-color 0.3s, color 0.3s;
}

html.detail-drawer-open,
body.detail-drawer-open,
body.catalog-drawer-open {
  overflow: hidden;
  overscroll-behavior: none;
}

h1,
h2,
h3,
h4,
.brand {
  font-family: var(--font-heading);
  font-weight: 700;
}

a {
  color: var(--accent-color);
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input,
textarea {
  font-family: inherit;
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(var(--bg-color-rgb), 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 8px 0;
}

[data-theme="dark"] .navbar {
  background-color: rgba(28, 25, 23, 0.8);
}

[data-theme="light"] .navbar {
  background-color: rgba(250, 250, 249, 0.8);
}

.navbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 36px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 1.28rem;
  color: var(--text-main);
}

.brand-icon {
  color: var(--accent-color);
  width: 28px !important;
  height: 28px !important;
}

.brand h1 {
  font-size: 1.28rem;
  line-height: 1.1;
}

.navbar .btn-primary,
.navbar .btn-ghost {
  min-height: 36px;
  padding: 0 14px;
  font-size: 0.9rem;
  line-height: 1;
}

.navbar .btn-icon {
  width: 36px;
  height: 36px;
}

.navbar #btn-user-dropdown {
  min-height: 36px;
  padding: 0 12px !important;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Buttons */
.btn-primary {
  background-color: var(--accent-color);
  color: var(--text-inverse);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background-color 0.2s, transform 0.1s;
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  transform: scale(1.02);
}

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

.btn-ghost {
  color: var(--text-main);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background-color 0.2s;
}

.btn-ghost:hover {
  background-color: var(--bg-card-hover);
}

.btn-icon {
  color: var(--text-muted);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-icon:hover {
  background-color: var(--bg-card-hover);
  color: var(--text-main);
}

.icon-sm {
  width: 18px;
  height: 18px;
}

/* Theme Toggle Icons */
[data-theme="dark"] .sun-icon {
  display: block;
}

[data-theme="dark"] .moon-icon {
  display: none;
}

[data-theme="light"] .sun-icon {
  display: none;
}

[data-theme="light"] .moon-icon {
  display: block;
}

/* Announcement Banner */
.banner {
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  transition: max-height 0.3s ease-out, opacity 0.3s;
  overflow: hidden;
}

.banner.hidden {
  max-height: 0;
  opacity: 0;
  padding: 0;
  border: none;
}

.store-config-html:empty {
  display: none;
}

.banner-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 16px 24px;
}

.banner-text {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.banner-text strong {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-main);
  margin-bottom: 8px;
  font-size: 1rem;
}

.banner-text p {
  margin-bottom: 4px;
}

/* Hero Section */
.hero-section {
  padding: 48px 0 32px;
  text-align: center;
}

.section-title {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.section-desc {
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* Catalog Layout */
.catalog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0 8px;
  padding: 4px 0;
  position: sticky;
  top: var(--catalog-toolbar-top);
  z-index: 86;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--bg-color) 96%, transparent),
    color-mix(in srgb, var(--bg-color) 86%, transparent)
  );
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.catalog-toolbar__meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.catalog-toolbar__meta i,
.catalog-toolbar__meta svg {
  color: var(--accent-color);
}

.catalog-toolbar__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
  flex-wrap: wrap;
}

.layout-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: var(--bg-card);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
  font-size: 0.84rem;
  font-weight: 800;
  white-space: nowrap;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.layout-toggle-btn:hover {
  border-color: rgba(14, 165, 233, 0.36);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}

.layout-toggle-btn i,
.layout-toggle-btn svg {
  color: var(--accent-color);
}

.detail-view-toggle-btn {
  border-color: rgba(16, 185, 129, 0.24);
}

.detail-view-toggle-btn i,
.detail-view-toggle-btn svg {
  color: var(--success-color);
}

@media (max-width: 640px) {
  .catalog-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .catalog-toolbar__actions {
    width: 100%;
    justify-content: stretch;
  }

  .catalog-toolbar__actions .layout-toggle-btn {
    flex: 1 1 140px;
  }
}

.catalog-layout {
  margin-top: 0;
  margin-bottom: var(--catalog-bottom-gap);
}

.catalog-layout--compact {
  --catalog-panel-h: min(720px, calc(100dvh - var(--catalog-sidebar-top) - var(--catalog-bottom-gap)));
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  align-items: start;
  gap: 18px;
  position: relative;
  top: auto;
  height: var(--catalog-panel-h);
  max-height: var(--catalog-panel-h);
  overflow: visible;
}

.catalog-layout--classic {
  display: block;
}

.catalog-layout--no-sidebar {
  display: block;
}

.catalog-layout--no-sidebar .catalog-sidebar {
  display: none;
}

.catalog-content {
  min-width: 0;
  position: relative;
}

.catalog-layout--classic #products-grouped {
  margin-top: 8px;
}

.catalog-layout--classic #products-grid {
  margin-top: 32px;
}

.catalog-layout--compact #products-grouped,
.catalog-layout--compact #products-grid {
  margin-top: 0;
}

.catalog-layout--compact .catalog-sidebar {
  position: relative;
  top: auto;
  align-self: start;
  z-index: 82;
  width: auto;
  height: var(--catalog-panel-h);
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.catalog-layout--compact.catalog-drawer-open .catalog-sidebar {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.catalog-layout--compact.catalog-layout--no-sidebar .catalog-sidebar {
  display: none;
}

.catalog-layout--compact .catalog-content {
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2px 12px var(--catalog-content-bottom-pad) 2px;
  overscroll-behavior-y: contain;
  scroll-behavior: auto;
  scroll-padding: 14px 0 var(--catalog-content-bottom-pad);
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 28px), transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 28px), transparent 100%);
}

.catalog-content,
.catalog-layout--compact .group-tab-bar,
.detail-left,
.detail-right {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.catalog-layout--compact .catalog-content.is-scrollable:not(.is-at-top) {
  mask-image: linear-gradient(to bottom, transparent 0, #000 24px, #000 calc(100% - 28px), transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 24px, #000 calc(100% - 28px), transparent 100%);
}

.catalog-layout--compact .catalog-content.is-scrollable.is-at-bottom {
  mask-image: linear-gradient(to bottom, transparent 0, #000 24px, #000 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 24px, #000 100%);
}

.catalog-layout--compact .catalog-content.is-scrollable.is-at-top.is-at-bottom,
.catalog-layout--compact .catalog-content:not(.is-scrollable) {
  mask-image: none;
  -webkit-mask-image: none;
}

.catalog-layout--compact .catalog-content::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.catalog-content::-webkit-scrollbar,
.catalog-layout--compact .group-tab-bar::-webkit-scrollbar,
.detail-left::-webkit-scrollbar,
.detail-right::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.catalog-drawer-trigger,
.catalog-drawer-backdrop,
.catalog-drawer-head {
  display: none;
}

.catalog-layout--compact:not(.catalog-layout--no-sidebar) .catalog-drawer-trigger:not([hidden]) {
  position: fixed;
  left: max(0px, env(safe-area-inset-left));
  top: 50%;
  z-index: 930;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 54px;
  min-height: 110px;
  padding: 10px 6px;
  border: 1px solid color-mix(in srgb, var(--accent-color) 28%, var(--border-color));
  border-left: 0;
  border-radius: 0 18px 18px 0;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--bg-card) 98%, transparent), color-mix(in srgb, var(--bg-card) 88%, transparent)),
    radial-gradient(circle at 80% 18%, color-mix(in srgb, var(--success-color) 16%, transparent), transparent 46%);
  color: var(--text-main);
  box-shadow: 10px 12px 30px rgba(14, 165, 233, 0.16);
  backdrop-filter: blur(18px) saturate(1.08);
  -webkit-backdrop-filter: blur(18px) saturate(1.08);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) translateX(-8px);
  transition:
    transform 0.24s ease,
    opacity 0.2s ease,
    box-shadow 0.24s ease,
    border-color 0.24s ease;
}

.catalog-layout--compact:not(.catalog-layout--no-sidebar) .catalog-drawer-trigger.is-visible:not([hidden]),
.catalog-layout--compact.catalog-drawer-open .catalog-drawer-trigger:not([hidden]) {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%);
}

.catalog-layout--compact:not(.catalog-layout--no-sidebar) .catalog-drawer-trigger:hover,
.catalog-layout--compact.catalog-drawer-open .catalog-drawer-trigger {
  border-color: color-mix(in srgb, var(--accent-color) 58%, var(--border-color));
  box-shadow: 12px 16px 36px rgba(14, 165, 233, 0.22);
  transform: translateY(-50%) translateX(3px);
}

.catalog-drawer-trigger__icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent-color), color-mix(in srgb, var(--success-color) 48%, var(--accent-color)));
  color: #fff;
  box-shadow: 0 8px 18px rgba(14, 165, 233, 0.22);
}

.catalog-drawer-trigger__icon svg {
  width: 17px;
  height: 17px;
  stroke-width: 2.7;
}

.catalog-drawer-trigger__text {
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
  writing-mode: vertical-rl;
  letter-spacing: 0;
}

.catalog-drawer-trigger__count {
  min-width: 26px;
  height: 22px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-color) 13%, var(--bg-card));
  color: var(--accent-color);
  font-size: 0.72rem;
  font-weight: 900;
}

.catalog-layout--compact .catalog-drawer-backdrop:not([hidden]) {
  position: fixed;
  inset: 0;
  z-index: 940;
  display: block;
  opacity: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(15, 23, 42, 0.32), rgba(15, 23, 42, 0.08) 58%, rgba(15, 23, 42, 0.02));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: opacity 0.28s ease;
}

.catalog-layout--compact.catalog-drawer-open .catalog-drawer-backdrop:not([hidden]) {
  opacity: 1;
  pointer-events: auto;
}

.catalog-layout--compact .catalog-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--border-color) 74%, transparent);
}

.catalog-drawer-title {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
  font-family: var(--font-heading);
  font-size: 0.98rem;
  font-weight: 900;
}

.catalog-drawer-title svg {
  color: var(--accent-color);
}

.catalog-drawer-close {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: color-mix(in srgb, var(--bg-card) 82%, transparent);
  color: var(--text-muted);
  transition: all 0.22s ease;
}

.catalog-drawer-close:hover {
  color: var(--text-main);
  border-color: color-mix(in srgb, var(--accent-color) 45%, var(--border-color));
  transform: translateY(-1px);
}

@media (min-width: 769px) {
  .catalog-layout--compact:not(.catalog-layout--no-sidebar) .catalog-drawer-trigger:not([hidden]),
  .catalog-layout--compact .catalog-drawer-backdrop:not([hidden]),
  .catalog-layout--compact .catalog-drawer-head {
    display: none;
  }
}

/* Products Grid (Bento) */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding-bottom: 64px;
}

.product-card {
  background-color: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  position: relative;
}

.product-card:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: rgba(14, 165, 233, 0.4);
  box-shadow: var(--shadow-lg);
}

.product-card:hover .product-image {
  transform: scale(1.06);
}

/* Image Container */
.product-image-container {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  flex-shrink: 0;
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: none;
}

.product-image-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 70%;
  background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.3) 50%, transparent 100%);
  pointer-events: none;
}

.product-image-title {
  position: absolute;
  bottom: 10px;
  left: 12px;
  right: 12px;
  font-size: 1.1rem;
  font-weight: 700;
  font-family: var(--font-heading);
  line-height: 1.35;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  z-index: 1;
}

/* Tags inside image */
.product-tags {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  z-index: 1;
}

.product-tag-item {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 5px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  white-space: nowrap;
  line-height: 1.3;
  letter-spacing: 0.02em;
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.product-spec-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: calc(100% - 20px);
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.76);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-image-container:has(.product-spec-badge) .product-tags {
  right: 118px;
}

/* Card Body */
.product-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-name {
  font-size: 1.1rem;
  margin-bottom: 8px;
  font-family: var(--font-heading);
  line-height: 1.4;
}

.product-card-title {
  min-height: 2.5em;
  margin: 0 0 10px;
  color: var(--text-main);
  font-family: var(--font-heading);
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-desc {
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.5;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px dashed var(--border-color);
  padding-top: 12px;
  margin-top: auto;
}

.product-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-color);
  font-family: var(--font-heading);
}

.product-price small {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.product-stock {
  font-size: 0.9rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Product Info Bar (方案A) */
.product-info-bar {
  display: flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(148, 163, 184, 0.08);
  border-radius: 10px;
  overflow: hidden;
}

[data-theme="light"] .product-info-bar {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.06);
}

.info-bar-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 10px;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

.info-bar-item + .info-bar-item {
  border-left: 1px solid rgba(148, 163, 184, 0.1);
}

[data-theme="light"] .info-bar-item + .info-bar-item {
  border-left-color: rgba(0, 0, 0, 0.06);
}

.info-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.info-value {
  color: var(--text-main);
  opacity: 0.85;
}

/* ==================== Group Tab Bar ==================== */
.group-tab-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  margin-bottom: 24px;
  overflow-x: auto;
  scrollbar-width: none;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-sm);
  position: sticky;
  /* navbar height is dynamic; JS will keep --navbar-h in sync. */
  top: calc(var(--navbar-h, 52px) + 12px);
  z-index: 90;
}
.group-tab-bar::-webkit-scrollbar { display: none; }

.group-tab {
  padding: 9px 20px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--text-muted);
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
}

.group-tab-icon,
.group-section-icon {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(14, 165, 233, 0.08);
  border: 1px solid rgba(14, 165, 233, 0.12);
  color: var(--accent-color);
}

.group-tab-icon img,
.group-section-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.group-tab-icon i,
.group-tab-icon svg,
.group-section-icon i,
.group-section-icon svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.4;
}

.group-tab-icon--text {
  font-size: 0.9rem;
  font-weight: 800;
}

.group-tab-main {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.group-tab-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.group-tab:hover {
  background: rgba(14, 165, 233, 0.06);
  color: var(--text-main);
}
.group-tab.active {
  background: var(--accent-color);
  color: #fff;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
}
.group-tab .tab-count {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
  background: rgba(0,0,0,0.08);
  min-width: 20px;
  text-align: center;
}
.group-tab.active .tab-count {
  background: rgba(255,255,255,0.25);
  color: #fff;
}

/* ==================== Group Section Divider ==================== */
.group-section {
  margin-bottom: 32px;
  animation: groupFadeIn 0.4s ease-out;
}
.group-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.group-section-header::before,
.group-section-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-color), transparent);
}
.group-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
  font-family: var(--font-heading);
}
.group-section-count {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(0,0,0,0.04);
  padding: 2px 8px;
  border-radius: 10px;
}
[data-theme="dark"] .group-section-count {
  background: rgba(255,255,255,0.06);
}

.catalog-layout--compact .group-tab-bar {
  position: relative;
  top: auto;
  z-index: 80;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  margin: 0;
  padding: 10px;
  border-radius: 18px;
  height: 100%;
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  box-shadow: var(--shadow-md);
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 28px), transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 28px), transparent 100%);
}

.catalog-layout--compact .group-tab-bar.is-scrollable:not(.is-at-top) {
  mask-image: linear-gradient(to bottom, transparent 0, #000 20px, #000 calc(100% - 28px), transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 20px, #000 calc(100% - 28px), transparent 100%);
}

.catalog-layout--compact .group-tab-bar.is-scrollable.is-at-bottom {
  mask-image: linear-gradient(to bottom, transparent 0, #000 20px, #000 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 20px, #000 100%);
}

.catalog-layout--compact .group-tab-bar.is-scrollable.is-at-top.is-at-bottom,
.catalog-layout--compact .group-tab-bar:not(.is-scrollable) {
  mask-image: none;
  -webkit-mask-image: none;
}

.catalog-layout--compact .group-tab-bar::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.catalog-layout--compact .group-tab {
  width: 100%;
  justify-content: flex-start;
  padding: 8px;
  border-radius: 12px;
  gap: 9px;
  text-align: left;
  border: 1px solid transparent;
}

.catalog-layout--compact .group-tab-main {
  flex: 1;
  justify-content: space-between;
}

.catalog-layout--compact .group-tab .tab-count {
  flex-shrink: 0;
}

.catalog-layout--compact .group-tab:hover {
  border-color: color-mix(in srgb, var(--accent-color) 26%, transparent);
}

.catalog-layout--compact .group-tab.active {
  border-color: color-mix(in srgb, var(--accent-color) 52%, transparent);
  background:
    linear-gradient(135deg, var(--accent-color), color-mix(in srgb, var(--success-color) 34%, var(--accent-color)));
  box-shadow: 0 10px 22px rgba(14, 165, 233, 0.24);
}

.catalog-layout--compact .group-section {
  margin-bottom: 16px;
}

.catalog-layout--compact .group-section:last-child {
  margin-bottom: 4px;
}

.catalog-layout--compact .group-section-header {
  margin-bottom: 10px;
}

.catalog-layout--compact .group-section-header::before,
.catalog-layout--compact .group-section-header::after {
  display: none;
}

.catalog-layout--compact .group-section-title {
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: 0.9rem;
}

.catalog-layout--compact .group-section-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
}

.catalog-layout--compact .bento-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding-bottom: 4px;
}

.catalog-layout--compact .product-card {
  border-radius: 14px;
}

.catalog-layout--compact .product-card:hover {
  transform: translateY(-3px);
}

.catalog-layout--compact .product-image-container {
  aspect-ratio: 16 / 9;
}

.catalog-layout--compact .product-image-title {
  bottom: 8px;
  left: 10px;
  right: 10px;
  font-size: 0.88rem;
  line-height: 1.25;
}

.catalog-layout--compact .product-tags {
  top: 7px;
  left: 7px;
  right: 7px;
  gap: 4px;
}

.catalog-layout--compact .product-tag-item {
  font-size: 0.62rem;
  padding: 2px 6px;
}

.catalog-layout--compact .product-body {
  padding: 9px 10px 10px;
}

.catalog-layout--compact .product-card-title {
  min-height: 2.45em;
  margin-bottom: 8px;
  font-size: 0.82rem;
  line-height: 1.22;
}

.catalog-layout--compact .product-desc {
  font-size: 0.72rem;
  line-height: 1.35;
  margin-bottom: 8px;
  -webkit-line-clamp: 1;
  line-clamp: 1;
}

.catalog-layout--compact .product-footer {
  gap: 7px;
  padding-top: 8px;
}

.catalog-layout--compact .product-price {
  font-size: 1.15rem;
}

.catalog-layout--compact .product-price small {
  font-size: 0.72rem;
}

.catalog-layout--compact .product-info-bar {
  border-radius: 9px;
}

.catalog-layout--compact .info-bar-item {
  gap: 3px;
  padding: 5px 4px;
  font-size: 0.66rem;
}

.catalog-layout--compact .info-dot {
  width: 5px;
  height: 5px;
}

@media (max-width: 980px) {
  .catalog-layout--compact {
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 14px;
  }

  .catalog-layout--compact .bento-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-container {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(0.95);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  border: 1px solid var(--border-color);
}

.modal-overlay.active .modal-container {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  background-color: var(--bg-card);
  z-index: 10;
}

.modal-title {
  font-size: 1.5rem;
}

.modal-close {
  color: var(--text-muted);
  background: var(--bg-card-hover);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}

.modal-close:hover {
  background: var(--error-color);
  color: white;
}

.modal-body {
  padding: 24px;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-main);
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--bg-color);
  color: var(--text-main);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.captcha-group {
  display: flex;
  gap: 12px;
}

.captcha-group .form-input {
  flex: 1;
}

.captcha-img {
  height: 48px;
  min-width: 120px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  background-color: #FAFAF9;
  /* Force light bg for captcha readability */
}

/* Spinner */
.spin {
  animation: spin 1s linear infinite;
}

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

/* Usage Guide within Product Modal */
.usage-guide {
  background-color: var(--bg-color);
  padding: 16px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  font-size: 0.95rem;
  border-left: 4px solid var(--accent-color);
}

.usage-guide p {
  margin-bottom: 8px;
  white-space: pre-wrap;
}

.usage-guide img {
  max-width: 100%;
  margin: 12px 0;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

/* Markdown formatting helpers */
.text-error {
  color: var(--error-color);
  margin-top: 8px;
  font-size: 0.9rem;
}

.text-success {
  color: var(--success-color);
}

/* ============================================================================
   Responsive – Mobile (≤ 768px)
   ============================================================================ */
@media (max-width: 768px) {

  /* ---------- Layout ---------- */
  .container {
    padding: 0 16px;
  }

  /* ---------- Navbar ---------- */
  .navbar {
    padding: 6px 0;
  }

  :root {
    --navbar-h: 46px;
    --catalog-toolbar-top-gap: 3px;
    --catalog-top-gap: 6px;
    --catalog-bottom-gap: 14px;
    --catalog-content-bottom-pad: 12px;
  }

  .navbar-inner {
    gap: 8px;
    min-height: 34px;
  }

  .brand {
    font-size: 1.08rem;
    gap: 6px;
  }

  .brand-icon {
    width: 24px !important;
    height: 24px !important;
  }

  .brand h1 {
    font-size: 1.08rem;
  }

  /* Nav links – shrink gaps & button padding */
  .nav-links {
    gap: 6px;
  }

  .btn-icon {
    width: 32px;
    height: 32px;
  }

  .btn-ghost {
    min-height: 32px;
    padding: 0 10px;
    font-size: 0.82rem;
    gap: 4px;
  }

  .btn-primary {
    min-height: 32px;
    padding: 0 12px;
    font-size: 0.82rem;
    gap: 4px;
    border-radius: 12px;
  }

  .icon-sm {
    width: 15px;
    height: 15px;
  }

  /* User dropdown – mobile friendly */
  #btn-user-dropdown {
    min-height: 32px;
    padding: 0 8px !important;
    font-size: 0.85rem !important;
  }

  #welcome-text {
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .dropdown-menu {
    right: -8px;
    min-width: 140px;
  }

  /* ---------- Announcement Banner ---------- */
  #announcement-banner .container {
    padding: 14px 16px !important;
  }

  #announcement-banner h3 {
    font-size: 0.9rem !important;
  }

  /* Force single-column for notice cards on mobile */
  #announcement-banner .container > div:last-child {
    flex-direction: column;
    gap: 12px;
  }

  /* Notice grid: single column on mobile */
  #announcement-banner .container > div:last-child > div:first-child {
    grid-template-columns: 1fr !important;
    gap: 8px;
  }

  /* Contact info card: full width */
  #announcement-banner .container > div:last-child > div:last-child {
    flex: 1 1 100% !important;
  }

  /* ---------- Group Tab Bar ---------- */
  .group-tab-bar {
    gap: 4px;
    padding: 4px;
    border-radius: 12px;
    margin-bottom: 16px;
    top: calc(var(--navbar-h, 46px) + 8px);
    -webkit-overflow-scrolling: touch;
  }

  .group-tab {
    padding: 7px 14px;
    font-size: 0.8rem;
    border-radius: 10px;
    gap: 4px;
  }

  .group-tab .tab-count {
    font-size: 0.65rem;
    padding: 1px 5px;
  }

  /* ---------- Hero / Titles ---------- */
  .section-title {
    font-size: 1.75rem;
  }

  .section-desc {
    font-size: 0.95rem;
  }

  /* ---------- Product Grid – 2 columns on mobile ---------- */
  .bento-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding-bottom: 40px;
  }

  /* ---------- Product Cards ---------- */
  .product-card {
    border-radius: 14px;
  }

  .product-image-container {
    aspect-ratio: 3 / 2.5;
  }

  .product-image-title {
    font-size: 0.78rem;
    bottom: 6px;
    left: 8px;
    right: 8px;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  .product-tags {
    top: 6px;
    left: 6px;
    right: 6px;
    gap: 3px;
  }

  .product-tag-item {
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 4px;
  }

  .product-body {
    padding: 8px 10px 10px;
  }

  .product-name {
    font-size: 0.82rem;
    margin-bottom: 4px;
  }

  .product-desc {
    font-size: 0.72rem;
    margin-bottom: 8px;
    -webkit-line-clamp: 1;
    line-clamp: 1;
  }

  .product-footer {
    gap: 6px;
    padding-top: 8px;
  }

  .product-price {
    font-size: 1.1rem;
  }

  .product-price small {
    font-size: 0.75rem;
  }

  /* Info bar compact */
  .product-info-bar {
    border-radius: 8px;
  }

  .info-bar-item {
    padding: 5px 4px;
    font-size: 0.65rem;
    gap: 3px;
  }

  .info-dot {
    width: 5px;
    height: 5px;
  }

  /* ---------- Banner ---------- */
  .banner-content {
    flex-direction: column;
    padding: 12px 16px;
  }

  #close-banner {
    position: absolute;
    right: 8px;
    top: 12px;
  }

  /* ---------- Footer ---------- */
  .footer-inner {
    flex-direction: column;
  }

  /* ---------- Modal ---------- */
  .modal-container {
    width: 95%;
    border-radius: 18px;
  }

  .modal-header {
    padding: 16px;
  }

  .modal-title {
    font-size: 1.2rem;
  }

  .modal-body {
    padding: 16px;
  }

  /* ---------- Group sections ---------- */
  .group-section {
    margin-bottom: 20px;
  }

  .group-section-header {
    margin-bottom: 12px;
  }

  .group-section-title {
    font-size: 0.85rem;
    padding: 4px 12px;
  }

  .catalog-toolbar {
    margin: 12px 0 8px;
  }

  .catalog-toolbar__meta {
    font-size: 0.78rem;
  }

  .layout-toggle-btn {
    min-height: 34px;
    padding: 7px 10px;
    border-radius: 12px;
    font-size: 0.78rem;
  }

  .catalog-layout--compact {
    display: block;
    position: relative;
    top: auto;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .catalog-layout--compact .catalog-sidebar {
    position: fixed;
    top: var(--catalog-sidebar-top);
    bottom: auto;
    left: max(8px, env(safe-area-inset-left));
    z-index: 960;
    width: min(304px, calc(100vw - 18px));
    height: calc(var(--catalog-viewport-h, 100dvh) - var(--catalog-sidebar-top) - var(--catalog-mobile-drawer-bottom-gap));
    max-height: calc(var(--catalog-viewport-h, 100dvh) - var(--catalog-sidebar-top) - var(--catalog-mobile-drawer-bottom-gap));
    min-height: 0;
    margin-bottom: 0;
    border-radius: 0 20px 20px 0;
    background:
      radial-gradient(circle at 16% 0, color-mix(in srgb, var(--accent-color) 18%, transparent), transparent 34%),
      color-mix(in srgb, var(--bg-card) 94%, transparent);
    border: 1px solid color-mix(in srgb, var(--border-color) 86%, transparent);
    box-shadow: 24px 0 54px rgba(15, 23, 42, 0.18);
    backdrop-filter: blur(24px) saturate(1.08);
    -webkit-backdrop-filter: blur(24px) saturate(1.08);
    transform: translateX(calc(-100% - 28px));
    opacity: 0;
    pointer-events: none;
    transition:
      transform 0.42s cubic-bezier(0.16, 1, 0.3, 1),
      opacity 0.24s ease;
  }

  .catalog-layout--compact.catalog-drawer-open .catalog-sidebar {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }

  .catalog-layout--compact .catalog-content {
    height: auto;
    overflow: visible;
    padding-left: 0;
    padding-right: 0;
    padding-bottom: 0;
    mask-image: none;
    -webkit-mask-image: none;
  }

  .catalog-layout--compact .group-tab-bar {
    flex: 1 1 auto;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px;
    background: transparent;
    border: 0;
    box-shadow: none;
    border-radius: 0;
    margin-bottom: 0;
    height: auto;
    min-height: 0;
    max-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    top: auto;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
  }

  .catalog-layout--compact .group-tab {
    width: 100%;
    min-width: 0;
    padding: 9px;
    border-radius: 13px;
    gap: 8px;
  }

  .catalog-layout--compact .group-tab-main {
    flex: 1;
    gap: 5px;
  }

  .catalog-layout--compact:not(.catalog-layout--no-sidebar) .catalog-drawer-trigger:not([hidden]) {
    width: 48px;
    min-height: 96px;
    gap: 5px;
    padding: 8px 5px;
    border-radius: 0 16px 16px 0;
  }

  .catalog-drawer-trigger__icon {
    width: 29px;
    height: 29px;
    border-radius: 11px;
  }

  .catalog-drawer-trigger__text {
    font-size: 0.72rem;
  }

  .catalog-drawer-trigger__count {
    min-width: 23px;
    height: 20px;
    font-size: 0.66rem;
  }

  .group-tab-icon {
    width: 24px;
    height: 24px;
    border-radius: 8px;
  }

  .catalog-layout--compact .bento-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding-bottom: 10px;
  }

  .catalog-layout--compact .info-bar-item {
    min-width: 0;
    overflow: hidden;
  }

  .catalog-layout--compact .info-bar-item span:not(.info-dot) {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* ============================================================================
   Responsive – Very small screens (≤ 380px)
   ============================================================================ */
@media (max-width: 380px) {
  .container {
    padding: 0 12px;
  }

  .brand {
    font-size: 1rem;
    gap: 4px;
  }

  .brand-icon {
    width: 22px !important;
    height: 22px !important;
  }

  .brand h1 {
    font-size: 1rem;
  }

  .nav-links {
    gap: 4px;
  }

  .btn-ghost {
    padding: 6px 8px;
    font-size: 0.78rem;
  }

  .btn-primary {
    padding: 6px 10px;
    font-size: 0.78rem;
  }

  .icon-sm {
    width: 14px;
    height: 14px;
  }

  /* Hide text label on very small screens, keep icon */
  .btn-ghost .icon-sm + br,
  #btn-query-order {
    font-size: 0;
  }

  #btn-query-order .icon-sm {
    font-size: initial;
  }
}

@media (max-width: 360px) {
  .catalog-layout--compact .bento-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .catalog-layout--compact .product-image-container {
    aspect-ratio: 16 / 9;
  }
}

/* UI Animations & Enhancements */
button,
.product-card,
input {
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.modal-container {
  animation: modalPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes modalPop {
  0% {
    transform: translateY(30px) scale(0.9);
    opacity: 0;
  }

  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* Footer & Guide Section */
.site-footer {
  margin-top: 60px;
  padding: 40px 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
}

.footer-inner {
  display: flex;
  gap: 24px;
}

.footer-card {
  flex: 1;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s, box-shadow 0.3s;
}

.footer-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(14, 165, 233, 0.4);
  /* subtle accent border */
}

.footer-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.25rem;
  margin-bottom: 20px;
  color: var(--text-main);
}

.footer-title i {
  color: var(--accent-color);
}

.guide-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.guide-steps li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.step-num {
  background: var(--accent-color);
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: bold;
  flex-shrink: 0;
}

.guide-steps strong {
  color: var(--text-main);
}

.highlight-link {
  color: #1677FF;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px dashed #1677FF;
  transition: opacity 0.2s;
}

.highlight-link:hover {
  opacity: 0.8;
}

.warranty-content {
  background: rgba(14, 165, 233, 0.05);
  /* very light accent bg */
  border: 1px dashed var(--accent-color);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
}

.warranty-highlight {
  color: var(--accent-hover);
  font-weight: 700;
  font-size: 1.1rem;
}

/* User Dropdown */
.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 160px;
  padding: 8px 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 200;
}

.dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-main);
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s;
}

.dropdown-item:hover {
  background-color: var(--bg-card-hover);
}

.dropdown-item.text-error {
  color: var(--error-color);
}

.dropdown-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 4px 0;
}

/* Pay Options UI */
.pay-option-wrapper {
  display: block;
  cursor: pointer;
}

.pay-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.pay-option-wrapper input:checked+.pay-option {
  border-color: var(--accent-color);
  background: rgba(14, 165, 233, 0.03);
  box-shadow: 0 0 0 1px var(--accent-color);
}

.pay-option span {
  font-weight: 600;
  font-size: 0.95rem;
}

.pay-option .check-icon {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 18px;
  height: 18px;
  background: var(--bg-card);
  color: var(--accent-color);
  border-radius: 50%;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.2s;
}

.pay-option-wrapper input:checked+.pay-option .check-icon {
  opacity: 1;
  transform: scale(1);
}

.pay-option:hover {
  background: var(--bg-card-hover);
}

.pay-method-empty {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--bg-color) 78%, transparent);
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 700;
  text-align: center;
}

/* Disabled payment option */
.pay-option-wrapper.disabled {
  cursor: not-allowed;
  pointer-events: none;
}

.pay-option-wrapper.disabled .pay-option {
  opacity: 0.45;
  background: var(--bg-color);
  border-color: var(--border-color);
  filter: grayscale(0.8);
}

.pay-option-wrapper.disabled .pay-option::after {
  content: '未开通';
  position: absolute;
  top: -8px;
  right: -4px;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--error-color);
  color: #fff;
  letter-spacing: 0.5px;
}

/* Disabled tracking pay button */
.btn-pay-now.disabled {
  cursor: not-allowed;
  pointer-events: none;
  opacity: 0.45;
  filter: grayscale(0.8);
  position: relative;
}

.btn-pay-now.disabled::after {
  content: '未开通';
  position: absolute;
  top: -8px;
  right: -4px;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--error-color);
  color: #fff;
  letter-spacing: 0.5px;
}

/* ============================================================================
   Inline Product Detail Panel (Apple-style expand/collapse)
   ============================================================================ */

.product-detail-panel {
  grid-column: 1 / -1;
  margin: 8px 0 24px 0;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transform: translateY(-12px) scale(0.98);
  transition:
    max-height 0.55s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.35s ease-out,
    transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
    margin 0.45s ease-out;
}

.product-detail-panel.expanding {
  display: block !important;
  max-height: calc(var(--catalog-panel-h, 640px) - 12px);
  opacity: 1;
  transform: translateY(0) scale(1);
}

.product-detail-panel.collapsing {
  display: block !important;
  max-height: 0;
  opacity: 0;
  transform: translateY(-12px) scale(0.97);
  transition: 
    max-height 0.4s cubic-bezier(0.4, 0, 1, 1),
    opacity 0.2s ease-in,
    transform 0.3s cubic-bezier(0.4, 0, 1, 1);
}

.product-detail-inner {
  height: calc(var(--catalog-panel-h, 640px) - 12px);
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 0;
  position: relative;
  overflow: hidden;
}

.product-detail-panel--drawer,
.product-detail-panel--drawer.expanding,
.product-detail-panel--drawer.collapsing {
  position: fixed;
  inset: 0;
  z-index: 980;
  grid-column: auto;
  margin: 0;
  max-height: none;
  overflow: hidden;
  transform: none;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.2), rgba(15, 23, 42, 0.38)),
    rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: opacity 0.34s ease, visibility 0.34s ease;
}

.product-detail-panel--drawer {
  opacity: 0;
  visibility: hidden;
}

.product-detail-panel--drawer.expanding {
  display: block !important;
  opacity: 1;
  visibility: visible;
}

.product-detail-panel--drawer.collapsing {
  display: block !important;
  opacity: 0;
  visibility: visible;
  pointer-events: none;
}

.product-detail-panel--drawer .product-detail-inner {
  width: min(80vw, 1180px);
  max-width: calc(100vw - 36px);
  height: 100dvh;
  max-height: 100dvh;
  min-height: 0;
  margin-left: auto;
  border-radius: 22px 0 0 22px;
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  box-shadow: -34px 0 70px rgba(15, 23, 42, 0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateX(104%);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.product-detail-panel--drawer.expanding .product-detail-inner {
  transform: translateX(0);
}

.product-detail-panel--drawer.collapsing .product-detail-inner {
  transform: translateX(104%);
  transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
  transition-duration: 0.36s;
}

/* Close button for detail panel */
.detail-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--bg-card) 82%, transparent);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.detail-close-btn:hover {
  background: var(--error-color);
  color: white;
  border-color: var(--error-color);
  transform: rotate(90deg) scale(1.1);
}

/* Detail panel content layout */
.detail-body {
  display: flex;
  flex-direction: column;
  gap: 0;
  height: 100%;
  min-height: 0;
}

.detail-columns {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  flex: 1;
  min-height: 0;
}

.detail-left {
  flex: 0 0 390px;
  max-width: 420px;
  min-height: 0;
  padding: 22px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  scrollbar-width: none;
  border-right: 1px solid var(--border-color);
}

.detail-left::-webkit-scrollbar {
  display: none;
}

.detail-right {
  flex: 2 1 400px;
  min-height: 0;
  padding: 28px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  scrollbar-width: none;
}

.detail-right::-webkit-scrollbar {
  display: none;
}

.detail-right .md-guide__scroll {
  max-height: none;
}

.product-detail-panel--drawer .detail-close-btn {
  top: 18px;
  right: 18px;
}

.product-detail-panel--drawer .detail-body {
  flex: 1 1 auto;
  position: relative;
  z-index: 1;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.product-detail-panel--drawer .detail-product-header {
  flex: 0 0 auto;
  padding: 18px 76px 18px 28px;
  background:
    radial-gradient(circle at 0 0, rgba(14, 165, 233, 0.12), transparent 32%),
    linear-gradient(135deg, rgba(16, 185, 129, 0.07), rgba(14, 165, 233, 0.055));
}

.product-detail-panel--drawer .detail-heading-row {
  grid-template-columns: minmax(0, 1fr) minmax(72px, auto) minmax(72px, auto) minmax(110px, auto);
  padding-right: 0;
}

.product-detail-panel--drawer .detail-heading-main h4 {
  font-size: clamp(1.08rem, 1.5vw, 1.45rem);
}

.product-detail-panel--drawer .detail-columns {
  display: grid;
  grid-template-columns: minmax(340px, 38%) minmax(0, 1fr);
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.product-detail-panel--drawer .detail-right {
  order: 2;
  flex: none;
  min-width: 0;
  padding: 30px 34px 104px;
  border-right: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.product-detail-panel--drawer .detail-left {
  order: 1;
  position: relative;
  z-index: 3;
  flex: none;
  max-width: none;
  min-width: 0;
  padding: 24px 24px 0;
  border-right: 1px solid color-mix(in srgb, var(--border-color) 74%, transparent);
  border-left: 0;
  background: linear-gradient(180deg, rgba(14, 165, 233, 0.028), rgba(16, 185, 129, 0.018));
  overflow-y: auto;
  overscroll-behavior: contain;
}

.product-detail-panel--drawer .md-guide {
  min-height: 100%;
}

.product-detail-panel--drawer .md-guide__header {
  font-size: 1.12rem;
}

.product-detail-panel--drawer .md-guide__scroll {
  max-height: none;
  padding-right: 10px;
}

.product-detail-panel--drawer .md-warranty {
  margin-top: 16px;
}

.product-detail-panel--drawer .purchase-form {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.product-detail-panel--drawer.product-detail-panel--drawer-stack .detail-body {
  min-height: 0;
  overflow: hidden;
}

.product-detail-panel--drawer.product-detail-panel--drawer-stack .product-detail-inner {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: 100dvh;
  min-height: 0;
  border-radius: 0;
}

.product-detail-panel--drawer.product-detail-panel--drawer-stack .detail-product-header {
  padding: 16px 60px 16px 18px;
}

.product-detail-panel--drawer.product-detail-panel--drawer-stack .detail-heading-row {
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.product-detail-panel--drawer.product-detail-panel--drawer-stack .detail-heading-main {
  grid-column: 1 / -1;
}

.product-detail-panel--drawer.product-detail-panel--drawer-stack .detail-columns {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-padding-bottom: 18px;
  padding-bottom: 16px;
  -webkit-overflow-scrolling: touch;
}

.product-detail-panel--drawer.product-detail-panel--drawer-stack .detail-right {
  order: 2;
  flex: 0 0 auto;
  min-height: auto;
  padding: 20px 18px 24px;
  border-right: 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 0;
  overflow: visible;
}

.product-detail-panel--drawer.product-detail-panel--drawer-stack .detail-left {
  order: 1;
  flex: 0 0 auto;
  min-height: auto;
  padding: 20px 18px 12px;
  border-right: 0;
  border-left: 0;
  border-bottom: 1px solid var(--border-color);
  overflow: visible;
}

.product-detail-panel--drawer.product-detail-panel--drawer-stack .purchase-form {
  min-height: 0;
  display: block;
}

.product-detail-panel--drawer.product-detail-panel--drawer-stack .detail-left .purchase-bottom-panel,
.product-detail-panel--drawer.product-detail-panel--drawer-stack .purchase-form > .purchase-bottom-panel {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
  max-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
  box-shadow: none !important;
  pointer-events: none !important;
}

.product-detail-panel--drawer.product-detail-panel--drawer-stack .detail-product-visual,
.product-detail-panel--drawer.product-detail-panel--drawer-stack.product-detail-panel--catalog-compact .detail-product-visual {
  aspect-ratio: 16 / 9;
}

.product-detail-panel--drawer.product-detail-panel--drawer-stack .md-guide__scroll {
  overflow: visible;
  padding-right: 0;
}

.product-detail-panel--drawer.product-detail-panel--drawer-stack .md-warranty {
  margin-top: 14px;
}

.product-detail-panel--drawer .purchase-grid,
.product-detail-panel--drawer .pay-method-grid {
  grid-template-columns: 1fr;
}

.purchase-bottom-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
}

.purchase-bottom-label {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.product-detail-panel--drawer .purchase-bottom-panel {
  position: sticky;
  bottom: 0;
  z-index: 8;
  margin: auto -24px 0;
  padding: 14px 24px calc(18px + env(safe-area-inset-bottom));
  border-top: 1px solid color-mix(in srgb, var(--border-color) 82%, transparent);
  background:
    linear-gradient(to top, color-mix(in srgb, var(--bg-card) 97%, transparent) 0%, color-mix(in srgb, var(--bg-card) 90%, transparent) 78%, color-mix(in srgb, var(--bg-card) 44%, transparent) 100%);
  box-shadow: 0 -18px 38px rgba(14, 165, 233, 0.1);
  backdrop-filter: blur(24px) saturate(1.08);
  -webkit-backdrop-filter: blur(24px) saturate(1.08);
}

.product-detail-panel--drawer.product-detail-panel--drawer-stack .purchase-bottom-panel {
  position: relative;
  inset: auto;
  flex: 0 0 auto;
  width: 100%;
  z-index: 24;
  max-height: min(34dvh, 248px);
  margin: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  gap: 8px;
  padding: 11px 18px calc(13px + env(safe-area-inset-bottom));
  border-radius: 18px 18px 0 0;
  border-top: 1px solid color-mix(in srgb, var(--border-color) 88%, transparent);
  background: rgba(248, 252, 255, 0.98);
  box-shadow: 0 -12px 34px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(18px) saturate(1.04);
  -webkit-backdrop-filter: blur(18px) saturate(1.04);
}

[data-theme="dark"] .product-detail-panel--drawer.product-detail-panel--drawer-stack .purchase-bottom-panel {
  background: rgba(15, 23, 42, 0.97);
}

.product-detail-panel--drawer.product-detail-panel--drawer-stack .purchase-bottom-pay {
  gap: 6px;
}

.product-detail-panel--drawer.product-detail-panel--drawer-stack .purchase-bottom-label {
  font-size: 0.68rem;
}

.product-detail-panel--drawer.product-detail-panel--drawer-stack .purchase-bottom-pay .pay-method-grid {
  gap: 6px;
}

.product-detail-panel--drawer.product-detail-panel--drawer-stack .pay-option {
  min-height: 36px;
  padding: 7px 10px;
}

.product-detail-panel--drawer.product-detail-panel--drawer-stack .purchase-total-submit {
  gap: 8px;
  padding-top: 0;
  grid-template-columns: auto minmax(72px, 1fr) minmax(116px, 0.76fr);
}

.product-detail-panel--drawer.product-detail-panel--drawer-stack .purchase-submit-action .btn-primary {
  min-height: 42px;
  height: 42px;
}

.product-detail-panel--drawer .purchase-bottom-pay {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.product-detail-panel--drawer .purchase-bottom-pay .pay-method-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.product-detail-panel--drawer .purchase-bottom-pay .pay-option-wrapper {
  flex: 0 1 auto;
  min-width: 94px;
}

.product-detail-panel--drawer .pay-option {
  min-height: 38px;
  padding: 8px 10px;
  min-width: 94px;
}

.product-detail-panel--drawer .pay-option img {
  width: 17px;
  height: 17px;
}

.product-detail-panel--drawer .pay-option span {
  min-width: 0;
  overflow: hidden;
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-detail-panel--drawer .coupon-mini--under-pay {
  grid-template-columns: 1fr;
  gap: 7px;
}

.product-detail-panel--drawer #coupon-status {
  grid-column: auto;
  margin-top: 0;
}

/* Staggered fade-in for detail children */
.detail-body > * {
  opacity: 0;
  transform: translateY(16px);
  animation: detailFadeIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.detail-body > *:nth-child(1) { animation-delay: 0.08s; }
.detail-body > *:nth-child(2) { animation-delay: 0.18s; }

.product-detail-panel--silent-update .detail-body > * {
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
}

@keyframes detailFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Product card selected state */
.product-card.active-detail {
  border-color: var(--accent-color) !important;
  box-shadow: 0 0 0 2px var(--accent-color), var(--shadow-md) !important;
  transform: scale(0.98) !important;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* Product info header within detail panel */
.detail-product-header {
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(14,165,233,0.05), rgba(16,185,129,0.04));
  border-bottom: 1px solid var(--border-color);
}

.detail-heading-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(70px, auto) minmax(70px, auto) minmax(96px, auto);
  align-items: center;
  gap: 14px;
  padding-right: 50px;
}

.detail-heading-main {
  min-width: 0;
}

.detail-heading-main h4 {
  margin: 0;
  color: var(--text-main);
  font-size: 1.18rem;
  font-weight: 850;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.detail-heading-row--single,
.product-detail-panel--drawer .detail-heading-row--single {
  grid-template-columns: minmax(0, 1fr);
}

.detail-product-visual {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  aspect-ratio: 4 / 3;
  margin-bottom: 14px;
  border: 1px solid color-mix(in srgb, var(--border-color) 82%, transparent);
  border-radius: 14px;
  overflow: hidden;
  background: color-mix(in srgb, var(--bg-color) 78%, transparent);
  box-shadow: 0 14px 34px rgba(14, 165, 233, 0.08);
}

.product-detail-panel--catalog-compact .detail-product-visual {
  aspect-ratio: 16 / 9;
}

.detail-product-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.detail-spec-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.detail-section-label {
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 850;
}

.detail-spec-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-spec-option {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  max-width: 100%;
  padding: 8px 34px 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 11px;
  background: color-mix(in srgb, var(--bg-card) 88%, transparent);
  color: var(--text-main);
  cursor: pointer;
  font-weight: 850;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.04);
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s, background 0.18s;
}

.detail-spec-option span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.82rem;
}

.detail-spec-option small {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

.detail-spec-option .check-icon {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 18px;
  height: 18px;
  color: var(--accent-color);
  background: var(--bg-card);
  border-radius: 999px;
  opacity: 0;
  transform: scale(0.72);
  transition: opacity 0.18s, transform 0.18s;
}

.detail-spec-option:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--accent-color) 58%, var(--border-color));
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(14, 165, 233, 0.1);
}

.detail-spec-option.active {
  border-color: var(--accent-color);
  background: color-mix(in srgb, var(--accent-color) 7%, var(--bg-card));
  box-shadow: 0 0 0 1px var(--accent-color), 0 10px 24px rgba(14, 165, 233, 0.14);
  cursor: default;
}

.detail-spec-option.active .check-icon {
  opacity: 1;
  transform: scale(1);
}

.detail-spec-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 14px;
}

.detail-spec-metric {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid color-mix(in srgb, var(--border-color) 84%, transparent);
  border-radius: 11px;
  background: color-mix(in srgb, var(--bg-card) 76%, transparent);
}

button.detail-spec-metric {
  font: inherit;
  text-align: left;
  color: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

button.detail-spec-metric:hover {
  border-color: color-mix(in srgb, var(--success-color) 54%, var(--border-color));
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(16, 185, 129, 0.12);
}

.detail-stock-action.is-ready {
  border-color: color-mix(in srgb, var(--success-color) 72%, var(--accent-color));
  background:
    linear-gradient(135deg, rgba(236, 253, 245, 0.98), rgba(224, 242, 254, 0.98));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--success-color) 58%, transparent), 0 14px 28px rgba(14, 165, 233, 0.16);
}

.detail-stock-action.is-ready span {
  color: #047857;
}

.detail-stock-action.is-ready strong {
  color: #0284c7;
}

[data-theme="dark"] .detail-stock-action.is-ready {
  background:
    linear-gradient(135deg, rgba(236, 253, 245, 0.96), rgba(224, 242, 254, 0.96));
}

.detail-spec-metric span {
  display: block;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 850;
  margin-bottom: 4px;
}

.detail-spec-metric strong {
  display: block;
  min-width: 0;
  color: var(--text-main);
  font-size: 0.96rem;
  font-weight: 900;
  line-height: 1.08;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-spec-metric.is-stock strong {
  color: var(--success-color);
}

.detail-spec-metric.is-soldout strong {
  color: var(--error-color);
}

.detail-spec-metric.is-price strong {
  color: var(--accent-color);
  font-family: var(--font-heading);
  font-size: 1.08rem;
}

.detail-spec-metric.is-price small {
  color: var(--text-muted);
  font-size: 0.64em;
}

.detail-top-metric,
.detail-price-chip {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  text-align: right;
  white-space: nowrap;
}

.detail-top-metric span,
.detail-price-chip span {
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 800;
}

.detail-top-metric strong {
  color: var(--text-main);
  font-size: 0.94rem;
  font-weight: 850;
  line-height: 1.1;
}

.detail-top-metric.is-stock strong {
  color: var(--success-color);
}

.detail-top-metric.is-soldout strong {
  color: var(--error-color);
}

.detail-price-chip {
  color: var(--accent-color);
  font-family: var(--font-heading);
}

.detail-price-chip small {
  font-size: 0.62em;
  color: var(--text-muted);
}

.detail-price-chip strong {
  color: var(--accent-color);
  font-size: 1.24rem;
  font-weight: 850;
  line-height: 1;
}

.purchase-form {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
}

.purchase-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.purchase-field {
  margin-bottom: 0;
}

.purchase-field .form-label {
  margin-bottom: 4px;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.purchase-field .form-input {
  min-height: 36px;
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 0.85rem;
}

.qty-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.qty-row #p-qty {
  width: 92px;
  margin-bottom: 0;
}

.qty-stepper {
  display: grid;
  grid-template-columns: 34px minmax(42px, 54px) 34px;
  align-items: stretch;
  min-width: 122px;
  height: 40px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  border-radius: 13px;
  background: color-mix(in srgb, var(--bg-color) 74%, transparent);
}

.qty-stepper-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-color);
  background: color-mix(in srgb, var(--bg-card) 76%, transparent);
  transition: background 0.2s, color 0.2s;
}

.qty-stepper-btn:first-child {
  border-right: 1px solid var(--border-color);
}

.qty-stepper-btn:last-child {
  border-left: 1px solid var(--border-color);
}

.qty-stepper-btn:hover:not(:disabled) {
  background: rgba(14, 165, 233, 0.1);
  color: var(--accent-hover);
}

.qty-stepper-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.qty-stepper-input.form-input {
  width: 100%;
  min-height: 0;
  height: 100%;
  margin: 0;
  padding: 0 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text-main);
  font-weight: 850;
  text-align: center;
}

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

.qty-stepper-input[type="number"] {
  -moz-appearance: textfield;
}

.volume-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 8px;
}

.volume-row > span {
  flex-shrink: 0;
  padding-top: 4px;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.volume-tier-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.volume-tier-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 26px;
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 750;
}

.volume-tier-btn strong {
  color: inherit;
}

.volume-tier-btn span {
  color: var(--accent-color);
}

.order-mini-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 116px;
  align-items: stretch;
  gap: 8px;
  margin-top: 10px;
}

.coupon-mini {
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.coupon-mini--under-pay {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin-top: 0;
}

.coupon-mini label {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 0;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 800;
  white-space: nowrap;
}

.coupon-mini label svg {
  width: 12px;
  height: 12px;
  color: #f59e0b;
}

.coupon-mini-input {
  display: flex;
  align-items: center;
  gap: 5px;
}

.coupon-mini-input .form-input {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
  text-transform: uppercase;
}

.coupon-mini-input .btn-primary {
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 9px;
  font-size: 0.76rem;
  white-space: nowrap;
}

#coupon-status {
  grid-column: 2;
  min-height: 0;
  margin-top: 0;
  font-size: 0.7rem;
  line-height: 1.25;
}

#coupon-status:empty {
  display: none;
}

.total-mini {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 8px 10px;
  border: 1px solid rgba(14, 165, 233, 0.16);
  border-radius: 10px;
  background: rgba(14, 165, 233, 0.045);
}

.total-mini span {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.total-mini strong {
  color: var(--accent-color);
  font-family: var(--font-heading);
  font-size: 1.02rem;
  font-weight: 850;
  line-height: 1.1;
}

.pay-method-field {
  margin-top: 0;
}

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

.detail-left .pay-option {
  min-height: 38px;
  gap: 7px;
  padding: 8px 9px;
  border-radius: 10px;
}

.detail-left .pay-option img {
  width: 18px;
  height: 18px;
}

.detail-left .pay-option span {
  min-width: 0;
  overflow: hidden;
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-left .pay-option .check-icon {
  width: 15px;
  height: 15px;
}

.purchase-submit-row {
  margin-top: auto;
  padding-top: 2px;
}

.purchase-total-submit {
  display: grid;
  grid-template-columns: auto minmax(76px, 1fr) minmax(128px, 0.74fr);
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 8px;
}

.product-detail-panel--drawer .purchase-total-submit {
  position: relative;
  z-index: 9;
  margin: 0;
  padding-top: 0;
}

.total-inline {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 0;
  border: 0;
  background: transparent;
}

.total-inline span {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.total-inline strong {
  color: var(--accent-color);
  font-family: var(--font-heading);
  font-size: 1.18rem;
  font-weight: 850;
  line-height: 1.08;
  white-space: nowrap;
}

.purchase-submit-action {
  min-width: 0;
  justify-self: end;
  width: min(100%, 170px);
}

.purchase-submit-action .btn-primary {
  width: 100%;
  min-height: 40px;
  height: 40px;
  justify-content: center;
  padding: 0 18px;
  border-radius: 13px;
  background-color: var(--success-color);
  box-shadow: 0 8px 20px rgba(34, 197, 94, 0.24);
  font-size: 0.93rem;
  white-space: nowrap;
}

.purchase-submit-action .btn-primary:hover {
  background-color: #0fb77d;
}

.purchase-bottom-error {
  min-height: 14px;
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.25;
  text-align: center;
}

@media (max-width: 860px) {
  .product-detail-panel.expanding {
    max-height: none;
  }

  .product-detail-inner {
    height: auto;
  }

  .detail-columns {
    display: block;
    min-height: 0;
  }

  .detail-left {
    flex-basis: auto;
    max-width: 100%;
    min-height: 0;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding: 20px;
  }

  .detail-heading-row {
    grid-template-columns: 1fr 1fr;
  }

  .detail-heading-main {
    grid-column: 1 / -1;
  }

  .detail-top-metric,
  .detail-price-chip {
    align-items: flex-start;
    text-align: left;
  }

  .order-mini-row {
    grid-template-columns: 1fr;
  }

  .coupon-mini--under-pay {
    grid-template-columns: 1fr;
  }

  #coupon-status {
    grid-column: auto;
    margin-top: 0;
  }

  .purchase-total-submit {
    grid-template-columns: minmax(84px, auto) minmax(0, 1fr);
  }

  .purchase-grid,
  .pay-method-grid {
    grid-template-columns: 1fr;
  }
  .detail-right {
    min-height: 0;
    max-height: none;
    padding: 20px;
  }

  .product-detail-panel--drawer:not(.product-detail-panel--drawer-stack) .detail-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 38%);
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }

  .product-detail-panel--drawer:not(.product-detail-panel--drawer-stack) .detail-left {
    order: 2;
    flex: none;
    max-width: none;
    min-width: 0;
    padding: 24px 24px 0;
    border-right: 0;
    border-bottom: 0;
    border-left: 1px solid color-mix(in srgb, var(--border-color) 74%, transparent);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .product-detail-panel--drawer:not(.product-detail-panel--drawer-stack) .detail-right {
    order: 1;
    flex: none;
    min-width: 0;
    min-height: 0;
    padding: 30px 34px 104px;
    border-top: 0;
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .product-detail-panel--drawer:not(.product-detail-panel--drawer-stack) .purchase-form {
    min-height: 100%;
    display: flex;
    flex-direction: column;
  }

  .product-detail-panel--drawer:not(.product-detail-panel--drawer-stack) .purchase-total-submit {
    grid-template-columns: auto minmax(76px, 1fr) minmax(128px, 0.74fr);
  }
}

@media (max-width: 520px) {
  .product-detail-panel--drawer.product-detail-panel--drawer-stack .detail-columns {
    scroll-padding-bottom: var(--detail-mobile-bottom-offset, 264px);
    padding-bottom: calc(var(--detail-mobile-bottom-offset, 264px) + 8px);
  }

  .product-detail-panel--drawer.product-detail-panel--drawer-stack .purchase-total-submit {
    grid-template-columns: auto minmax(72px, 1fr);
  }

  .product-detail-panel--drawer.product-detail-panel--drawer-stack .purchase-submit-action {
    grid-column: 1 / -1;
    width: 100%;
  }
}

/* ============================================================================
   Apple-style Focus Dimming Effect
   ============================================================================ */

.dimmable-section {
  transition:
    opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    filter 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, filter;
}

.dimmable-section.dimmed {
  opacity: 0.3;
  filter: blur(2px) saturate(0.6);
  pointer-events: none;
  user-select: none;
}

/* ============================================================================
   Reduced Motion Accessibility
   ============================================================================ */

@media (prefers-reduced-motion: reduce) {
  .product-detail-panel,
  .product-detail-panel.expanding,
  .product-detail-panel.collapsing,
  .product-detail-panel--drawer,
  .product-detail-panel--drawer .product-detail-inner,
  .dimmable-section,
  .detail-body > *,
  .product-card.active-detail,
  .detail-close-btn {
    transition-duration: 0.01s !important;
    animation-duration: 0.01s !important;
  }
}

/* ============================================================================
   Card Platform - Group Tabs
   ============================================================================ */

.cp-group-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  background: transparent;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.cp-group-tab:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
  background: rgba(14, 165, 233, 0.04);
}

.cp-group-tab.active {
  border-color: var(--accent-color);
  background: var(--accent-color);
  color: #fff;
}

.cp-group-tab.active span {
  color: #fff !important;
  opacity: 0.9;
}

.cp-group-tab.cp-add-group {
  border-style: dashed;
  padding: 5px 10px;
  color: var(--text-muted);
}

.cp-group-tab.cp-add-group:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
  background: rgba(14, 165, 233, 0.04);
}

/* Card Platform - Badges */
.cp-badge {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 600;
  display: inline-block;
}

.cp-badge-valid {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.cp-badge-expired {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.cp-badge-used {
  background: rgba(107, 114, 128, 0.1);
  color: #6b7280;
}

.cp-group-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  padding: 1px 7px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--gc, #6366f1) 10%, transparent);
  color: var(--gc, #6366f1);
  font-weight: 600;
  border: 1px solid color-mix(in srgb, var(--gc, #6366f1) 20%, transparent);
}

.activity-switch {
  display: inline-flex;
  align-items: center;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}

.activity-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.activity-switch span {
  position: relative;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: rgba(107, 114, 128, 0.26);
  transition: background 0.18s ease;
}

.activity-switch span::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.2);
  transition: transform 0.18s ease;
}

.activity-switch input:checked + span {
  background: #10b981;
}

.activity-switch input:checked + span::after {
  transform: translateX(16px);
}

/* Activities */
.activities-board {
  margin-top: 24px;
}

.activities-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.activities-header h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
}

.activities-header p {
  margin: 3px 0 0;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.activities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.activity-card {
  overflow: hidden;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-card);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.activity-card:hover {
  transform: translateY(-2px);
  border-color: rgba(14, 165, 233, 0.45);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.activity-card__media {
  position: relative;
  aspect-ratio: 16 / 7;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.04);
}

.activity-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.activity-card__tag {
  position: absolute;
  left: 12px;
  top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 700;
  backdrop-filter: blur(10px);
}

.activity-card__tag svg {
  width: 13px;
  height: 13px;
}

.activity-card__body {
  padding: 14px;
}

.activity-card__meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.activity-card__meta span {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.08);
  color: var(--accent-color);
  font-size: 0.72rem;
  font-weight: 700;
}

.activity-card h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.35;
  color: var(--text-main);
}

.activity-card p {
  min-height: 38px;
  margin: 6px 0 12px;
  color: var(--text-muted);
  font-size: 0.84rem;
  line-height: 1.55;
}

.activity-card__button {
  width: 100%;
  height: 38px;
  justify-content: center;
}

.lottery-modal {
  max-width: 680px;
  overflow: hidden;
  padding: 0;
}

.lottery-hero {
  position: relative;
  min-height: 210px;
  overflow: hidden;
  background: #111827;
}

.lottery-hero img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  display: block;
  opacity: 0.72;
}

.lottery-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.08), rgba(15, 23, 42, 0.82));
}

.lottery-close {
  position: absolute;
  z-index: 2;
  right: 14px;
  top: 14px;
  background: rgba(255, 255, 255, 0.92);
}

.lottery-hero__content {
  position: absolute;
  z-index: 1;
  left: 22px;
  right: 22px;
  bottom: 22px;
  color: #fff;
}

.lottery-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.86);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 800;
}

.lottery-pill svg {
  width: 14px;
  height: 14px;
}

.lottery-hero h3 {
  margin: 10px 0 4px;
  font-size: 1.5rem;
  line-height: 1.25;
}

.lottery-hero p {
  margin: 0;
  max-width: 560px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.92rem;
}

.lottery-body {
  padding: 18px 22px 22px;
}

.lottery-desc {
  margin: 0 0 14px;
  color: var(--text-muted);
  line-height: 1.65;
  font-size: 0.88rem;
}

.lottery-prizes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.lottery-prize {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 76px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 9px;
  background: rgba(15, 23, 42, 0.02);
}

.lottery-prize img {
  width: 58px;
  height: 58px;
  object-fit: cover;
  border-radius: 7px;
  flex-shrink: 0;
}

.lottery-prize strong,
.lottery-prize span {
  display: block;
}

.lottery-prize strong {
  color: var(--text-main);
  font-size: 0.9rem;
  line-height: 1.35;
}

.lottery-prize span {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 0.76rem;
  line-height: 1.4;
}

.lottery-empty {
  grid-column: 1 / -1;
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  border: 1px dashed var(--border-color);
  border-radius: 8px;
}

.lottery-form {
  display: grid;
  gap: 10px;
}

.lottery-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.08);
  color: #059669;
  font-size: 0.84rem;
  font-weight: 700;
}

.lottery-user svg {
  width: 16px;
  height: 16px;
}

.lottery-draw-btn {
  height: 44px;
  justify-content: center;
  font-size: 0.98rem;
}

.lottery-result {
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  font-size: 0.86rem;
}

.lottery-result--error {
  border: 1px solid rgba(239, 68, 68, 0.2);
  background: rgba(239, 68, 68, 0.07);
  color: var(--error-color);
}

.lottery-result--success {
  border: 1px solid rgba(16, 185, 129, 0.22);
  background: rgba(16, 185, 129, 0.08);
}

.lottery-win__title {
  font-weight: 800;
  color: #059669;
}

.lottery-win__prize {
  margin-top: 4px;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
}

.lottery-code {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
}

.lottery-code span {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  font-family: monospace;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--accent-color);
}

.lottery-win__hint {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 0.78rem;
}

@media (max-width: 640px) {
  .activities-grid {
    grid-template-columns: 1fr;
  }

  .lottery-hero {
    min-height: 190px;
  }

  .lottery-hero img {
    height: 220px;
  }

  .lottery-hero__content {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }

  .lottery-hero h3 {
    font-size: 1.25rem;
  }

  .lottery-body {
    padding: 16px;
  }
}
