:root {
  color-scheme: dark;
  font-family: 'Noto Sans CJK', system-ui, sans-serif;
  --google-toolbar-height: 0px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: #05080f;
  color: #ecf2ff;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #121826;
  border-bottom: 1px solid #252f47;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}



html.google-toolbar-visible body {
  padding-top: var(--google-toolbar-height);
}

html.google-toolbar-visible .topbar {
  top: var(--google-toolbar-height);
}
.brand-wrap {
  max-width: 1100px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand-logo-link { display: inline-flex; border-radius: 999px; }
.brand-logo {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  border: 2px solid #f2f2f2;
  flex-shrink: 0;
  object-fit: cover;
  background: #0b1020;
}
.brand-subtitle { margin: 0; color: #9ab1df; font-size: 12px; letter-spacing: 0.08em; }
.brand-title { margin: 2px 0 0; font-size: clamp(24px, 4.4vw, 34px); line-height: 1.2; }
.top-nav { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.top-nav-btn {
  background: #1f2c45;
  color: #dce8ff;
  border: 1px solid #2a3f64;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
}
.top-nav-btn.active { background: #17a8ef; color: #fff; border-color: #17a8ef; }
.container { max-width: 1100px; margin: 0 auto; padding: 24px; }
.hidden { display: none !important; }
.search-shell { background: #080d16; border: 1px solid #1d2940; border-radius: 16px; padding: 20px; }
.search-heading { font-size: clamp(30px, 5vw, 46px); font-weight: 800; margin-bottom: 14px; line-height: 1.2; }
.search-panel { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.search-actions { display: inline-flex; align-items: center; gap: 8px; }
.top-cart-btn { width: 42px; height: 42px; font-size: 20px; }
.icon-btn { position: relative; width: 46px; height: 46px; padding: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 22px; background: #1f2c45; color: #deebff; }
.cart-badge { position: absolute; top: -6px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #f14336; color: #fff; font-size: 11px; line-height: 18px; font-weight: 800; }
.keyword-field span { display: none; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
input, select, textarea {
  width: 100%; min-width: 0; padding: 12px 14px;
  border: 1px solid #315189; border-radius: 12px;
  background: #101828; color: #f2f6ff;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: #2cb8ff; box-shadow: 0 0 0 2px rgba(44, 184, 255, 0.2); }
button, .ghost-btn {
  border: none; border-radius: 12px; padding: 11px 16px; cursor: pointer; font-weight: 700;
  transition: transform 0.12s ease, filter 0.12s ease, background-color 0.12s ease;
}
button:hover, .ghost-btn:hover { filter: brightness(1.08); }
button:active, .ghost-btn:active { transform: translateY(1px) scale(0.99); }
button:disabled { cursor: not-allowed; opacity: 0.65; }
.primary-btn { background: #17a8ef; color: #fff; }
.ghost-btn { text-decoration: none; text-align: center; background: #1f2c45; color: #deebff; white-space: nowrap; }
.status { color: #a9b8d6; }
.grid { margin-top: 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.card { background: #0d1525; border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; border: 1px solid #25344f; }
.card img { width: 100%; aspect-ratio: 4/3; object-fit: contain; object-position: center; border-radius: 8px; background: #0a111f; }
.card-title { margin: 0; font-size: 15px; line-height: 1.35; min-height: 2.7em; }
.card .meta { font-size: 13px; color: #b6c7e8; margin: 0; }
.meta-list { display: grid; gap: 8px; }
.meta-list > .meta, .meta-list > .spec-row { min-height: 30px; display: flex; align-items: center; }
.variant-select { padding: 8px; border-radius: 10px; font-size: 13px; width: 100%; min-height: 34px; }
.spec-row { display: flex; align-items: center; gap: 8px; }
.spec-count { margin: 0; white-space: nowrap; }
.variant-slot { flex: 1; }
.variant-slot, .variant-slot-empty { min-height: 0; }
.card-actions { margin-top: auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.qty-control { grid-column: 1 / -1; display: grid; grid-template-columns: 40px minmax(0, 1fr) 40px; align-items: center; gap: 6px; }
.qty-btn { padding: 10px 0; font-size: 18px; line-height: 1; background: #1a2438; color: #dce8ff; }
.qty-input { text-align: center; padding: 10px 8px; }
.add-to-order-btn { width: 100%; }
.order-panel { margin-top: 20px; background: #0d1525; border: 1px solid #25344f; border-radius: 12px; padding: 16px; }
.order-contact { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.order-note-field { grid-column: 1 / -1; }
textarea { resize: vertical; min-height: 72px; }
.order-table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; min-width: 580px; }
th, td { border-bottom: 1px solid #25344f; padding: 8px; text-align: left; }
.sort-header {
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
}
.sort-header:hover {
  filter: none;
  color: #7ecbff;
}
.price-col, .price-cell { white-space: nowrap; word-break: keep-all; }
.sale-price { color: #ff4d4d; }
.muted-price { color: #8f99aa; }

.order-item-main {
  display: grid;
  grid-template-columns: auto 58px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}
.order-thumb {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  border: 1px solid #2a3f64;
  object-fit: contain;
  background: #0a1324;
}
.order-title {
  word-break: break-word;
  line-height: 1.45;
}
.remove-front {
  background: transparent;
  color: #ff6a3c;
  font-size: 22px;
  padding: 0 4px;
  border-radius: 8px;
}
.total { margin-top: 10px; text-align: right; font-size: 18px; }
.load-more-row { margin-top: 12px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.progress-panel { margin-top: 0; }
.progress-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.progress-col { border: 1px solid #25344f; border-radius: 12px; padding: 12px; background: #0a1324; }
.order-no-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.order-no-list li { padding: 8px 10px; border-radius: 10px; background: #1a2438; color: #e8f1ff; font-weight: 700; }
.order-no-list li.empty { color: #9fb0d6; font-weight: 500; }
@media (max-width: 1024px) {
  .container { padding: 20px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}
@media (max-width: 768px) {
  .topbar { padding: 12px 14px; flex-direction: column; align-items: stretch; }
  .brand-wrap { width: 100%; }
  .top-nav { width: 100%; justify-content: stretch; }
  .top-nav-btn { flex: 1; }
  .container { width: 100%; max-width: 100%; padding: 16px; }
  .search-shell, .order-panel { padding: 14px; }
  .search-panel, .order-contact, .card-actions, .progress-columns { grid-template-columns: 1fr; }
  .search-panel .search-actions .primary-btn, .load-more-row .primary-btn, #submitOrderBtn { width: 100%; }
  .search-actions { width: 100%; }
  .top-nav .icon-btn { width: 42px; height: 42px; flex: 0 0 42px; }
  .grid { grid-template-columns: 1fr; gap: 12px; }
  .card-title { min-height: auto; }
  table { min-width: 0; }
  th, td { padding: 6px; }
  .order-table-wrap table,
  .order-table-wrap thead,
  .order-table-wrap tbody,
  .order-table-wrap tr,
  .order-table-wrap th,
  .order-table-wrap td {
    display: block;
    width: 100%;
  }
  .order-table-wrap thead { display: none; }
  .order-table-wrap tr {
    border-bottom: 1px solid #25344f;
    padding: 8px 0;
  }
  .order-table-wrap td {
    border-bottom: none;
    padding: 4px 0;
  }
  .order-table-wrap td::before {
    content: attr(data-label) '：';
    color: #9db1d9;
    font-weight: 700;
    margin-right: 6px;
  }
  .order-table-wrap td[data-label="商品"]::before {
    display: none;
  }
  .order-table-wrap td[data-label="數量"] input {
    width: 100% !important;
    max-width: 120px;
  }
  .order-item-main { grid-template-columns: auto 48px minmax(0, 1fr); gap: 8px; }
  .order-thumb { width: 46px; height: 46px; }
  .order-title { white-space: normal; }
  .remove-front { font-size: 20px; }
}
@media (max-width: 520px) {
  .brand-wrap { gap: 10px; }
  .brand-logo { width: 44px; height: 44px; }
  .search-heading { margin-bottom: 10px; }
  .card { padding: 10px; }
}

.current-orders-panel { margin-top: 0; }
.submitted-orders-list {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}
.submitted-order-card {
  border: 1px solid #2a3b5a;
  border-radius: 14px;
  padding: 14px;
  background: #0a1324;
}
.submitted-order-header h3 {
  margin: 0;
  font-size: 20px;
}
.submitted-order-header p {
  margin: 8px 0 0;
}
.submitted-order-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin: 12px 0;
}
.submitted-order-meta p { margin: 0; }
.submitted-order-meta p:last-child { grid-column: 1 / -1; }

.submitted-order-card table { min-width: 0; }
.submitted-order-card td {
  word-break: normal;
  overflow-wrap: anywhere;
}
.submitted-order-card .submitted-item-main {
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: start;
}
@media (max-width: 768px) {
  .submitted-order-meta { grid-template-columns: 1fr; }
  .submitted-order-card table,
  .submitted-order-card thead,
  .submitted-order-card tbody,
  .submitted-order-card tr,
  .submitted-order-card th,
  .submitted-order-card td {
    display: block;
    width: 100%;
  }
  .submitted-order-card table { min-width: 0; }
  .submitted-order-card thead { display: none; }
  .submitted-order-card tr {
    border-bottom: 1px solid #25344f;
    padding: 8px 0;
  }
  .submitted-order-card td {
    border-bottom: none;
    padding: 4px 0;
  }
  .submitted-order-card td::before {
    content: attr(data-label) '：';
    color: #9db1d9;
    font-weight: 700;
    margin-right: 6px;
  }
  .submitted-order-card td[data-label="商品"]::before {
    display: none;
  }
  .submitted-order-card .submitted-item-main {
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
  }
  .submitted-order-card .order-thumb {
    width: 46px;
    height: 46px;
  }
}

.shop-reset-btn {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 220;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}
@media (max-width: 768px) {
  .shop-reset-btn {
    right: 14px;
    bottom: 14px;
  }
}

.translate-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid #2a3f64;
  background: #1f2c45;
}

.translate-icon {
  font-size: 14px;
}

.translate-pill {
  border: 1px solid #315189;
  border-radius: 999px;
  background: #101828;
  color: #f2f6ff;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.translate-pill:hover {
  background: #17233a;
}

.translate-hidden-source {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

#google_translate_element .goog-te-gadget,
#google_translate_element .goog-te-gadget .goog-te-combo {
  font-size: 0 !important;
}

#google_translate_element .goog-te-gadget > span,
.goog-logo-link {
  display: none !important;
}




@media (max-width: 768px) {
  .translate-wrap {
    width: auto;
    justify-content: center;
    border-radius: 999px;
    flex-wrap: nowrap;
    padding: 2px 6px;
  }

  .translate-pill {
    padding: 3px 8px;
    font-size: 11px;
  }
}
