/* Base element rules only. Keep specificity low and avoid page-specific selectors. */
html {
  box-sizing: border-box;
  max-width: 100%;
  background: var(--ni-color-page, #fdfbf8);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-gutter: stable;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

body[data-ni-modern-shell="1"] {
  max-width: 100%;
  min-width: 0;
  margin: 0;
  background: var(--ni-color-page, #fdfbf8);
  color: var(--ni-color-text, #5d514b);
  font-family: var(--ni-font-body);
  overflow-x: hidden;
}

body[data-ni-modern-shell="1"] img,
body[data-ni-modern-shell="1"] video,
body[data-ni-modern-shell="1"] canvas,
body[data-ni-modern-shell="1"] svg {
  max-width: 100%;
}

body[data-ni-modern-shell="1"] img {
  height: auto;
}

body[data-ni-modern-shell="1"] a {
  color: inherit;
}

body[data-ni-modern-shell="1"] input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]),
body[data-ni-modern-shell="1"] select,
body[data-ni-modern-shell="1"] textarea {
  font-family: inherit;
}

/* NI_BUTTON_FONT_CANONICAL — 全站按鈕統一 Noto Sans TC（--ni-font-button） */
body[data-ni-modern-shell="1"] button,
body[data-ni-modern-shell="1"] input[type="submit"],
body[data-ni-modern-shell="1"] input[type="button"],
body[data-ni-modern-shell="1"] input[type="reset"],
body[data-ni-modern-shell="1"] .button,
body[data-ni-modern-shell="1"] .btn,
body[data-ni-modern-shell="1"] a.button,
body[data-ni-modern-shell="1"] a.btn,
body[data-ni-modern-shell="1"] .ni-button,
body[data-ni-modern-shell="1"] a.ni-button,
body[data-ni-modern-shell="1"] button.ni-button,
body[data-ni-modern-shell="1"] input.ni-button,
body[data-ni-modern-shell="1"] .ni-system-btn,
body[data-ni-modern-shell="1"] a.ni-system-btn,
body[data-ni-modern-shell="1"] .ni-system-link,
body[data-ni-modern-shell="1"] .ni-product-card__cta,
body[data-ni-modern-shell="1"] .ni-v43-btn,
body[data-ni-modern-shell="1"] a.ni-v43-btn,
body[data-ni-modern-shell="1"] .ni-member-submit,
body[data-ni-modern-shell="1"] .ni-member-soft-link,
body[data-ni-modern-shell="1"] .ni-member-collection-button,
body[data-ni-modern-shell="1"] .ni-member-dashboard__button,
body[data-ni-modern-shell="1"] .ni-order-query-button,
body[data-ni-modern-shell="1"] .ni-drawer-link,
body[data-ni-modern-shell="1"] .ni-drawer-nav-toggle,
body[data-ni-modern-shell="1"] .ni-drawer-subnav-link,
body[data-ni-modern-shell="1"] .ni-qty-btn {
  font-family: var(--ni-font-button, var(--ni-font-body));
  font-weight: var(--ni-button-font-weight, 700);
  font-synthesis: none;
  letter-spacing: var(--ni-button-letter-spacing, .03em);
}

/* NI_FRONTEND_FORM_CONTROL_TEXT_ALIGN
 * Canonical owner: typed form controls center their inner text.
 * Search inputs are excluded — see NI_FRONTEND_SEARCH_INPUT_TEXT_ALIGN.
 * Do not re-add per-page search text-align overrides. */
body[data-ni-modern-shell="1"] input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]):not([type="search"]):not(#keyword):not([name="keywords"]):not([data-ni-autocomplete="front-search"]):not([data-ni-shell-search-input]),
body[data-ni-modern-shell="1"] select,
body[data-ni-modern-shell="1"] textarea {
  text-align: center;
  text-align-last: center;
}

/* NI_FRONTEND_SEARCH_INPUT_TEXT_ALIGN — 前台搜尋欄輸入文字一律靠左（全寬度） */
body[data-ni-modern-shell="1"] input[type="search"],
body[data-ni-modern-shell="1"] #keyword,
body[data-ni-modern-shell="1"] input[name="keywords"],
body[data-ni-modern-shell="1"] input[data-ni-autocomplete="front-search"],
body[data-ni-modern-shell="1"] input[data-ni-shell-search-input],
body[data-ni-modern-shell="1"] [data-ni-search] input:not([type="submit"]):not([type="button"]),
body[data-ni-modern-shell="1"] .ni-shell-search input,
body[data-ni-modern-shell="1"] .ni-search-inline-form input,
body[data-ni-modern-shell="1"] .ni-empty-state__search input,
body[data-ni-modern-shell="1"] .ni-order-goods-search input {
  text-align: left;
  text-align-last: left;
}
