:root {
  --bg: #111217;
  --panel: #1c1d28;
  --panel-soft: #202131;
  --line: #34364c;
  --text: #eeeeee;
  --muted: #b7b5c3;
  --cyan: #39c9dc;
  --coral: #ff5a47;
  --orange: #ff8b2b;
  --yellow: #f2c94c;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Trebuchet MS", "Avenir Next", "Noto Sans TC", sans-serif;
  font-size: 18px;
  line-height: 1.55;
}

body::before {
  display: block;
  height: 8px;
  background: linear-gradient(90deg, var(--coral) 0 33%, var(--orange) 33% 66%, var(--yellow) 66%);
  content: "";
}

button,
input {
  font: inherit;
}

a {
  color: var(--cyan);
  text-decoration: none;
}

a:hover {
  color: var(--yellow);
}

.site-shell {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 40px;
  width: min(1780px, calc(100% - 56px));
  margin: 0 auto;
  padding: 48px 0 72px;
}

.topbar {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: start;
  gap: 52px;
}

.brand {
  justify-self: start;
  color: var(--coral);
  font-size: clamp(42px, 5vw, 74px);
  font-weight: 900;
  line-height: 0.9;
  text-decoration: none;
}

.brand:hover {
  color: var(--coral);
}

.brand-mark {
  display: inline-grid;
  width: 44px;
  height: 44px;
  margin-right: -5px;
  place-items: center;
  border: 3px solid var(--text);
  border-radius: 50%;
  background: var(--cyan);
  vertical-align: middle;
}

.brand-mark::before {
  color: var(--bg);
  content: "E";
  font-size: 24px;
  font-weight: 900;
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 12px;
  padding: 12px 18px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}

.nav-list a {
  color: var(--cyan);
  font-size: clamp(22px, 2vw, 34px);
  line-height: 1;
}

.nav-list a:first-child::before {
  display: inline-grid;
  width: 42px;
  height: 42px;
  margin-right: 10px;
  place-items: center;
  border-radius: 9px;
  background: var(--cyan);
  color: var(--panel);
  content: "⌂";
  font-size: 24px;
}

.topbar-actions,
.showcase,
.stats {
  display: none;
}

.sidebar {
  grid-column: 1;
  color: var(--text);
}

.sidebar section {
  margin-bottom: 34px;
}

.sidebar h2,
.database h2,
.notes h2,
.quick-zones h2,
.news-head h2 {
  margin: 0 0 18px;
  color: var(--cyan);
  font-size: clamp(30px, 3vw, 44px);
  line-height: 1;
}

.sidebar h2::after,
.database h2::after,
.notes h2::after,
.quick-zones h2::after,
.news-head h2::after {
  display: block;
  height: 4px;
  margin-top: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--coral), var(--orange), var(--yellow));
  content: "";
}

.sidebar p {
  color: var(--text);
}

.sidebar ul {
  display: grid;
  gap: 11px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sidebar li::before {
  margin-right: 12px;
  color: var(--coral);
  content: "✹";
}

main {
  grid-column: 2;
  min-width: 0;
}

section {
  margin-top: 28px;
}

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

h1 {
  margin-bottom: 16px;
  color: var(--coral);
  font-size: clamp(46px, 6vw, 78px);
  line-height: 0.96;
}

h3 {
  margin-bottom: 10px;
  color: var(--cyan);
  font-size: 28px;
  line-height: 1.1;
}

h4 {
  margin-bottom: 8px;
  color: var(--cyan);
  font-size: 22px;
}

p {
  margin-bottom: 14px;
}

.eyebrow,
.news-date {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero,
.quick-zones,
.news-section,
.database,
.notes {
  padding: clamp(22px, 3vw, 34px);
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.hero {
  margin-top: 0;
}

.hero-copy p:last-child,
.hero-side p,
.zone-card p,
.news-article-body p,
.notes p,
.record p {
  color: var(--muted);
}

.hero-side {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 4px solid transparent;
  border-image: linear-gradient(90deg, var(--coral), var(--orange), var(--yellow)) 1;
}

.app-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 18px;
}

.section-subhead {
  margin-top: 30px;
}

.app-icon-card {
  width: 112px;
  text-align: center;
}

.app-icon-card a {
  display: block;
}

.app-icon-card img {
  display: block;
  width: 92px;
  height: 92px;
  margin: 0 auto 10px;
  border-radius: 22px;
  object-fit: cover;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.38);
}

.app-icon-card p {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
}

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

.zone-card {
  min-width: 0;
}

.tool-links {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.tool-link {
  padding-bottom: 8px;
  border-bottom: 3px solid transparent;
  border-image: linear-gradient(90deg, var(--coral), var(--orange), var(--yellow)) 1;
  font-size: 20px;
}

.news-head {
  margin-bottom: 20px;
}

.news-article {
  padding-top: 20px;
  border-top: 3px solid rgba(255, 255, 255, 0.04);
}

.news-article h3 {
  color: var(--text);
}

.news-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.news-version {
  max-height: 520px;
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
}

.news-version p {
  font-size: 16px;
}

.database-head {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1fr);
  gap: 22px;
  align-items: end;
  margin-bottom: 20px;
}

.toolbar {
  display: grid;
  gap: 12px;
}

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 14px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: #323145;
}

.search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.segmented button {
  min-height: 38px;
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--cyan);
  cursor: pointer;
}

.segmented button.active {
  background: var(--cyan);
  color: var(--panel);
}

.records {
  display: grid;
  gap: 18px;
}

.record {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 3px dotted rgba(57, 201, 220, 0.55);
}

.thumb {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 9px;
  background: var(--coral);
  color: var(--panel);
  font-weight: 900;
}

.record-meta,
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
  font-size: 13px;
}

.pill {
  padding: 1px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
}

.tags .pill {
  color: var(--cyan);
}

.link-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--cyan);
}

.empty {
  color: var(--muted);
}

.hidden {
  display: none;
}

@media (max-width: 980px) {
  .site-shell,
  .topbar,
  .quick-zones,
  .news-columns,
  .database-head,
  .record {
    grid-template-columns: 1fr;
  }

  .site-shell {
    width: min(100% - 28px, 760px);
    gap: 24px;
    padding-top: 28px;
  }

  .topbar,
  .sidebar,
  main {
    grid-column: 1;
  }

  .brand {
    justify-self: start;
  }

  .nav-list a {
    font-size: 22px;
  }
}
