/* pixel theme — Fusion Pixel 12px (OFL 1.1, see ../fonts/OFL.txt) */
@font-face {
  font-family: "PX12 SC";
  src: url("../fonts/px12-zh_hans.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "PX12 TC";
  src: url("../fonts/px12-zh_hant.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "PX12 JP";
  src: url("../fonts/px12-ja.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "PX12 Latin";
  src: url("../fonts/px12-latin.woff2") format("woff2");
  font-display: swap;
}

:root {
  --px-font: "PX12 SC";
  --sys-font: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --bg: #F4F5F2;
  --surface: #FFFFFF;
  --ink: #111111;
  --muted: #8A8F98;
  --line: #E6E8EB;
  --primary: #1F7A4D;
  --primary-dark: #17603C;
  --accent-bg: #EAF5EC;
  --success: #22A06B;
  --warning: #E8A23A;
  --danger: #D64545;
}
:root:lang(zh-TW) {
  --px-font: "PX12 TC";
  --sys-font: "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
}
:root:lang(ja) {
  --px-font: "PX12 JP";
  --sys-font: "Hiragino Sans", "Yu Gothic", "Meiryo", system-ui, sans-serif;
}
:root:lang(en) {
  --px-font: "PX12 Latin";
  --sys-font: system-ui, sans-serif;
}

/* ---------- typography ---------- */
body,
body.px-body {
  font-family: var(--sys-font) !important;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
}

h1, h2, h3, h4,
.px-display, .px-num, .px-num-xl, .px-nav, .px-nav-link,
.btn, .badge, .px-pill, .nav-tabs .nav-link, .px-tabs,
.table thead th, .page-link, .dropdown-header,
.px-card-title, .px-stat-title, .px-link, .px-avatar, .px-badge-dot,
.px-lang-name, .px-auth-company {
  font-family: var(--px-font), var(--sys-font) !important;
  font-weight: 400 !important;
  font-synthesis: none;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: 0;
}

h1, .px-display, .px-num-xl { font-size: 48px; line-height: 48px; }
h2 { font-size: 36px; line-height: 40px; }
h3, h4, .px-card-title, .px-stat-title { font-size: 24px; line-height: 28px; }
.px-num, .px-nav, .px-nav-link, .btn, .btn-sm, .btn-lg, .badge, .px-pill,
.nav-tabs .nav-link, .px-tabs button, .table thead th, .page-link,
.dropdown-header, .px-link, .px-avatar, .px-badge-dot, .px-lang-name {
  font-size: 12px;
}
h1, h2, h3, h4 { color: var(--ink); }

a { color: var(--primary); }
a:hover { color: var(--primary-dark); }
.text-primary { color: var(--primary) !important; }
.bg-primary { background-color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }

.px-dot { color: var(--primary); }
.px-muted { color: var(--muted); }
.px-small { font-size: 12px; }

/* ---------- top bar ---------- */
#page-topbar.px-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  z-index: 1002;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: none;
}
.px-topbar-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
}
.px-logo { display: inline-flex; align-items: center; flex: 0 0 auto; }
.px-logo img { height: 32px; width: auto; max-width: 200px; image-rendering: pixelated; }

.px-nav { align-items: center; gap: 0; flex: 1 1 auto; min-width: 0; }
.px-nav-link {
  display: inline-flex;
  align-items: center;
  height: 64px;
  padding: 0 14px;
  color: var(--ink);
  white-space: nowrap;
}
.px-nav > .px-nav-link:first-child,
.px-nav > .dropdown:first-child > .px-nav-link { padding-left: 0; }
.px-nav-link:hover { color: var(--primary); }
.px-nav-link.active { color: var(--primary); box-shadow: inset 0 -2px 0 var(--primary); }
.px-nav-link.dropdown-toggle::after { margin-left: 8px; }
.px-nav .dropdown-menu { margin-top: 0; }

.px-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.px-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 18px;
  cursor: pointer;
}
.px-icon-btn:hover { border-color: var(--ink); color: var(--ink); }
.px-lang-name { line-height: 16px; }
.px-badge-dot {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  line-height: 16px;
  background: var(--danger);
  color: #fff;
  text-align: center;
}
.px-user-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.px-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 4px;
  background: var(--ink);
  color: #fff;
}

/* ---------- layout ---------- */
.main-content { margin-left: 0 !important; overflow: visible; }
.page-content { padding: 88px 24px 48px; }
.page-content > .container-fluid,
.px-footer {
  max-width: 1440px;
  margin-left: auto;
  margin-right: auto;
}
.page-content > .container-fluid { padding-left: 0; padding-right: 0; }
.px-pagehead {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.px-pagehead .container-fluid { padding: 0; }
.px-pagehead-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.px-pagehead h1 { margin: 0; overflow-wrap: anywhere; }
.px-pagehead-id { color: var(--muted); vertical-align: middle; }
.px-breadcrumb .breadcrumb { padding: 0; margin: 0; background: transparent; font-size: 12px; }
.px-breadcrumb .breadcrumb-item a { color: var(--muted); }
.px-breadcrumb .breadcrumb-item.active { color: var(--ink); }
.page-content > .container-fluid > .container-fluid { padding: 0; }
.px-footer {
  padding: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

/* sidebar = mobile drawer only */
.vertical-menu {
  top: 64px;
  width: 264px;
  background: var(--surface) !important;
  border-right: 1px solid var(--line);
  box-shadow: none;
}
#sidebar-menu ul li a { color: var(--ink); font-size: 14px; }
#sidebar-menu ul li a i { color: var(--muted); }
#sidebar-menu ul li a:hover,
#sidebar-menu ul li a:hover i,
.mm-active > a, .mm-active > a i,
.mm-active .active, .mm-active .active i { color: var(--primary) !important; }
#sidebar-menu ul li ul.sub-menu li a { color: var(--ink); }
@media (min-width: 992px) {
  .vertical-menu { display: none !important; }
}
@media (max-width: 991.98px) {
  .vertical-menu {
    display: block !important;
    transform: translateX(-100%);
    transition: transform .2s steps(4);
  }
  body.sidebar-enable .vertical-menu { transform: none; }
  .px-topbar-inner { gap: 12px; padding: 0 16px; }
  .page-content { padding: 80px 16px 32px; }
}

/* ---------- components ---------- */
.card {
  border: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  margin-bottom: 24px;
}
.card-body { padding: 24px; }
.card-title { color: var(--ink); margin-bottom: 16px; }

.btn {
  border-radius: 0 !important;
  box-shadow: none;
  line-height: 20px;
  padding: 8px 16px;
}
.btn-sm { padding: 4px 12px; line-height: 20px; }
.btn:focus, .btn.focus { box-shadow: none; }
.btn-primary,
.btn-primary:not(:disabled):not(.disabled):active,
.btn-primary:not(:disabled):not(.disabled).active {
  background: var(--primary);
  border: 1px solid var(--ink);
  color: #fff;
  box-shadow: 2px 2px 0 var(--ink);
}
.btn-primary:hover, .btn-primary:focus { background: var(--primary-dark); border-color: var(--ink); color: #fff; box-shadow: 2px 2px 0 var(--ink); }
.btn-primary:not(:disabled):not(.disabled):active {
  transform: translate(2px, 2px);
  box-shadow: none;
}
.btn-primary.disabled, .btn-primary:disabled { background: var(--muted); border-color: var(--muted); box-shadow: none; }
.btn-outline-dark { border: 1px solid var(--ink); color: var(--ink); background: transparent; }
.btn-outline-dark:hover { background: var(--ink); color: #fff; }
.btn-light, .btn-outline-light, .btn-secondary, .btn-outline-secondary, .btn-default {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
}
.btn-light:hover, .btn-outline-light:hover, .btn-secondary:hover, .btn-outline-secondary:hover, .btn-default:hover {
  background: var(--bg);
  border-color: var(--ink);
  color: var(--ink);
}
.btn-success { background: var(--success); border-color: var(--success); }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-warning { background: var(--warning); border-color: var(--warning); color: var(--ink); }
.btn-outline-primary { border-color: var(--primary); color: var(--primary); }
.btn-outline-primary:hover,
.btn-outline-primary:not(:disabled):not(.disabled).active,
.btn-group-toggle .btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-link { color: var(--primary); }

.form-control,
.custom-select,
.input-group-text,
.bootstrap-select > .dropdown-toggle,
.bootstrap-select .btn.dropdown-toggle {
  border: 1px solid var(--line);
  border-radius: 0 !important;
  box-shadow: none;
  background-color: var(--surface);
  color: var(--ink);
}
.form-control:focus,
.custom-select:focus,
.bootstrap-select > .dropdown-toggle:focus,
.bootstrap-select.show > .dropdown-toggle {
  border-color: var(--ink);
  box-shadow: none !important;
  outline: 0 !important;
}
.input-group-text { background: var(--bg); }
.custom-control-input:checked ~ .custom-control-label::before {
  background-color: var(--primary);
  border-color: var(--primary);
}
.custom-checkbox .custom-control-label::before,
.custom-control-label::before { border-radius: 0; }
.custom-radio .custom-control-label::before { border-radius: 0; }

.table { color: var(--ink); }
.table thead th,
.table thead.bg-light th,
.table .thead-light th {
  background: var(--bg) !important;
  color: var(--muted);
  border-top: 0;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td, .table th { border-top: 1px solid var(--line); vertical-align: middle; }
.table-hover tbody tr:hover, .table-responsive tbody tr:hover td { background: var(--bg) !important; }

.nav-tabs { border-bottom: 1px solid var(--line); }
.nav-tabs .nav-link { border-radius: 0; color: var(--muted); }
.nav-tabs .nav-link.active,
.nav-tabs .nav-item.show .nav-link { color: var(--ink); border-color: var(--line) var(--line) var(--surface); }
.nav-tabs-custom .nav-item .nav-link::after { background: var(--primary) !important; }
.nav-tabs-custom .nav-item .nav-link.active { color: var(--ink) !important; }
.nav-pills .nav-link { border-radius: 0; }
.nav-pills .nav-link.active, .nav-pills .show > .nav-link { background: var(--primary); }

.badge { border-radius: 0; padding: 2px 6px; line-height: 16px; }
.badge-primary { background: var(--primary); }
.badge-success { background: var(--success); }
.badge-warning { background: var(--warning); color: var(--ink); }
.badge-danger { background: var(--danger); }

.modal-content { border: 1px solid var(--ink); border-radius: 0; box-shadow: none; }
.modal-header, .modal-footer { border-color: var(--line); }
.modal-title { font-family: var(--px-font), var(--sys-font); font-size: 24px; line-height: 28px; font-weight: 400; }

.dropdown-menu {
  border: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  padding: 4px;
  min-width: 192px;
}
.dropdown-item { padding: 8px 12px; color: var(--ink); font-size: 14px; }
.dropdown-item:hover, .dropdown-item:focus { background: var(--bg); color: var(--ink); }
.dropdown-item.active, .dropdown-item:active { background: var(--accent-bg); color: var(--primary); }
.dropdown-item.px-sub { padding-left: 24px; }
.dropdown-header { color: var(--muted); padding: 8px 12px 4px; }
.dropdown-divider { border-color: var(--line); margin: 4px 0; }

.pagination .page-link,
.pagination .page-item .page-link {
  border-radius: 0 !important;
  border-color: var(--line);
  color: var(--ink);
  margin: 0 2px;
}
.pagination .page-item.active .page-link { background: var(--ink); border-color: var(--ink); color: #fff; }

#toast-container > div,
#toast-container .toast {
  border-radius: 0 !important;
  box-shadow: none !important;
  opacity: 1;
  border: 1px solid var(--ink);
}
#toast-container > .toast-success { background-color: var(--primary); }
#toast-container > .toast-error { background-color: var(--danger); }
#toast-container > .toast-warning { background-color: var(--warning); color: var(--ink); }

.no-data { color: var(--muted); }
.table-footer { flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.table-footer select { border: 1px solid var(--line); border-radius: 0; background: var(--surface); }

/* ---------- pixel elements ---------- */
.px-card {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 24px;
  margin-bottom: 24px;
}
.px-card-accent { background: var(--accent-bg); border-color: var(--primary); }
.px-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.px-card-title { color: var(--ink); }
.px-card-divider { border-top: 1px dashed var(--primary); margin: 16px 0 12px; }
.px-link { color: var(--primary); white-space: nowrap; }

.px-pill {
  display: inline-block;
  padding: 0 8px;
  line-height: 20px;
  border: 1px solid currentColor;
  white-space: nowrap;
}
.px-pill-success { color: var(--success); background: #E8F6EF; }
.px-pill-warning { color: #9A6110; background: #FDF3E3; border-color: var(--warning); }
.px-pill-danger { color: var(--danger); background: #FBEAEA; }
.px-pill-muted { color: var(--muted); background: var(--bg); }

.px-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--line);
  margin: 0 -24px;
  padding: 0 24px;
}
.px-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.px-tabs button:hover { color: var(--ink); }
.px-tabs button.active { color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); }
.px-tabs button:focus { outline: 0; }

/* dashboard */
.px-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.px-hero h1 { margin: 0; }
.px-hero-meta { text-align: right; }
.px-stat { display: flex; align-items: flex-end; gap: 16px; }
.px-stat-label { padding-bottom: 2px; }
.px-stat-label .px-muted { font-size: 12px; }
.px-balance {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}
.px-balance .px-num-xl { overflow-wrap: anywhere; }
.px-kv { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
.px-kv span:first-child { color: var(--muted); }

.px-todo-list, .px-news { list-style: none; padding: 0; margin: 0; }
.px-todo-item a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}
.px-todo-item:last-of-type a { border-bottom: 0; }
.px-todo-item a:hover { color: var(--primary); }
.px-todo-empty { padding: 12px 0; color: var(--muted); }
.px-todo-item ~ .px-todo-empty { display: none; }

.px-news li {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
}
.px-news li:last-child { border-bottom: 0; }
.px-news li a { color: var(--ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.px-news li a:hover { color: var(--primary); }
.px-news li .px-num { flex: 0 0 auto; }
.px-news .no-data { min-height: 96px; }

.px-table-wrap { margin: 0 -24px; width: auto; }
.px-host-table th:first-child, .px-host-table td:first-child { padding-left: 24px; }
.px-host-table th:last-child, .px-host-table td:last-child { padding-right: 24px; }
.px-host-table td { padding-top: 16px; padding-bottom: 16px; }
.px-host-table th.pointer { cursor: pointer; }
.px-host-name { color: var(--ink); font-weight: 600; }
.px-host-name:hover { color: var(--primary); }
.px-arrow { font-family: var(--px-font), var(--sys-font); color: var(--muted); }
.px-arrow:hover { color: var(--primary); }
.px-loading { padding: 48px 0; text-align: center; color: var(--muted); }

/* ---------- auth pages ---------- */
.px-auth-page { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.px-auth-extra { text-align: center; padding: 8px 16px; }
.px-auth { flex: 1 1 auto; display: flex; min-height: 100vh; }
.px-auth-brand {
  position: relative;
  flex: 0 0 44%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 48px;
  padding: 48px;
  color: #fff;
  background-color: var(--ink);
  background-image:
    linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: center;
  overflow: hidden;
}
.px-auth-brand[style] { background-size: cover; }
.px-auth-brand[style]::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(17, 17, 17, .55);
}
.px-auth-brand > * { position: relative; }
.px-auth-company { display: flex; align-items: center; gap: 12px; font-size: 24px; line-height: 28px; }
.px-auth-mark { width: 38px; height: 18px; image-rendering: pixelated; }
.px-auth-hero h1 { color: #fff; margin: 0 0 16px; overflow-wrap: anywhere; }
.px-auth-brand .px-dot { color: #5BD08F; }
.px-auth-desc { color: rgba(255, 255, 255, .72); max-width: 420px; margin: 0; }
.px-auth-main {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 88px 24px 48px;
}
.px-auth-tools { position: absolute; top: 24px; right: 24px; }
.px-auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 32px;
}
.px-auth .logo.text-center { margin-bottom: 24px; }
.px-auth .logo.text-center img { height: 32px; max-width: 100%; image-rendering: pixelated; }
.px-auth .input-group-prepend { width: 100px; }
.px-auth .allow_login_code_captcha { display: none; }
.px-auth .list-inline-item .icon { width: 2rem; height: 2rem; }
.px-auth .social-list-item { border: none; }
.px-auth .form-control, .px-auth .input-group-append { height: 46px; }
.px-auth .btn-block.btn-primary { min-height: 46px; }
.px-auth .nav-tabs-custom { border-bottom: 1px solid var(--line); }

@media (max-width: 991.98px) {
  .px-auth { flex-direction: column; min-height: 0; }
  .px-auth-brand {
    flex: 0 0 120px;
    min-height: 120px;
    gap: 8px;
    padding: 24px;
    justify-content: center;
  }
  .px-auth-company { font-size: 12px; line-height: 16px; }
  .px-auth-hero h1 { font-size: 36px; line-height: 36px; margin: 0; }
  .px-auth-desc { display: none; }
  .px-auth-main { justify-content: flex-start; padding: 24px 16px 48px; }
  .px-auth-tools { position: static; align-self: flex-end; margin-bottom: 16px; }
  .px-auth-card { padding: 24px; }
}

/* ---------- cart pages ---------- */
.secondbox .active, .prolist .active { color: var(--primary); }
.goods_info .title { color: var(--ink); }
.cycle-select-discount { border-radius: 0; }
.btn-radio-bill.active { background: var(--primary) !important; border-color: var(--primary) !important; color: #fff !important; }
.configoption_total { border: 1px solid var(--line); }
.mobile-bottom-total { border-top: 1px solid var(--line); box-shadow: none; }

/* ---------- small screens ---------- */
@media (max-width: 575.98px) {
  h1, .px-display, .px-num-xl { font-size: 36px; line-height: 36px; }
  .px-hero { flex-direction: column; align-items: flex-start; }
  .px-hero-meta { text-align: left; }
  .px-card { padding: 16px; }
  .px-tabs { margin: 0 -16px; padding: 0 16px; }
  .px-table-wrap { margin: 0 -16px; }
  .px-host-table th:first-child, .px-host-table td:first-child { padding-left: 16px; }
  .px-host-table th:last-child, .px-host-table td:last-child { padding-right: 16px; }
  .px-card-head { flex-wrap: wrap; }
}
