:root {
  --primary: #0f2a44;
  --accent: #f97316;
  --background: #ffffff;
  --soft-bg: #f5f7fa;
  --text: #18324b;
  --muted: #5e7185;
  --border: #d8e0e8;
  --shadow: 0 18px 45px rgba(15, 42, 68, 0.08);
  --radius-md: 18px;
  --container: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Noto Sans Thai", "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  color: var(--text);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.container {
  width: min(calc(100% - 2rem), var(--container));
  margin: 0 auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(15, 42, 68, 0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 84px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
}

.brand-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid rgba(15, 42, 68, 0.08);
  box-shadow: var(--shadow);
  overflow: hidden;
  flex-shrink: 0;
}

.brand-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-copy {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 1rem;
  font-weight: 800;
}

.brand-subtitle {
  font-size: 0.82rem;
  color: var(--muted);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.main-nav a {
  font-weight: 600;
  color: var(--muted);
  transition: color 0.25s ease;
}

.main-nav a:hover,
.main-nav a:focus-visible {
  color: var(--accent);
}

.main-nav a[aria-current="page"] {
  color: var(--primary);
}

.menu-toggle {
  display: none;
  border: 0;
  background: transparent;
  padding: 0.25rem;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  border-radius: 99px;
  background: var(--primary);
}

.menu-toggle span + span {
  margin-top: 5px;
}

.section-label {
  margin: 0 0 0.85rem;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.section-heading h2 {
  margin: 0;
  line-height: 1.1;
  color: var(--primary);
  font-size: clamp(1.8rem, 3vw, 2.8rem);
}

.open-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0.85rem 1.4rem;
  border: 0;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 14px 26px rgba(15, 42, 68, 0.15);
}

.open-button:hover,
.open-button:focus-visible {
  background: var(--accent);
  transform: translateY(-2px);
}

.systems-section,
.announcement-section {
  padding: 2.5rem 0 4.5rem;
}

.internal-page {
  padding: 1rem 0 4.5rem;
}

.internal-hero {
  padding: 2rem 0 1rem;
}

.internal-title {
  margin: 0;
  color: var(--primary);
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.1;
}

.internal-description {
  max-width: 46rem;
  margin: 1rem 0 0;
  color: var(--muted);
  line-height: 1.75;
}

.internal-content {
  padding-top: 1.5rem;
}

.internal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.8fr);
  gap: 1.5rem;
  align-items: start;
}

.internal-panel {
  padding: 1.5rem;
  background: var(--background);
  border: 1px solid rgba(15, 42, 68, 0.08);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
}

.internal-panel-wide {
  min-width: 0;
}

.internal-heading {
  margin-bottom: 1.25rem;
}

.internal-panel-text {
  margin: 0 0 1.5rem;
  color: var(--muted);
  line-height: 1.75;
}

.systems-section-primary {
  padding-top: 2rem;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.8rem;
}

.search-box {
  min-width: min(100%, 320px);
}

.search-box input {
  width: 100%;
  min-height: 50px;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.search-box input:focus {
  border-color: rgba(15, 42, 68, 0.35);
  box-shadow: 0 0 0 4px rgba(15, 42, 68, 0.08);
}

.system-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.3rem;
}

.system-card,
.announcement-card {
  background: var(--background);
  border: 1px solid rgba(15, 42, 68, 0.08);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
}

.system-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.4rem;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.system-card:hover {
  transform: translateY(-4px);
  border-color: rgba(249, 115, 22, 0.28);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.system-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--soft-bg);
  color: var(--primary);
}

.system-icon svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.system-card h3,
.announcement-card h3 {
  margin: 0;
  color: var(--primary);
  font-size: 1.2rem;
}

.system-card p,
.announcement-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.open-button {
  margin-top: auto;
  width: fit-content;
}

.empty-state {
  margin: 1.5rem 0 0;
  text-align: center;
  color: var(--muted);
  font-weight: 600;
}

.announcement-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.3rem;
}

.download-list {
  display: grid;
  gap: 1rem;
}

.download-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.2rem;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
  border: 1px solid rgba(15, 42, 68, 0.08);
  border-radius: 16px;
}

.download-item-copy {
  min-width: 0;
}

.download-item h3 {
  margin: 0;
  color: var(--primary);
  font-size: 1rem;
  word-break: break-word;
}

.download-item p {
  margin: 0.45rem 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 124px;
  min-height: 48px;
  padding: 0.8rem 1.2rem;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  transition: transform 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 14px 26px rgba(15, 42, 68, 0.15);
}

.download-button:hover,
.download-button:focus-visible {
  background: var(--accent);
  transform: translateY(-2px);
}

.announcement-card {
  padding: 1.5rem;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
}

.announcement-tag {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0.35rem 0.8rem;
  margin-bottom: 1rem;
  border-radius: 999px;
  background: rgba(15, 42, 68, 0.08);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.accent-tag {
  background: rgba(249, 115, 22, 0.15);
  color: #c2410c;
}

.alert-card {
  border-color: rgba(249, 115, 22, 0.18);
}

.site-footer {
  border-top: 1px solid rgba(15, 42, 68, 0.08);
  background: #fff;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 0;
  color: var(--muted);
  font-size: 0.95rem;
}

@media (max-width: 980px) {
  .internal-grid,
  .system-grid,
  .announcement-list {
    grid-template-columns: 1fr 1fr;
  }

  .section-heading {
    flex-direction: column;
    align-items: stretch;
  }

  .search-box {
    min-width: 100%;
  }
}

@media (max-width: 760px) {
  .menu-toggle {
    display: inline-block;
  }

  .main-nav {
    position: absolute;
    top: calc(100% + 1px);
    right: 1rem;
    left: 1rem;
    display: none;
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem;
    background: #fff;
    border: 1px solid rgba(15, 42, 68, 0.08);
    border-radius: 18px;
    box-shadow: var(--shadow);
  }

  .main-nav.is-open {
    display: flex;
  }

  .internal-grid,
  .system-grid,
  .announcement-list {
    grid-template-columns: 1fr;
  }

  .download-item {
    flex-direction: column;
    align-items: stretch;
  }

  .download-button,
  .disabled-service-button {
    width: 100%;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 540px) {
  .container {
    width: min(calc(100% - 1.25rem), var(--container));
  }

  .header-inner {
    min-height: 76px;
  }

  .brand-mark {
    width: 46px;
    height: 46px;
  }

  .system-card,
  .announcement-card {
    padding: 1.2rem;
  }

  .open-button,
  .download-button,
  .search-box input {
    width: 100%;
  }
}
