:root {
  color-scheme: dark;
  --bg: #030913;
  --bg-2: #071827;
  --panel: rgba(7, 25, 39, 0.72);
  --panel-strong: rgba(10, 38, 57, 0.88);
  --line: rgba(84, 232, 255, 0.24);
  --line-strong: rgba(91, 244, 255, 0.68);
  --cyan: #57e8ff;
  --teal: #23f4bd;
  --green: #6dffb4;
  --ink: #e9fbff;
  --muted: #89aeba;
  --warning: #ffd166;
  --shadow: 0 0 34px rgba(35, 244, 189, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(35, 244, 189, 0.14), transparent 32%),
    radial-gradient(circle at 80% 10%, rgba(87, 232, 255, 0.14), transparent 36%),
    linear-gradient(135deg, var(--bg), var(--bg-2) 52%, #02060d);
  color: var(--ink);
  font-family: "Microsoft JhengHei", "Noto Sans TC", system-ui, sans-serif;
  line-height: 1.55;
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  background: linear-gradient(180deg, transparent 0%, rgba(87, 232, 255, 0.05) 50%, transparent 100%);
  animation: scan 7s linear infinite;
  opacity: 0.55;
  z-index: 0;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.holo-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(87, 232, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(87, 232, 255, 0.07) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent 78%);
  z-index: 0;
}

.site-header,
.app-shell,
.site-footer {
  position: relative;
  z-index: 1;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 42px);
  border-bottom: 1px solid var(--line);
  background: rgba(3, 9, 19, 0.82);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-core {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(87, 232, 255, 0.26), rgba(35, 244, 189, 0.08));
  box-shadow: 0 0 22px rgba(87, 232, 255, 0.28);
  color: var(--cyan);
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 15px;
  letter-spacing: 0;
}

.brand small,
.system-nav a,
.status-line,
.panel-heading span,
#systemReadout,
.site-footer {
  color: var(--muted);
  font-size: 12px;
}

.system-nav {
  display: flex;
  gap: 8px;
}

.system-nav a,
.whatsapp-button,
.pdf-link,
#submitSearchButton,
#clearSearchButton {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  white-space: nowrap;
}

.system-nav a {
  padding: 8px 12px;
  background: rgba(7, 25, 39, 0.56);
}

.system-nav a:hover {
  border-color: var(--line-strong);
  color: var(--cyan);
}

.app-shell {
  width: min(1220px, 100%);
  margin: 0 auto;
  padding: 28px clamp(14px, 4vw, 28px) 52px;
}

.command-center {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: clamp(18px, 4vw, 44px);
  align-items: end;
  min-height: 330px;
  padding: 36px 0 24px;
}

.status-line {
  display: inline-flex;
  margin-bottom: 12px;
  color: var(--teal);
  letter-spacing: 0.12em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 720px;
  margin-bottom: 14px;
  color: var(--ink);
  font-size: clamp(38px, 6vw, 72px);
  line-height: 1.03;
  letter-spacing: 0;
  text-shadow: 0 0 26px rgba(87, 232, 255, 0.2);
}

.hero-copy p,
.panel-heading p,
.brand-summary,
.catalogue-description,
.contact-strip p {
  color: var(--muted);
}

.hero-copy p {
  max-width: 690px;
  margin-bottom: 0;
  font-size: 17px;
}

.command-panel,
.holo-panel,
.contact-strip,
.category-card,
.brand-card,
.catalogue-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(8, 27, 43, 0.82), rgba(6, 18, 31, 0.62));
  box-shadow: var(--shadow);
}

.command-panel::before,
.holo-panel::before,
.category-card::before,
.brand-card::before,
.catalogue-card::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background: linear-gradient(120deg, transparent, rgba(87, 232, 255, 0.13), transparent);
  transform: translateX(-120%);
  transition: transform 520ms ease;
}

.category-card:hover::before,
.brand-card:hover::before,
.catalogue-card:hover::before,
.command-panel:hover::before {
  transform: translateX(120%);
}

.command-panel {
  display: grid;
  gap: 12px;
  border-radius: 10px;
  padding: 20px;
}

.command-panel label {
  color: var(--cyan);
  font-size: 13px;
  font-weight: 700;
}

.command-input {
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.24);
  box-shadow: inset 0 0 20px rgba(87, 232, 255, 0.08);
}

.command-input span {
  color: var(--teal);
  font-size: 22px;
}

#catalogSearch {
  appearance: none;
  -webkit-appearance: none;
  min-height: 42px;
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  caret-color: var(--teal);
  font-family: "Microsoft JhengHei", "Noto Sans TC", system-ui, sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
  outline: 0;
}

#catalogSearch::placeholder {
  color: rgba(137, 174, 186, 0.84);
  font-weight: 500;
}

#catalogSearch::-webkit-search-decoration,
#catalogSearch::-webkit-search-cancel-button,
#catalogSearch::-webkit-search-results-button,
#catalogSearch::-webkit-search-results-decoration {
  display: none;
}

#submitSearchButton,
#clearSearchButton {
  background: rgba(87, 232, 255, 0.08);
  color: var(--cyan);
  padding: 0 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}

#submitSearchButton {
  border-color: rgba(35, 244, 189, 0.62);
  background: linear-gradient(135deg, rgba(35, 244, 189, 0.22), rgba(87, 232, 255, 0.12));
  color: var(--ink);
}

#submitSearchButton:hover,
#clearSearchButton:hover {
  border-color: var(--line-strong);
  box-shadow: 0 0 18px rgba(87, 232, 255, 0.22);
}

.category-console {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 8px 0 18px;
}

.mobile-trail {
  display: none;
}

.category-card {
  min-height: 150px;
  border-radius: 10px;
  padding: 16px;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.category-card.active {
  border-color: var(--teal);
  background: linear-gradient(145deg, rgba(13, 60, 73, 0.9), rgba(8, 30, 44, 0.76));
  box-shadow: 0 0 34px rgba(35, 244, 189, 0.28);
}

.category-icon {
  display: grid;
  width: 44px;
  height: 44px;
  margin-bottom: 16px;
  place-items: center;
  border: 1px solid rgba(87, 232, 255, 0.38);
  border-radius: 8px;
  color: var(--green);
}

.category-icon svg {
  width: 25px;
  height: 25px;
}

.category-card h3 {
  margin-bottom: 4px;
  font-size: 18px;
  line-height: 1.28;
}

.category-card p {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.28;
}

.module-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--cyan);
  font-size: 12px;
}

.data-panels {
  display: grid;
  grid-template-columns: minmax(300px, 0.85fr) minmax(0, 1.15fr);
  gap: 16px;
}

.holo-panel {
  min-height: 380px;
  border-radius: 10px;
  padding: 18px;
}

.panel-heading {
  margin-bottom: 16px;
}

.panel-heading span {
  color: var(--teal);
  letter-spacing: 0.12em;
}

.panel-heading h2 {
  margin: 5px 0 6px;
  font-size: 25px;
}

.brand-list,
.catalogue-list {
  display: grid;
  gap: 10px;
}

.catalogue-group {
  display: grid;
  gap: 4px;
  padding: 8px 2px 2px;
}

.catalogue-group h3 {
  color: var(--cyan);
  font-size: 14px;
  letter-spacing: 0;
}

.catalogue-group p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.brand-card {
  display: grid;
  grid-template-columns: 116px 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 92px;
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.brand-card.active {
  border-color: var(--line-strong);
  background: rgba(87, 232, 255, 0.1);
}

.brand-mark {
  display: grid;
  width: 116px;
  height: 58px;
  place-items: center;
  border: 1px solid rgba(87, 232, 255, 0.36);
  border-radius: 10px;
  background: rgba(35, 244, 189, 0.08);
  color: var(--teal);
  overflow: hidden;
}

.brand-mark img {
  display: block;
  max-width: 96px;
  max-height: 40px;
  object-fit: contain;
}

.brand-mark.wordmark,
.brand-mark.placeholder {
  padding: 8px;
  color: var(--ink);
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  text-transform: uppercase;
  word-break: break-word;
}

.brand-mark.wordmark {
  font-size: 14px;
}

.brand-mark.placeholder {
  border-style: dashed;
  color: var(--cyan);
  font-size: 18px;
  letter-spacing: 0.08em;
}

.brand-card h3 {
  margin-bottom: 3px;
  font-size: 18px;
}

.brand-summary {
  margin-bottom: 0;
  font-size: 13px;
}

.catalogue-count {
  color: var(--cyan);
  font-size: 12px;
}

.catalogue-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: start;
  border-radius: 8px;
  padding: 15px;
}

.catalogue-card h3 {
  margin-bottom: 7px;
  font-size: 19px;
}

.catalogue-type {
  display: inline-flex;
  margin-bottom: 8px;
  border: 1px solid rgba(87, 232, 255, 0.28);
  border-radius: 999px;
  padding: 3px 8px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
}

.catalogue-card.technical {
  background: linear-gradient(145deg, rgba(31, 29, 51, 0.82), rgba(6, 18, 31, 0.62));
}

.catalogue-description {
  margin-bottom: 0;
  font-size: 14px;
}

.catalogue-actions {
  display: grid;
  gap: 8px;
  min-width: 112px;
}

.pdf-link,
.whatsapp-button {
  border-color: rgba(35, 244, 189, 0.62);
  background: linear-gradient(135deg, rgba(35, 244, 189, 0.22), rgba(87, 232, 255, 0.12));
  color: var(--ink);
  font-weight: 700;
}

.pdf-link {
  padding: 10px 12px;
}

.pdf-link.secondary {
  border-color: rgba(87, 232, 255, 0.42);
  background: rgba(87, 232, 255, 0.08);
  color: var(--cyan);
}

.pdf-link.disabled {
  border-color: rgba(148, 163, 184, 0.34);
  background: rgba(148, 163, 184, 0.08);
  color: rgba(226, 232, 240, 0.72);
  cursor: default;
  box-shadow: none;
}

.pdf-link:hover,
.whatsapp-button:hover {
  border-color: var(--teal);
  box-shadow: 0 0 18px rgba(35, 244, 189, 0.26);
}

.pdf-link.disabled:hover {
  border-color: rgba(148, 163, 184, 0.34);
  box-shadow: none;
}

.empty-state {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
}

.contact-strip {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
  margin-top: 18px;
  border-radius: 10px;
  padding: 20px;
}

.contact-strip h2 {
  margin-bottom: 6px;
}

.contact-strip p {
  margin-bottom: 0;
}

.whatsapp-button {
  min-height: 46px;
  padding: 10px 16px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 18px clamp(16px, 4vw, 42px);
  border-top: 1px solid var(--line);
}

@keyframes scan {
  from {
    transform: translateY(-110%);
  }
  to {
    transform: translateY(110%);
  }
}

@media (max-width: 940px) {
  .command-center,
  .data-panels,
  .contact-strip {
    grid-template-columns: 1fr;
  }

  .category-console {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  html {
    scroll-behavior: auto;
  }

  .site-header,
  .site-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .site-header {
    position: relative;
  }

  .system-nav {
    display: none;
  }

  .app-shell {
    padding-top: 16px;
  }

  .command-center {
    min-height: auto;
    padding-top: 20px;
  }

  .mobile-trail {
    position: sticky;
    top: 0;
    z-index: 15;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px;
    background: rgba(3, 9, 19, 0.9);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
  }

  .mobile-trail button {
    min-height: 38px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    padding: 0 12px;
    background: rgba(87, 232, 255, 0.08);
    color: var(--cyan);
  }

  .mobile-trail button[hidden] {
    display: none;
  }

  .mobile-trail span {
    display: block;
    color: var(--teal);
    font-size: 11px;
    letter-spacing: 0.12em;
  }

  .mobile-trail strong {
    display: block;
    font-size: 15px;
    line-height: 1.25;
  }

  h1 {
    font-size: 38px;
  }

  .hero-copy p {
    font-size: 15px;
  }

  .command-input,
  .brand-card,
  .catalogue-card {
    grid-template-columns: 1fr;
  }

  .command-input {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    min-height: 0;
    padding: 12px;
  }

  .command-input span {
    display: none;
  }

  #catalogSearch {
    grid-column: 1 / -1;
    min-height: 50px;
    border: 1px solid rgba(87, 232, 255, 0.28);
    border-radius: 8px;
    padding: 0 12px;
    background: rgba(87, 232, 255, 0.06);
    font-size: 16px;
  }

  #submitSearchButton,
  #clearSearchButton {
    width: 100%;
    min-height: 46px;
  }

  .category-console {
    grid-template-columns: 1fr;
  }

  .category-card {
    min-height: 104px;
  }

  .category-card h3 {
    font-size: 20px;
  }

  .category-card p {
    font-size: 20px;
    color: var(--muted);
  }

  .category-card p {
    margin-bottom: 8px;
  }

  .brand-card {
    grid-template-columns: 108px 1fr;
    min-height: 86px;
  }

  .brand-mark {
    width: 108px;
    height: 54px;
  }

  .brand-mark.wordmark {
    font-size: 18px;
  }

  .brand-mark.placeholder {
    font-size: 22px;
  }

  .catalogue-count {
    grid-column: 2;
  }

  .brand-summary,
  .catalogue-description,
  .catalogue-group p {
    display: none;
  }

  .catalogue-card {
    gap: 12px;
    padding: 14px;
  }

  .catalogue-actions {
    min-width: 0;
    width: 100%;
  }

  .catalogue-card h3 {
    font-size: 17px;
  }

  body[data-mobile-view="categories"] .data-panels {
    display: none;
  }

  body[data-mobile-view="brands"] .command-center,
  body[data-mobile-view="catalogues"] .command-center {
    display: none;
  }

  body[data-mobile-view="brands"] .category-console,
  body[data-mobile-view="brands"] #cataloguePanel,
  body[data-mobile-view="catalogues"] .category-console,
  body[data-mobile-view="catalogues"] #brandPanel {
    display: none;
  }

  body[data-mobile-view="brands"] .data-panels,
  body[data-mobile-view="catalogues"] .data-panels {
    display: block;
  }

  .pdf-link {
    width: 100%;
  }
}
