:root {
  color-scheme: light;
  --body-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display-font: "Old Standard TT", Georgia, serif;
  --background: #fcfcfc;
  --surface: #ffffff;
  --heading: #111111;
  --text: #353941;
  --muted: #626773;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-active: #0049df;
  --required: #d9381e;
  --success: #4f8618;
  --success-bg: rgba(164, 229, 34, 0.18);
  --danger: #b42318;
  --danger-bg: #fff4f2;
  --border: rgba(17, 17, 17, 0.12);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

html[data-locale="zh"] {
  --body-font: "Inter", "Noto Sans SC", "PingFang SC", sans-serif;
  --display-font: "Old Standard TT", "Noto Serif SC", "Songti SC", serif;
}

html[data-locale="tw"] {
  --body-font: "Inter", "Noto Sans TC", "PingFang TC", sans-serif;
  --display-font: "Old Standard TT", "Noto Serif TC", "Songti TC", serif;
}

html[data-locale="ja"] {
  --body-font: "Inter", "Noto Sans JP", "Hiragino Kaku Gothic ProN", sans-serif;
  --display-font: "Old Standard TT", "Noto Serif JP", "Yu Mincho", serif;
}

html[data-locale="ko"] {
  --body-font: "Inter", "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
  --display-font: "Old Standard TT", "Noto Serif KR", serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  letter-spacing: 0;
}

html {
  min-width: 320px;
  background: var(--background);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background: var(--background);
  color: var(--text);
  font-family: var(--body-font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 200ms var(--ease);
}

a:hover {
  color: #375fd2;
}

a:active {
  color: var(--primary-active);
}

:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.26);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(17, 17, 17, 0.08);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
}

.nav-inner {
  width: 100%;
  max-width: 1264px;
  height: 64px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  color: var(--heading);
}

.brand {
  min-width: 0;
  gap: 10px;
}

.brand:hover,
.footer-brand:hover {
  color: var(--heading);
}

.brand img,
.footer-brand img {
  flex: 0 0 auto;
  border-radius: 50%;
}

.brand-name,
.footer-brand span {
  font-family: var(--display-font);
  font-weight: 700;
}

.brand-name {
  font-size: 18px;
}

.language-picker {
  position: relative;
  flex: 0 0 auto;
}

.language-trigger {
  min-height: 44px;
  padding: 7px 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(17, 17, 17, 0.1);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 200ms var(--ease), color 200ms var(--ease), background 200ms var(--ease);
}

.language-trigger:hover {
  border-color: rgba(37, 99, 235, 0.45);
  color: var(--primary);
  background: #f8faff;
}

.language-chevron {
  color: var(--muted);
  transition: transform 200ms var(--ease);
}

.language-trigger[aria-expanded="true"] .language-chevron {
  transform: rotate(180deg);
}

.language-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 61;
  width: 200px;
  max-height: min(380px, calc(100dvh - 88px));
  padding: 6px;
  overflow-y: auto;
  border: 1px solid rgba(17, 17, 17, 0.1);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.16);
}

.language-option {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}

.language-option:hover,
.language-option:focus-visible {
  background: rgba(37, 99, 235, 0.06);
}

.language-option[aria-checked="true"] {
  background: rgba(37, 99, 235, 0.06);
  color: var(--primary);
}

.page-main {
  width: 100%;
  flex: 1;
  padding: 56px 32px 80px;
}

.contact-card {
  width: 100%;
  max-width: 1074px;
  margin: 0 auto;
  padding: 56px;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1,
h2 {
  color: var(--heading);
  font-family: var(--display-font);
  font-weight: 700;
}

h1 {
  margin: 0 0 16px;
  font-size: 44px;
  line-height: 1.1;
}

.intro {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
  text-wrap: pretty;
}

.noscript-message,
.form-error {
  border: 1px solid rgba(180, 35, 24, 0.22);
  border-radius: 8px;
  background: var(--danger-bg);
  color: var(--danger);
}

.noscript-message {
  margin: 24px 0 0;
  padding: 12px 14px;
  font-size: 14px;
}

#contact-form {
  margin-top: 36px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.field-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
}

.field-grid-bottom {
  align-items: start;
}

.field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field label,
.compliance-fieldset legend {
  color: var(--heading);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

.field label {
  display: flex;
  gap: 4px;
}

.required {
  flex: 0 0 auto;
  color: var(--required);
}

input[type="text"],
input[type="email"],
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: 0;
  background: var(--surface);
  color: var(--heading);
  font-size: 14.5px;
  font-weight: 400;
  transition: border-color 200ms var(--ease), box-shadow 200ms var(--ease), background 200ms var(--ease);
}

textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}

select {
  cursor: pointer;
}

input::placeholder,
textarea::placeholder {
  color: #777d88;
  opacity: 1;
}

input[type="text"]:hover,
input[type="email"]:hover,
select:hover,
textarea:hover {
  border-color: rgba(17, 17, 17, 0.24);
}

input[type="text"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.field.has-error input,
.field.has-error select,
.field.has-error textarea {
  border-color: var(--danger);
  background: #fffafa;
}

.field-error {
  margin: 0;
  color: var(--danger);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.4;
}

.compliance-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 0;
}

.compliance-fieldset legend {
  width: 100%;
  margin: 0 0 5px;
  padding: 0;
}

.check-row {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--heading);
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
}

.check-row input {
  width: 18px;
  height: 18px;
  margin: 0;
  flex: 0 0 auto;
  accent-color: var(--primary);
  cursor: pointer;
}

.submit-area {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
}

.form-error {
  min-width: 0;
  margin: 0 auto 0 0;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.45;
}

.submit-button,
.secondary-button,
.primary-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  cursor: pointer;
  transition: background 200ms var(--ease), color 200ms var(--ease), border-color 200ms var(--ease), box-shadow 200ms var(--ease);
}

.submit-button {
  min-width: 130px;
  padding: 14px 32px;
  gap: 8px;
  border: 0;
  border-radius: 16px;
  background: var(--primary);
  box-shadow: 0 12px 40px rgba(37, 99, 235, 0.18);
  color: var(--surface);
  font-size: 15px;
}

.submit-button:hover:not(:disabled) {
  background: var(--primary-hover);
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.26);
}

.submit-button:active:not(:disabled) {
  background: var(--primary-active);
}

.submit-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.submit-spinner {
  display: none;
  animation: spin 800ms linear infinite;
}

.submit-button.is-loading .submit-arrow {
  display: none;
}

.submit-button.is-loading .submit-spinner {
  display: block;
}

.success-view {
  min-height: 360px;
  padding: 48px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
}

.success-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--success-bg);
  color: var(--success);
}

.success-view h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.25;
}

.success-view > p {
  max-width: 400px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.success-actions {
  margin-top: 10px;
  display: flex;
  justify-content: center;
  gap: 12px;
}

.secondary-button,
.primary-link {
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 13.5px;
}

.secondary-button {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--heading);
}

.secondary-button:hover {
  border-color: rgba(37, 99, 235, 0.5);
  color: var(--primary);
}

.primary-link {
  border: 1px solid var(--primary);
  background: var(--primary);
  color: var(--surface);
}

.primary-link:hover {
  border-color: var(--primary-hover);
  background: var(--primary-hover);
  color: var(--surface);
}

.site-footer {
  border-top: 1px solid rgba(17, 17, 17, 0.08);
  background: var(--surface);
  padding: 24px 32px;
}

.footer-inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-brand {
  gap: 8px;
  font-size: 14px;
}

.legal {
  color: var(--muted);
  font-size: 12px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 767px) {
  .nav-inner {
    padding: 0 20px;
  }

  .page-main {
    padding: 32px 20px 56px;
  }

  .contact-card {
    padding: 32px 24px;
    border-radius: 12px;
  }

  h1 {
    font-size: 36px;
  }

  .field-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .submit-area {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .form-error {
    width: 100%;
  }

  .submit-button {
    width: 100%;
  }

  .site-footer {
    padding: 24px 20px;
  }
}

@media (max-width: 479px) {
  .nav-inner {
    gap: 12px;
  }

  .page-main {
    padding: 24px 12px 40px;
  }

  .contact-card {
    padding: 28px 18px;
  }

  h1 {
    font-size: 32px;
  }

  .intro {
    font-size: 15px;
  }

  #contact-form {
    margin-top: 30px;
  }

  .success-actions {
    width: 100%;
    flex-direction: column;
  }

  .secondary-button,
  .primary-link {
    width: 100%;
  }

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
