/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue: #2563eb;
  --blue-light: #eff6ff;
  --blue-pale: #dbeafe;
  --green: #10b981;
  --orange: #f59e0b;
  --red: #ef4444;
  --purple: #7c3aed;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md: 0 4px 16px rgba(0,0,0,.10);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--gray-800);
  background: var(--gray-50);
}

body {
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; font-size: inherit; }

/* ===== NAVBAR ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  height: 60px;
  display: flex;
  align-items: center;
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
}

.navbar-inner {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.navbar-inner > * {
  min-width: 0;
}

.navbar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gray-900);
  font-size: 16px;
  white-space: nowrap;
}

.logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--blue-light);
  border-radius: 8px;
}

.logo-text strong { color: var(--blue); }

.navbar-nav {
  display: flex;
  gap: 4px;
  flex: 1;
  justify-content: center;
  min-width: 0;
}

.nav-link {
  padding: 6px 16px;
  border-radius: 8px;
  color: var(--gray-600);
  font-weight: 500;
  font-size: 14px;
  transition: all .15s;
}

.nav-link:hover { color: var(--blue); background: var(--blue-light); }
.nav-link.active { color: var(--blue); font-weight: 600; }
.nav-link.active::after {
  /* underline done via border-bottom on wrapper would need extra element; skip for now */
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-shrink: 0;
}

.navbar-search-row {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 10px;
}

.navbar-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  background: #fff;
  padding: 8px 12px;
}

.navbar-search-wrap input {
  width: 100%;
  border: none;
  outline: none;
  font-size: 13px;
  color: var(--gray-700);
  background: none;
}

@supports (-webkit-touch-callout: none) {
  .navbar-search-wrap input {
    font-size: 16px;
  }
}

.search-empty-state {
  display: none;
  margin-top: 12px;
  padding: 18px;
  border: 1px dashed var(--gray-200);
  border-radius: 12px;
  color: var(--gray-500);
  font-size: 13px;
  text-align: center;
}

.search-empty-state.show {
  display: block;
}

.member-menu {
  position: relative;
  display: none;
}

.member-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--gray-200);
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
}

.member-trigger:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.member-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 150px;
  border-radius: 10px;
  border: 1px solid var(--gray-200);
  background: #fff;
  box-shadow: var(--shadow-md);
  padding: 6px;
  display: none;
  z-index: 1200;
}

.member-menu.open .member-dropdown {
  display: block;
}

.member-item {
  width: 100%;
  display: block;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--gray-700);
  font-size: 13px;
}

.member-item:hover {
  background: var(--blue-light);
  color: var(--blue);
}

.icon-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--gray-500);
  transition: all .15s;
  position: relative;
}

.icon-btn:hover { background: var(--gray-100); color: var(--gray-800); }

.cart-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 14px;
  height: 14px;
  background: #ef4444;
  color: #fff;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.btn-outline {
  padding: 7px 16px;
  border: 1.5px solid var(--gray-300, #d1d5db);
  border-radius: 8px;
  color: var(--gray-700);
  font-weight: 500;
  font-size: 13px;
  transition: all .15s;
  background: #fff;
}
.btn-outline:hover { border-color: var(--blue); color: var(--blue); }

.btn-primary {
  padding: 7px 18px;
  min-height: 36px;
  background: var(--blue);
  color: #fff;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
  line-height: 1.2;
  transition: all .15s;
}
.btn-primary:hover { background: #1d4ed8; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,.35); }

.navbar-actions .btn-primary {
  height: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 16px;
  min-height: 0;
  border: 1.5px solid transparent;
  line-height: 1.2;
}

/* ===== PAGE LAYOUT ===== */
.page-wrapper {
  max-width: 1280px;
  margin: 28px auto 36px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 20px;
  align-items: start;
}

.main-content {
  width: 100%;
  min-width: 0;
}

.page-hero {
  margin-bottom: 20px;
  padding: 20px 24px;
  border: 1px solid rgba(191, 219, 254, .9);
  border-radius: 20px;
  background:
    radial-gradient(circle at right top, rgba(37, 99, 235, .12), transparent 26%),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: var(--shadow);
}

.page-subtitle {
  margin-top: 6px;
  font-size: 14px;
  color: var(--gray-500);
}

.category-bar {
  margin-bottom: 14px;
}

.sidebar-menu {
  display: flex;
  align-items: stretch;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 0 6px;
  scrollbar-width: none;
}

.sidebar-menu::-webkit-scrollbar {
  display: none;
}

.sidebar-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--gray-200);
  background: #fff;
  color: var(--gray-600);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
  position: relative;
  user-select: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.sidebar-item:hover {
  background: var(--blue-light);
  border-color: rgba(59, 130, 246, .24);
  color: var(--blue);
}

.sidebar-item.active {
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
  border-color: rgba(59, 130, 246, .32);
  color: var(--blue);
  font-weight: 600;
  box-shadow: 0 10px 20px rgba(37, 99, 235, .10);
}

.sidebar-indicator {
  width: 8px;
  height: 8px;
  background: var(--blue);
  border-radius: 99px;
}

.sidebar-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.page-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--gray-900);
  margin-top: 2px;
  margin-bottom: 0;
}

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

/* ===== PRODUCT CARD ===== */
.product-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: all .2s;
}

.product-card:hover {
  border-color: var(--blue-pale);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.right-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.card-cover-wrap {
  background: var(--gray-100);
}

.card-cover-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gpt-icon    { background: #eff6ff; }
.chatgpt-icon{ background: #f5f3ff; }
.claude-icon { background: #fffbeb; }
.api-icon    { background: #ecfdf5; }
.mj-icon     { background: #eff6ff; }
.bundle-icon { background: #f0fdf4; }

/* Badges */
.badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: .04em;
}
.badge-hot       { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.badge-exclusive { background: #f5f3ff; color: #7c3aed; border: 1px solid #ddd6fe; }
.badge-new       { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.badge-dev       { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.badge-aiart     { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.badge-bundle    { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }

.card-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.3;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tag {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 5px;
}
.tag-blue   { background: #dbeafe; color: #1d4ed8; }
.tag-green  { background: #d1fae5; color: #065f46; }
.tag-orange { background: #ffedd5; color: #c2410c; }
.tag-gray   { background: var(--gray-100); color: var(--gray-500); }
.tag-gray2  { background: #f3f4f6; color: #6b7280; }

.card-price-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: 4px;
  min-width: 0;
}

.card-price-row > * {
  min-width: 0;
}

.price-block {
  min-width: 0;
}

.card-title,
.ann-title,
.ann-desc {
  word-break: break-word;
}

.price-label {
  font-size: 11px;
  color: var(--gray-400);
  display: block;
  margin-bottom: 2px;
}

.price {
  font-size: 13px;
  color: var(--gray-800);
}

.price strong {
  font-size: 22px;
  font-weight: 800;
  color: #dc2626;
}

.price-unit {
  font-size: 12px;
  color: var(--gray-500);
}

.btn-buy {
  padding: 9px 18px;
  min-height: 36px;
  background: var(--blue);
  color: #fff;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
  transition: all .15s;
  flex-shrink: 0;
}

.btn-buy:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37,99,235,.35);
}

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

.panel-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px;
}

/* Announcement */
.panel-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}

.panel-icon { display: inline-flex; }

.panel-card-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--gray-900);
  flex: 1;
}

.panel-card-more {
  font-size: 12px;
  color: var(--blue);
  transition: opacity .15s;
  background: none;
  border: none;
  padding: 0;
}
.panel-card-more:hover { opacity: .7; }

.notice-modal {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: none;
}

.notice-modal.open {
  display: block;
}

.notice-modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .35);
}

.notice-modal-card {
  position: relative;
  width: min(520px, calc(100vw - 28px));
  margin: 10vh auto 0;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 16px;
}

.notice-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.notice-modal-head h3 {
  font-size: 16px;
  color: var(--gray-900);
}

.notice-modal-close {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--gray-200);
  color: var(--gray-500);
}

.notice-modal-title {
  margin-top: 12px;
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-800);
}

.notice-modal-content {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--gray-600);
  white-space: pre-wrap;
}

.announcement-list { display: flex; flex-direction: column; gap: 12px; }

.announcement-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  min-width: 0;
}

.announcement-item > div {
  min-width: 0;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}
.dot-red  { background: #ef4444; }
.dot-blue { background: #3b82f6; }

.ann-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--gray-800);
  margin-bottom: 2px;
}

.ann-desc {
  font-size: 12px;
  color: var(--gray-500);
  line-height: 1.5;
}

/* Support Card */
.support-card {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border-color: transparent;
}

.support-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.support-icon {
  width: 30px;
  height: 30px;
  background: rgba(255,255,255,.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.support-title {
  font-weight: 700;
  font-size: 14px;
  color: #fff;
}

.support-desc {
  font-size: 12px;
  color: rgba(255,255,255,.8);
  margin-bottom: 14px;
  line-height: 1.5;
}

.btn-chat {
  width: 100%;
  padding: 9px;
  background: #fff;
  color: var(--blue);
  border-radius: 9px;
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all .15s;
}
.btn-chat:hover { background: var(--blue-light); }

/* Enterprise Card */
.enterprise-card { }

.enterprise-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.enterprise-icon {
  width: 30px;
  height: 30px;
  background: var(--gray-100);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.enterprise-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--gray-900);
}

.enterprise-desc {
  font-size: 12px;
  color: var(--gray-500);
  line-height: 1.55;
  margin-bottom: 10px;
}

.enterprise-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: gap .15s;
}
.enterprise-link:hover { gap: 8px; }

/* ===== FOOTER ===== */
.footer {
  background: var(--gray-900);
  color: var(--gray-400);
  margin-top: 48px;
  padding: 48px 0 0;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 40px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}

.footer-logo {
  display: flex;
  align-items: center;
  margin-bottom: 14px;
  color: #fff;
}

.footer-desc {
  font-size: 13px;
  line-height: 1.65;
  color: var(--gray-400);
  max-width: 260px;
}

.footer-col h4 {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 14px;
}

.footer-col a {
  display: block;
  font-size: 13px;
  color: var(--gray-400);
  margin-bottom: 8px;
  transition: color .15s;
  word-break: break-word;
}
.footer-col a:hover { color: #fff; }

.footer-col .link-text {
  display: block;
  font-size: 13px;
  color: var(--gray-400);
  margin-bottom: 8px;
  word-break: break-word;
}

.social-icons { display: flex; gap: 8px; }

.social-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255,255,255,.08);
  display: inline-block;
  position: relative;
  color: var(--gray-400);
  transition: all .15s;
  padding: 0;
  line-height: 0;
}

.social-btn svg {
  position: absolute;
  inset: 0;
  margin: auto;
  display: block;
  width: 18px;
  height: 18px;
}
.social-btn:hover { background: var(--blue); color: #fff; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 16px 24px;
  text-align: center;
  font-size: 12.5px;
  color: var(--gray-500);
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  top: 60vh;
  left: 50%;
  right: auto;
  bottom: auto;
  background: var(--gray-900);
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  max-width: min(88vw, 420px);
  text-align: center;
  transform: translate(-50%, -12px);
  opacity: 0;
  pointer-events: none;
  transition: all .25s cubic-bezier(.4,0,.2,1);
  z-index: 999;
}

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

/* Hidden product cards */
.product-card.hidden { display: none; }

@media (max-width: 980px) {
  .navbar-inner {
    gap: 14px;
    padding: 0 14px;
  }

  .page-wrapper {
    margin: 14px auto;
    padding: 0 14px;
    grid-template-columns: 1fr;
  }

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

  .footer-inner {
    grid-template-columns: repeat(2, 1fr);
    gap: 22px;
  }
}

@media (max-width: 430px) {
  .navbar {
    height: auto;
    padding: 8px 0;
  }

  .navbar-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 8px;
    row-gap: 8px;
  }

  .navbar-search-row {
    padding: 0 14px 8px;
  }

  .navbar-logo {
    width: auto;
    display: flex;
    justify-content: flex-start;
    min-width: 0;
    flex: 1 1 auto;
    font-size: 15px;
  }

  .logo-text {
    min-width: 0;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .navbar-nav {
    grid-row: 2;
    grid-column: 1 / -1;
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    padding-bottom: 2px;
    gap: 2px;
    scrollbar-width: none;
  }

  .navbar-nav::-webkit-scrollbar {
    display: none;
  }

  .nav-link {
    font-size: 12px;
    padding: 6px 10px;
    flex: 0 0 auto;
  }

  .navbar-actions {
    display: flex;
    grid-row: 1;
    grid-column: 2;
    justify-self: end;
    margin-left: 0;
    min-width: max-content;
    gap: 6px;
    flex-wrap: nowrap;
  }

  .icon-btn {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
  }

  .btn-outline,
  .btn-primary {
    padding: 6px 9px;
    font-size: 11.5px;
    line-height: 1.1;
    white-space: nowrap;
    flex: 0 0 auto;
  }

  .member-trigger {
    padding: 6px 9px;
    font-size: 12px;
  }

  .member-dropdown {
    right: auto;
    left: 0;
    min-width: 136px;
  }

  .btn-outline,
  .btn-primary {
    padding: 6px 10px;
    font-size: 12px;
  }

  .sidebar-menu {
    gap: 8px;
  }

  .sidebar-item {
    padding: 9px 12px;
    font-size: 12px;
  }

  .page-title {
    font-size: 24px;
  }

  .product-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .product-card {
    padding: 14px;
  }

  .card-title {
    font-size: 14px;
  }

  .card-price-row {
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
  }

  .btn-buy {
    padding: 8px 14px;
    font-size: 12px;
  }

  .panel-card {
    padding: 13px;
  }

  .announcement-item {
    gap: 6px;
  }

  .ann-title {
    font-size: 12px;
  }

  .ann-desc {
    font-size: 11.5px;
  }

  .footer {
    margin-top: 28px;
    padding-top: 24px;
  }

  .footer-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 12px;
    padding: 0 14px 18px;
    align-items: start;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .footer-logo {
    margin-bottom: 10px;
  }

  .footer-desc {
    max-width: none;
    font-size: 12px;
    line-height: 1.55;
  }

  .footer-col h4 {
    font-size: 12.5px;
    margin-bottom: 8px;
  }

  .footer-col a,
  .footer-col .link-text {
    font-size: 12px;
    margin-bottom: 6px;
  }

  .social-icons {
    gap: 6px;
  }

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

  .toast {
    max-width: calc(100vw - 28px);
    top: 60vh;
  }
}

@media (max-width: 390px) {
  .page-wrapper {
    padding: 0 10px;
  }

  .navbar-inner {
    padding: 0 10px;
  }

  .navbar-logo {
    font-size: 14px;
  }

  .logo-icon {
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
  }

  .navbar-nav {
    gap: 1px;
  }

  .nav-link {
    padding: 5px 9px;
    font-size: 11.5px;
  }

  .sidebar-item {
    padding: 7px 9px;
    font-size: 11.5px;
  }

  .product-card {
    padding: 12px;
  }

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

  .btn-outline,
  .btn-primary {
    padding: 5px 7px;
  }
}

@media (max-width: 375px) {
  .navbar-actions {
    gap: 4px;
    min-width: 0;
  }

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

  .btn-outline,
  .btn-primary {
    font-size: 11.5px;
    padding: 5px 8px;
    line-height: 1.15;
  }

  .card-tags {
    gap: 4px;
  }

  .tag {
    font-size: 10px;
    padding: 2px 6px;
  }

  .footer-bottom {
    padding: 10px 10px;
    font-size: 11.5px;
  }
}

/* ===== HOME PAGE MOBILE HOTFIX (390px) ===== */
@media (max-width: 390px) {
  .home-page {
    overflow-x: clip;
  }

  .home-page .navbar-inner,
  .home-page .page-wrapper,
  .home-page .footer-inner {
    max-width: 100%;
    min-width: 0;
  }

  .home-page .navbar-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px;
    align-items: center;
  }

  .home-page .navbar-logo {
    width: auto;
    justify-content: flex-start;
    min-width: 0;
    font-size: 14px;
  }

  .home-page .navbar-actions {
    gap: 4px;
    min-width: 0;
  }

  .home-page .navbar-actions .btn-outline,
  .home-page .navbar-actions .btn-primary {
    padding: 5px 7px;
    font-size: 11px;
    line-height: 1.15;
  }

  .home-page .navbar-nav {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
  }

  .home-page .navbar-nav::-webkit-scrollbar {
    display: none;
  }

  .home-page .nav-link {
    flex: 0 0 auto;
    padding: 5px 8px;
    font-size: 11.5px;
  }

  .home-page .sidebar,
  .home-page .main-content,
  .home-page .right-panel,
  .home-page .panel-card,
  .home-page .product-card,
  .home-page .card-header,
  .home-page .card-price-row,
  .home-page .announcement-item,
  .home-page .announcement-item > div {
    min-width: 0;
  }

  .home-page .page-wrapper {
    padding: 0 10px;
  }

  .home-page #sidebar-menu {
    gap: 4px;
  }

  .home-page #sidebar-menu .sidebar-item {
    padding: 7px 9px;
    font-size: 11.5px;
  }

  .home-page .product-grid {
    gap: 9px;
  }

  .home-page .card-title {
    font-size: 13.5px;
    line-height: 1.35;
    word-break: break-word;
  }

  .home-page .card-tags {
    gap: 4px;
  }

  .home-page .tag {
    font-size: 10px;
    padding: 2px 6px;
  }

  .home-page .card-price-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    align-items: start;
  }

  .home-page .price {
    font-size: 12px;
  }

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

  .home-page .btn-buy {
    width: 100%;
    text-align: center;
    white-space: nowrap;
  }

  .home-page .panel-card {
    padding: 12px;
  }

  .home-page .ann-title,
  .home-page .ann-desc {
    word-break: break-word;
  }

  .home-page .footer-inner {
    padding: 0 10px 22px;
  }
}

/* ===== THEME TOGGLE ===== */
.theme-toggle {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 999px;
  background: #fff;
  color: var(--gray-700);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-md);
  z-index: 1200;
  transition: all .2s ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  border-color: var(--blue);
  color: var(--blue);
}

.theme-toggle svg {
  width: 16px;
  height: 16px;
}

.theme-toggle-label {
  font-size: 12px;
  font-weight: 600;
}

/* ===== DARK MODE ===== */
[data-theme='dark'] body {
  background: #0b1220;
  color: #d6deed;
}

[data-theme='dark'] .navbar,
[data-theme='dark'] .product-card,
[data-theme='dark'] .panel-card,
[data-theme='dark'] .btn-outline,
[data-theme='dark'] .btn-chat,
[data-theme='dark'] .enterprise-icon {
  background: #121b2d;
  border-color: #273248;
}

[data-theme='dark'] .nav-link,
[data-theme='dark'] .sidebar-item,
[data-theme='dark'] .page-subtitle,
[data-theme='dark'] .category-bar-title,
[data-theme='dark'] .ann-desc,
[data-theme='dark'] .enterprise-desc,
[data-theme='dark'] .footer-bottom,
[data-theme='dark'] .price-unit,
[data-theme='dark'] .tag-gray,
[data-theme='dark'] .tag-gray2 {
  color: #98a8c2;
}

[data-theme='dark'] .navbar-logo,
[data-theme='dark'] .page-title,
[data-theme='dark'] .card-title,
[data-theme='dark'] .ann-title,
[data-theme='dark'] .panel-card-title,
[data-theme='dark'] .enterprise-title,
[data-theme='dark'] .price,
[data-theme='dark'] .sidebar-item.active,
[data-theme='dark'] .nav-link.active {
  color: #f1f5ff;
}

[data-theme='dark'] .nav-link:hover,
[data-theme='dark'] .sidebar-item:hover,
[data-theme='dark'] .sidebar-item.active,
[data-theme='dark'] .btn-chat:hover,
[data-theme='dark'] .icon-btn:hover {
  background: #1b2740;
}

[data-theme='dark'] .page-hero {
  background:
    radial-gradient(circle at right top, rgba(59, 130, 246, .16), transparent 26%),
    linear-gradient(180deg, rgba(18, 28, 46, .92), rgba(16, 25, 41, .92));
  border-color: rgba(94, 130, 187, .30);
}

[data-theme='dark'] .btn-outline {
  color: #c3d0e7;
}

[data-theme='dark'] .support-card {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e3a8a 100%);
}

[data-theme='dark'] .footer {
  background: #060b16;
}

[data-theme='dark'] .footer-col a,
[data-theme='dark'] .footer-col .link-text,
[data-theme='dark'] .footer-desc,
[data-theme='dark'] .social-btn,
[data-theme='dark'] .footer-bottom {
  color: #8ea0bd;
}

[data-theme='dark'] .social-btn {
  background: rgba(148, 163, 184, .12);
}

[data-theme='dark'] .theme-toggle {
  background: #111a2b;
  border-color: #2a3850;
  color: #d6deed;
}

[data-theme='dark'] .theme-toggle:hover {
  border-color: #3b82f6;
  color: #bfdbfe;
}

@media (max-width: 640px) {
  .theme-toggle {
    right: 14px;
    bottom: 14px;
    padding: 8px 10px;
  }

  .theme-toggle-label {
    font-size: 11px;
  }
}

/* ===== DARK MODE VISUAL DIRECTION ===== */
[data-theme='dark'] body {
  background:
    radial-gradient(circle at 10% -20%, rgba(37, 99, 235, .22), transparent 38%),
    radial-gradient(circle at 100% 0%, rgba(16, 185, 129, .10), transparent 36%),
    linear-gradient(180deg, #09101d 0%, #0b1322 42%, #0a1220 100%);
}

[data-theme='dark'] .navbar {
  background: rgba(10, 18, 33, .82);
  border-bottom-color: rgba(94, 130, 187, .26);
  backdrop-filter: blur(10px);
}

[data-theme='dark'] .product-card,
[data-theme='dark'] .panel-card,
[data-theme='dark'] .btn-outline,
[data-theme='dark'] .btn-chat,
[data-theme='dark'] .enterprise-icon {
  background: linear-gradient(180deg, rgba(18, 28, 46, .92), rgba(16, 25, 41, .92));
  border-color: rgba(94, 130, 187, .30);
}

[data-theme='dark'] .product-card:hover {
  border-color: rgba(89, 155, 255, .48);
  box-shadow: 0 12px 34px rgba(8, 13, 26, .55);
}

[data-theme='dark'] .support-card {
  background: linear-gradient(135deg, #2356c6 0%, #1d3e90 48%, #152f70 100%);
}

[data-theme='dark'] .theme-toggle {
  background: linear-gradient(180deg, rgba(19, 30, 49, .95), rgba(14, 22, 38, .95));
  border-color: rgba(94, 130, 187, .42);
  box-shadow: 0 14px 36px rgba(4, 9, 18, .50);
}

[data-theme='dark'] .toast {
  background: #0f1d33;
  border: 1px solid rgba(94, 130, 187, .38);
}

[data-theme='dark'] .member-trigger,
[data-theme='dark'] .member-dropdown {
  background: linear-gradient(180deg, rgba(18, 28, 46, .92), rgba(16, 25, 41, .92));
  border-color: rgba(94, 130, 187, .30);
  color: #d6deed;
}

[data-theme='dark'] .navbar-search-wrap,
[data-theme='dark'] .search-empty-state {
  background: linear-gradient(180deg, rgba(18, 28, 46, .92), rgba(16, 25, 41, .92));
  border-color: rgba(94, 130, 187, .30);
  color: #9fb0cb;
}

[data-theme='dark'] .navbar-search-wrap input {
  color: #d6deed;
}

[data-theme='dark'] .notice-modal-card {
  background: linear-gradient(180deg, rgba(18, 28, 46, .98), rgba(16, 25, 41, .98));
  border-color: rgba(94, 130, 187, .30);
}

[data-theme='dark'] .notice-modal-head h3,
[data-theme='dark'] .notice-modal-title {
  color: #f1f5ff;
}

[data-theme='dark'] .notice-modal-content,
[data-theme='dark'] .notice-modal-close {
  color: #9fb0cb;
  border-color: rgba(94, 130, 187, .30);
}

[data-theme='dark'] .member-item {
  color: #d6deed;
}

[data-theme='dark'] .member-item:hover {
  background: rgba(37, 99, 235, .2);
  color: #bfdbfe;
}

.toast {
  top: 60vh;
}

@media (max-width: 640px) {
  .toast {
    top: 60vh;
  }
}
