:root {
  color: #1a2421;
  background: #f4f1e9;
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui,
    -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 280px;
  min-height: 100%;
  background: #f4f1e9;
}

body {
  min-height: 100dvh;
  margin: 0;
  background:
    radial-gradient(circle at 10% 5%, rgb(27 112 93 / 13%), transparent 29rem),
    radial-gradient(circle at 93% 91%, rgb(180 128 54 / 10%), transparent 25rem),
    #f4f1e9;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.portal-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 100dvh;
}

.portal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100% - 40px, 1120px);
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 0 14px;
}

.portal-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgb(20 73 61 / 16%);
  border-radius: 13px;
  color: #f9fffc;
  background: #185f51;
  box-shadow: 0 7px 18px rgb(24 95 81 / 14%);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.06em;
}

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

.brand-copy strong {
  font-size: 0.94rem;
  letter-spacing: 0.015em;
}

.brand-copy small {
  margin-top: 2px;
  color: #73807c;
  font-size: 0.7rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.language-switcher {
  display: inline-flex;
  height: 34px;
  align-items: center;
  padding: 2px;
  border: 1px solid rgb(29 66 57 / 9%);
  border-radius: 999px;
  color: #7b8581;
  background: rgb(255 255 255 / 28%);
  opacity: 0.78;
  transition: border-color 140ms ease, background 140ms ease, opacity 140ms ease;
}

.language-switcher:hover,
.language-switcher:focus-within {
  border-color: rgb(29 66 57 / 15%);
  background: rgb(255 255 255 / 52%);
  opacity: 1;
}

.language-switcher button {
  height: 28px;
  padding: 0 8px;
  border: 0;
  border-radius: 999px;
  color: inherit;
  background: transparent;
  font-size: 0.67rem;
  font-weight: 680;
  line-height: 1;
  cursor: pointer;
}

.language-switcher button.is-active {
  color: #1b5f51;
  background: rgb(24 95 81 / 9%);
}

.language-switcher > span {
  color: #a6aeab;
  font-size: 0.58rem;
}

.admin-access {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 50%;
  color: #7b8581;
  background: transparent;
  font-size: 0.75rem;
  letter-spacing: 0.11em;
  cursor: pointer;
  opacity: 0.62;
  transition: color 140ms ease, background 140ms ease, border-color 140ms ease, opacity 140ms ease;
}

.admin-access:hover,
.admin-access:focus-visible {
  border-color: rgb(29 66 57 / 14%);
  color: #263c36;
  background: rgb(255 255 255 / 50%);
  opacity: 1;
}

.admin-access:focus-visible,
.language-switcher button:focus-visible,
.feature-card:focus-visible,
.dialog-close:focus-visible,
.login-submit:focus-visible,
.admin-login input:focus-visible {
  outline: 3px solid rgb(31 126 105 / 24%);
  outline-offset: 3px;
}

.portal-main {
  display: grid;
  place-items: center;
  width: 100%;
  padding: clamp(36px, 8vh, 92px) 20px;
}

.portal-intro {
  width: min(100%, 740px);
  text-align: center;
}

.eyebrow,
.dialog-eyebrow {
  margin: 0;
  color: #1c6959;
  font-size: 0.69rem;
  font-weight: 820;
  letter-spacing: 0.18em;
}

.portal-intro h1 {
  margin: 13px 0 0;
  font-family: "Noto Serif CJK SC", "Songti SC", STSong, serif;
  font-size: clamp(2.1rem, 7vw, 4.2rem);
  font-weight: 720;
  letter-spacing: -0.025em;
  line-height: 1.12;
}

.intro-copy {
  max-width: 620px;
  margin: 20px auto 0;
  color: #64716d;
  font-size: clamp(0.93rem, 2vw, 1.03rem);
  line-height: 1.8;
}

.feature-grid {
  display: grid;
  width: min(100%, 620px);
  margin: clamp(34px, 7vh, 60px) auto 0;
}

.feature-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  min-height: 154px;
  padding: clamp(22px, 4vw, 30px);
  overflow: hidden;
  border: 1px solid rgb(18 80 67 / 13%);
  border-radius: 24px;
  color: #182620;
  background:
    linear-gradient(120deg, rgb(255 255 255 / 96%), rgb(235 247 241 / 93%)),
    #fff;
  box-shadow: 0 22px 64px rgb(41 58 51 / 11%);
  text-align: left;
  text-decoration: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.feature-card::after {
  position: absolute;
  right: -50px;
  bottom: -80px;
  width: 190px;
  height: 190px;
  border: 30px solid rgb(24 105 87 / 5%);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.feature-card:hover {
  border-color: rgb(21 103 84 / 24%);
  box-shadow: 0 25px 70px rgb(35 62 53 / 15%);
  transform: translateY(-3px);
}

.feature-icon {
  display: flex;
  width: 58px;
  height: 58px;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 15px 13px;
  border-radius: 18px;
  background: #196d5b;
  box-shadow: 0 10px 24px rgb(25 109 91 / 22%);
}

.feature-icon span {
  display: block;
  height: 3px;
  border-radius: 999px;
  background: #dff5ee;
}

.feature-icon span:nth-child(2) {
  width: 72%;
}

.feature-icon span:nth-child(3) {
  width: 46%;
}

.feature-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.feature-state {
  align-self: flex-start;
  margin-bottom: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  color: #176451;
  background: rgb(27 116 96 / 10%);
  font-size: 0.66rem;
  font-weight: 760;
  letter-spacing: 0.05em;
}

.feature-copy strong {
  font-size: 1.28rem;
}

.feature-copy > span:last-child {
  margin-top: 7px;
  color: #65736e;
  font-size: 0.82rem;
  line-height: 1.6;
}

.feature-action {
  position: relative;
  z-index: 1;
  color: #155e4f;
  font-size: 0.83rem;
  font-weight: 760;
  white-space: nowrap;
}

.feature-action > span[aria-hidden="true"] {
  display: inline-block;
  margin-left: 4px;
  transition: transform 150ms ease;
}

.feature-card:hover .feature-action > span[aria-hidden="true"] {
  transform: translateX(3px);
}

.future-note {
  margin: 22px 0 0;
  color: #89928f;
  font-size: 0.76rem;
}

.portal-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px max(20px, env(safe-area-inset-bottom));
  color: #8b9491;
  font-size: 0.7rem;
}

.filing-link {
  color: inherit;
  text-underline-offset: 3px;
}

.filing-link:hover,
.filing-link:focus-visible {
  color: #56615d;
}

.admin-dialog {
  width: min(calc(100% - 32px), 410px);
  padding: 0;
  border: 0;
  border-radius: 20px;
  color: #1a2421;
  background: #fffdf8;
  box-shadow: 0 28px 90px rgb(13 28 23 / 28%);
}

.admin-dialog::backdrop {
  background: rgb(16 27 23 / 44%);
  backdrop-filter: blur(3px);
}

.admin-login {
  padding: 26px;
}

.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.dialog-heading h2 {
  margin: 5px 0 0;
  font-size: 1.28rem;
}

.dialog-close {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 10px;
  color: #68736f;
  background: #f0f1ed;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.dialog-copy {
  margin: 19px 0 18px;
  color: #69746f;
  font-size: 0.86rem;
  line-height: 1.6;
}

.admin-login label {
  display: block;
  margin-bottom: 7px;
  color: #35423d;
  font-size: 0.78rem;
  font-weight: 700;
}

.admin-login input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #ccd3cf;
  border-radius: 11px;
  outline: none;
  color: #1a2421;
  background: #fff;
}

.admin-login input:focus {
  border-color: #4b9b88;
}

.admin-login input[aria-invalid="true"] {
  border-color: #a33d3d;
}

.login-message {
  min-height: 1.5em;
  margin: 7px 0 9px;
  color: #a33d3d;
  font-size: 0.75rem;
  line-height: 1.5;
}

.login-submit {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 11px;
  color: #fff;
  background: #196d5b;
  font-weight: 740;
  cursor: pointer;
}

.login-submit:hover:not(:disabled) {
  background: #105a4b;
}

.login-submit:disabled {
  cursor: wait;
  opacity: 0.65;
}

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

noscript {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: calc(100% - 36px);
  padding: 9px 12px;
  border-radius: 9px;
  color: #5f491d;
  background: #fff1c8;
  font-size: 0.75rem;
}

@media (max-width: 600px) {
  .portal-header {
    width: calc(100% - 28px);
  }

  .portal-main {
    align-items: start;
    padding: clamp(42px, 9vh, 76px) 14px 36px;
  }

  .portal-intro h1 {
    max-width: 10em;
    margin-right: auto;
    margin-left: auto;
  }

  .intro-copy {
    max-width: 32em;
  }

  .feature-card {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 14px;
    min-height: 0;
    padding: 20px;
    border-radius: 20px;
  }

  .feature-icon {
    width: 49px;
    height: 49px;
    padding: 13px 11px;
    border-radius: 15px;
  }

  .feature-action {
    grid-column: 2;
  }

  .admin-login {
    padding: 22px;
  }
}

@media (max-width: 360px) {
  .brand-copy small {
    display: none;
  }

  .feature-card {
    grid-template-columns: 1fr;
  }

  .feature-icon {
    display: none;
  }

  .feature-action {
    grid-column: 1;
  }
}

@media (max-width: 320px) {
  .brand-copy {
    display: none;
  }

  .language-switcher button {
    padding-right: 6px;
    padding-left: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
